refactor: apply eslint

This commit is contained in:
sbplat
2024-01-04 20:17:54 -05:00
parent 5fd505d4f4
commit 9c1588d150
53 changed files with 647 additions and 636 deletions

View File

@@ -1,9 +1,9 @@
import { PdfFile } from '../wrappers/PdfFile.js';
import { getPages } from './common/getPagesByIndex.js';
import { parsePageIndexSpecification } from './common/pageIndexesUtils'
import { PdfFile } from "../wrappers/PdfFile.js";
import { getPages } from "./common/getPagesByIndex.js";
import { parsePageIndexSpecification } from "./common/pageIndexesUtils";
export type ExtractPagesParamsType = {
export interface ExtractPagesParamsType {
file: PdfFile;
pageIndexes: string | number[];
}
@@ -11,13 +11,13 @@ export async function extractPages(params: ExtractPagesParamsType): Promise<PdfF
const { file, pageIndexes } = params;
const pdfLibDocument = await file.pdfLibDocument;
var indexes = pageIndexes;
let indexes = pageIndexes;
if (!Array.isArray(indexes)) {
indexes = parsePageIndexSpecification(indexes, pdfLibDocument.getPageCount());
}
const newFile = await getPages(file, indexes);
newFile.filename += "_extractedPages"
newFile.filename += "_extractedPages";
return newFile;
}