Remove zfill dependency

The language has padStart now.
This commit is contained in:
Domenic Denicola 2019-08-16 22:48:35 -04:00
commit 93ef4c6779
3 changed files with 2 additions and 9 deletions

View file

@ -3,7 +3,6 @@ const path = require("path");
const fs = require("mz/fs");
const mkdirp = require("mkdirp-then");
const request = require("requisition");
const zfill = require("zfill");
const { JSDOM } = require("jsdom");
const FILENAME_PREFIX = "chapter";
@ -39,7 +38,7 @@ async function downloadAllChapters(manifest, startChapterURL, cachePath, manifes
await mkdirp(cachePath);
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}`);

5
npm-shrinkwrap.json generated
View file

@ -2114,11 +2114,6 @@
"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": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-2.1.2.tgz",

View file

@ -29,8 +29,7 @@
"thenify": "^3.3.0",
"throat": "^5.0.0",
"xmlserializer": "^0.6.1",
"yargs": "^13.3.0",
"zfill": "0.0.2"
"yargs": "^13.3.0"
},
"devDependencies": {
"eslint": "6.1.0"