Skip to content

Commit

Permalink
Merge bce9f4b into 7d79072
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Nov 8, 2020
2 parents 7d79072 + bce9f4b commit 768eae6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: node_js
node_js:
- stable
cache:
npm: false
install:
- npm install
script:
Expand Down
4 changes: 2 additions & 2 deletions docs/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ function main() {
// Convert input to NATO phonetic alphabet text
var input = document.querySelector('input');
input.focus();
input.addEventListener('input', function(event) {
input.addEventListener('input', function (event) {
var text = event.target.value;
var words = converter(text);
var chips = words.map(function(word) {
var chips = words.map(function (word) {
return word ? generateChipMarkup(word) : null;
});
chipSet.innerHTML = chips.join('');
Expand Down
4 changes: 2 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
roots: ['<rootDir>/src'],
transform: {
'^.+\\.tsx?$': 'ts-jest'
'^.+\\.tsx?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
"@typescript-eslint/eslint-plugin": "^3.0.0",
"@typescript-eslint/parser": "^3.0.0",
"eslint": "^7.0.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-prettier": "^3.1.4",
"husky": "^4.0.10",
"jest": "^25.1.0",
"lint-staged": "^10.0.1",
"prettier": "^1.19.1",
"prettier": "^2.1.2",
"rollup": "^2.33.1",
"standard-version": "^5",
"ts-jest": "^25.0.0",
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
output: {
file: 'umd/phonetic-alphabet-converter.js',
format: 'umd',
name: 'PhoneticAlphabetConverter'
name: 'PhoneticAlphabetConverter',
},
plugins: [typescript({ module: 'es2015' })]
plugins: [typescript({ module: 'es2015' })],
};
8 changes: 4 additions & 4 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ describe('error', () => {
[],
() => undefined,
new Date(),
Symbol()
])('throws when first argument is %s', value => {
Symbol(),
])('throws when first argument is %s', (value) => {
expect(() => {
converter(value as string);
}).toThrowError('First argument must be a string');
Expand All @@ -21,14 +21,14 @@ describe('error', () => {
describe('converter', () => {
it.each([
['mark', ['mike', 'alpha', 'romeo', 'kilo']],
['abc', ['alpha', 'bravo', 'charlie']]
['abc', ['alpha', 'bravo', 'charlie']],
])('converts "%s" correctly', (text, expected) => {
expect(converter(text)).toEqual(expected);
});

it('uses alphabet provided in 2nd argument', () => {
const alphabet = {
a: 'alfa'
a: 'alfa',
};
const letter = 'a';
expect(converter(letter, alphabet)).toEqual([alphabet[letter]]);
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const NATO_PHONETIC_ALPHABET: PhoneticAlphabet = {
w: 'whiskey',
x: 'x-ray',
y: 'yankee',
z: 'zulu'
z: 'zulu',
};

/**
Expand All @@ -42,5 +42,5 @@ export default function converter(
return text
.toLowerCase()
.split('')
.map(letter => alphabet[letter]);
.map((letter) => alphabet[letter]);
}

0 comments on commit 768eae6

Please sign in to comment.