Skip to content

Commit

Permalink
Format with biome
Browse files Browse the repository at this point in the history
  • Loading branch information
hyzyla committed Aug 31, 2024
1 parent ed97b89 commit 80474f9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/index.esm.base64.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function base64ToUint8Array(base64: string) {
return bytes;
}

const BASE64_WARNING = "@hyzyla/pdfium: Using base64-encoded WASM binary.\n" +
const BASE64_WARNING =
"@hyzyla/pdfium: Using base64-encoded WASM binary.\n" +
"\n" +
`This can lead to larger bundle size or slower load time. Use "@hyzyla/pdfium" with a proper ` +
"setup for better performance. You can also disable this warning by passing { disableBase64Warning: true } " +
Expand Down
4 changes: 2 additions & 2 deletions src/index.esm.cdn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ declare const __WASM_SHA265_B64__: string;
const CDN_WASM_LINK = `https://cdn.jsdelivr.net/npm/@hyzyla/pdfium@${__PACKAGE_VERSION__}/dist/pdfium.wasm`;
const WASM_INTEGRITY = `sha256-${__WASM_SHA265_B64__}`;

const CDN_WARNING = "@hyzyla/pdfium: Fetching wasm binary from a CDN.\n" +
const CDN_WARNING =
"@hyzyla/pdfium: Fetching wasm binary from a CDN.\n" +
"\n" +
`This can lead to slower load time or potential network issues. Use "@hyzyla/pdfium" with a local wasm binary ` +
"for better performance and reliability. You can also disable this warning by passing { disableCDNWarning: true } " +
"to PDFiumLibrary.init() method";

export class PDFiumLibrary extends _PDFiumLibrary {

static _cache: ArrayBuffer | null = null;

static async init(options?: { disableCDNWarning?: boolean }) {
Expand Down
8 changes: 4 additions & 4 deletions src/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { FPDFErrorCode } from "./constants";
import { PDFiumDocument } from "./document";
import { lengthBytesUTF8, stringToUTF8 } from "./emscripten";

const NO_OPTION_WARNING = "@hyzyla/pdfium: wasmUrl, wasmBinary is required for browser environment. \n\n"
+ "Please provide the wasm binary or URL to the init method. You can also use '@hyzyla/pdfium/browser/cdn'"
+ "or '@hyzyla/pdfium/browser/base64' for quick setup, but it's not recommended for production use.";

const NO_OPTION_WARNING =
"@hyzyla/pdfium: wasmUrl, wasmBinary is required for browser environment. \n\n" +
"Please provide the wasm binary or URL to the init method. You can also use '@hyzyla/pdfium/browser/cdn'" +
"or '@hyzyla/pdfium/browser/base64' for quick setup, but it's not recommended for production use.";

/**
* Converts a JavaScript string to a null-terminated C string and returns
Expand Down

0 comments on commit 80474f9

Please sign in to comment.