Skip to content

Commit

Permalink
Replace JSON data w/ JS data
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 13, 2021
1 parent fc38477 commit 556d2a7
Show file tree
Hide file tree
Showing 11 changed files with 661 additions and 661 deletions.
399 changes: 399 additions & 0 deletions packages/franc-all/data.js

Large diffs are not rendered by default.

399 changes: 0 additions & 399 deletions packages/franc-all/data.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/franc-all/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"guess"
],
"files": [
"data.json",
"data.js",
"expressions.js",
"index.js"
],
Expand Down
76 changes: 76 additions & 0 deletions packages/franc-min/data.js

Large diffs are not rendered by default.

76 changes: 0 additions & 76 deletions packages/franc-min/data.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/franc-min/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"guess"
],
"files": [
"data.json",
"data.js",
"expressions.js",
"index.js"
],
Expand Down
180 changes: 180 additions & 0 deletions packages/franc/data.js

Large diffs are not rendered by default.

180 changes: 0 additions & 180 deletions packages/franc/data.json

This file was deleted.

2 changes: 1 addition & 1 deletion packages/franc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var expressions = require('./expressions.js')

/* Load `data` (trigram information per language,
* per script). */
var data = require('./data.json')
var data = require('./data.js')

/* Expose `detectAll` on `detect`. */
detect.all = detectAll
Expand Down
2 changes: 1 addition & 1 deletion packages/franc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"trigram-utils": "^1.0.0"
},
"files": [
"data.json",
"data.js",
"expressions.js",
"index.js"
],
Expand Down
4 changes: 2 additions & 2 deletions script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ function generate(basename) {
)

fs.writeFileSync(
path.join(base, 'data.json'),
JSON.stringify(data, null, 2) + '\n'
path.join(base, 'data.js'),
'module.exports = ' + JSON.stringify(data, null, 2) + '\n'
)

fs.writeFileSync(path.join(base, 'readme.md'), generateReadme(pack, support))
Expand Down

0 comments on commit 556d2a7

Please sign in to comment.