Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 27, 2021
1 parent bbfb42e commit 9d3c382
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
*.d.ts
*.log
coverage/
node_modules/
yarn.lock
*.d.ts
*.log
.DS_Store
archive.zip
yarn.lock
11 changes: 6 additions & 5 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,12 @@ function onend() {
}

function onconcat(body) {
let data = String(body).split('\n').filter(not(comment)).join('\n')

data = dsv
const data = dsv
.dsvFormat(';')
.parse(headers.join(';') + data)
.parse(
headers.join(';') +
String(body).split('\n').filter(not(comment)).join('\n')
)
.map(function (script) {
return {
code: script.code,
Expand All @@ -92,7 +93,7 @@ function onconcat(body) {
' *',
' * @type {Script[]} List of scripts.',
' */',
'export var iso15924 = ' + JSON.stringify(data, null, 2),
'export const iso15924 = ' + JSON.stringify(data, null, 2),
''
].join('\n'),
bail
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @type {Script[]} List of scripts.
*/
export var iso15924 = [
export const iso15924 = [
{
code: 'Adlm',
name: 'Adlam',
Expand Down
3 changes: 1 addition & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ import {iso15924} from './index.js'

test('iso15924', function (t) {
let index = -1
let script

t.plan(6)

t.ok(Array.isArray(iso15924), 'should be an `array`')

while (++index < iso15924.length) {
script = iso15924[index]
const script = iso15924[index]
if (script.code === 'Latn') {
t.equal(script.code, 'Latn', 'should have a four-character code')
t.equal(script.numeric, '215', 'should have a three-character code')
Expand Down

0 comments on commit 9d3c382

Please sign in to comment.