refactor: apply eslint
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user