Remove zfill dependency
The language has padStart now.
This commit is contained in:
parent
3fbe458e08
commit
93ef4c6779
3 changed files with 2 additions and 9 deletions
|
|
@ -3,7 +3,6 @@ const path = require("path");
|
||||||
const fs = require("mz/fs");
|
const fs = require("mz/fs");
|
||||||
const mkdirp = require("mkdirp-then");
|
const mkdirp = require("mkdirp-then");
|
||||||
const request = require("requisition");
|
const request = require("requisition");
|
||||||
const zfill = require("zfill");
|
|
||||||
const { JSDOM } = require("jsdom");
|
const { JSDOM } = require("jsdom");
|
||||||
|
|
||||||
const FILENAME_PREFIX = "chapter";
|
const FILENAME_PREFIX = "chapter";
|
||||||
|
|
@ -39,7 +38,7 @@ async function downloadAllChapters(manifest, startChapterURL, cachePath, manifes
|
||||||
await mkdirp(cachePath);
|
await mkdirp(cachePath);
|
||||||
|
|
||||||
while (currentChapter !== null) {
|
while (currentChapter !== null) {
|
||||||
const filename = `${FILENAME_PREFIX}${zfill(chapterIndex, 3)}.html`;
|
const filename = `${FILENAME_PREFIX}${chapterIndex.toString().padStart(3, "0")}.html`;
|
||||||
|
|
||||||
console.log(`Downloading ${currentChapter}`);
|
console.log(`Downloading ${currentChapter}`);
|
||||||
|
|
||||||
|
|
|
||||||
5
npm-shrinkwrap.json
generated
5
npm-shrinkwrap.json
generated
|
|
@ -2114,11 +2114,6 @@
|
||||||
"decamelize": "^1.2.0"
|
"decamelize": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"zfill": {
|
|
||||||
"version": "0.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/zfill/-/zfill-0.0.2.tgz",
|
|
||||||
"integrity": "sha1-tzfH9xhK13hMd4QNkgMczor3eUQ="
|
|
||||||
},
|
|
||||||
"zip-stream": {
|
"zip-stream": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz",
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@
|
||||||
"thenify": "^3.3.0",
|
"thenify": "^3.3.0",
|
||||||
"throat": "^5.0.0",
|
"throat": "^5.0.0",
|
||||||
"xmlserializer": "^0.6.1",
|
"xmlserializer": "^0.6.1",
|
||||||
"yargs": "^13.3.0",
|
"yargs": "^13.3.0"
|
||||||
"zfill": "0.0.2"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "6.1.0"
|
"eslint": "6.1.0"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue