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}`);