Skip to content

Commit

Permalink
Update dev-dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 4, 2021
1 parent 6f9e77a commit 5f9c5be
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 42 deletions.
50 changes: 25 additions & 25 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fs from 'fs'
import path from 'path'
import https from 'https'
import fs from 'node:fs'
import path from 'node:path'
import https from 'node:https'
import concat from 'concat-stream'
import yauzl from 'yauzl'
import dsv from 'd3-dsv'
import {tsvParse} from 'd3-dsv'
import {bail} from 'bail'

/**
Expand All @@ -18,16 +18,16 @@ import {bail} from 'bail'
*/

/** @type {string[]} */
var other = []
var found = false
const other = []
let found = false

var scopes = {
const scopes = {
I: 'individual',
M: 'macrolanguage',
S: 'special'
}

var types = {
const types = {
A: 'ancient',
C: 'constructed',
E: 'extinct',
Expand All @@ -40,9 +40,9 @@ var types = {
// You can find download links here:
// <https://iso639-3.sil.org/code_tables/download_tables>
// Just get the complete code tables in UTF-8.
var url =
const url =
'https://iso639-3.sil.org/sites/iso639-3/files/downloads/iso-639-3_Code_Tables_20200515.zip'
var expectedName = 'iso-639-3_20200515.tab'
const expectedName = 'iso-639-3_20200515.tab'

https.request(url, onrequest).end()

Expand Down Expand Up @@ -76,7 +76,7 @@ function onopen(error, archive) {
* @param {import('yauzl').Entry} entry
*/
function onentry(entry) {
var name = path.basename(entry.fileName)
const name = path.basename(entry.fileName)

if (name !== expectedName) {
other.push(name)
Expand Down Expand Up @@ -112,19 +112,19 @@ function onend() {
* @param {Buffer} body
*/
function onconcat(body) {
var data = dsv.tsvParse(String(body)).map(
const data = tsvParse(String(body)).map(
// @ts-ignore
(d) => map(d)
)
/** @type {Object.<string, string>} */
var toB = {}
const toB = {}
/** @type {Object.<string, string>} */
var toT = {}
const toT = {}
/** @type {Object.<string, string>} */
var to1 = {}
var index = -1
const to1 = {}
let index = -1
/** @type {Language} */
var d
let d

while (++index < data.length) {
d = data[index]
Expand All @@ -135,22 +135,22 @@ function onconcat(body) {

fs.writeFile(
'iso6393.js',
'export var iso6393 = ' + JSON.stringify(data, null, 2) + '\n',
'export const iso6393 = ' + JSON.stringify(data, null, 2) + '\n',
bail
)
fs.writeFile(
'iso6393-to-1.js',
'export var iso6393To1 = ' + JSON.stringify(to1, null, 2) + '\n',
'export const iso6393To1 = ' + JSON.stringify(to1, null, 2) + '\n',
bail
)
fs.writeFile(
'iso6393-to-2b.js',
'export var iso6393To2B = ' + JSON.stringify(toB, null, 2) + '\n',
'export const iso6393To2B = ' + JSON.stringify(toB, null, 2) + '\n',
bail
)
fs.writeFile(
'iso6393-to-2t.js',
'export var iso6393To2T = ' + JSON.stringify(toT, null, 2) + '\n',
'export const iso6393To2T = ' + JSON.stringify(toT, null, 2) + '\n',
bail
)
}
Expand All @@ -160,12 +160,12 @@ function onconcat(body) {
* @returns {Language}
*/
function map(d) {
var name = d.Ref_Name
var id = d.Id
const name = d.Ref_Name
const id = d.Id
/** @type {string?} */
var type = types[d.Language_Type]
const type = types[d.Language_Type]
/** @type {string?} */
var scope = scopes[d.Scope]
const scope = scopes[d.Scope]

if (!name) {
console.error('Cannot handle language w/o name', d)
Expand Down
2 changes: 1 addition & 1 deletion iso6393-to-1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export var iso6393To1 = {
export const iso6393To1 = {
aar: 'aa',
abk: 'ab',
afr: 'af',
Expand Down
2 changes: 1 addition & 1 deletion iso6393-to-2b.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export var iso6393To2B = {
export const iso6393To2B = {
aar: 'aar',
abk: 'abk',
ace: 'ace',
Expand Down
2 changes: 1 addition & 1 deletion iso6393-to-2t.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export var iso6393To2T = {
export const iso6393To2T = {
aar: 'aar',
abk: 'abk',
ace: 'ace',
Expand Down
2 changes: 1 addition & 1 deletion iso6393.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export var iso6393 = [
export const iso6393 = [
{
name: 'Ghotuo',
type: 'living',
Expand Down
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,22 @@
],
"devDependencies": {
"@types/concat-stream": "^1.0.0",
"@types/d3-dsv": "^2.0.0",
"@types/node": "^14.0.0",
"@types/d3-dsv": "^3.0.0",
"@types/node": "^16.0.0",
"@types/tape": "^4.0.0",
"@types/yauzl": "^2.0.0",
"bail": "^2.0.0",
"c8": "^7.0.0",
"concat-stream": "^2.0.0",
"d3-dsv": "^2.0.0",
"d3-dsv": "^3.0.0",
"prettier": "^2.0.0",
"remark-cli": "^9.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-cli": "^10.0.0",
"remark-preset-wooorm": "^9.0.0",
"rimraf": "^3.0.0",
"tape": "^5.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
"xo": "^0.38.0",
"xo": "^0.46.0",
"yauzl": "^2.0.0"
},
"scripts": {
Expand All @@ -77,12 +77,7 @@
"trailingComma": "none"
},
"xo": {
"prettier": true,
"rules": {
"import/no-mutable-exports": "off",
"no-var": "off",
"prefer-arrow-callback": "off"
}
"prettier": true
},
"remarkConfig": {
"plugins": [
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import test from 'tape'
import {iso6393} from './index.js'

test('iso6393', function (t) {
var index = -1
let index = -1

t.plan(8)

Expand Down

0 comments on commit 5f9c5be

Please sign in to comment.