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 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}`);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue