Skip to content

Commit

Permalink
feat(airport_codes): add additional alias ${iata} Airport
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Apr 16, 2018
1 parent 2e68cd8 commit 0500159
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions stream/tag_mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = function(){
var iata = trim( tags.iata );
if( iata ){
doc.setNameAlias( 'default', iata );
doc.setNameAlias( 'default', `${iata} Airport` );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/stream/tag_mapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports.tests.airport_codes = function(test, common) {
var stream = mapper();
stream.pipe( through.obj( function( doc, enc, next ){
t.equal(doc.getName('default'), 'test', 'correctly mapped');
t.deepEqual(doc.getNameAliases('default'), ['FOO'], 'correctly mapped');
t.deepEqual(doc.getNameAliases('default'), ['FOO', 'FOO Airport'], 'correctly mapped');
t.end(); // test will fail if not called (or called twice).
next();
}));
Expand Down

0 comments on commit 0500159

Please sign in to comment.