@chialab/pdfjs-lib 1.0.0-alpha.41 → 1.0.0-alpha.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,21 @@ if (!Array.prototype.at) {
15
15
  enumerable: false
16
16
  });
17
17
  }
18
+ if (!ArrayBuffer.prototype.transferToFixedLength) {
19
+ Object.defineProperty(ArrayBuffer.prototype, "transferToFixedLength", {
20
+ value: function transferToFixedLength(newByteLength) {
21
+ const length = typeof newByteLength === "number" ? Math.min(newByteLength, this.byteLength) : this.byteLength;
22
+ const copy = this.slice(0, length);
23
+ if (typeof newByteLength === "number" && newByteLength > length) {
24
+ const bigger = new ArrayBuffer(newByteLength);
25
+ new Uint8Array(bigger).set(new Uint8Array(copy));
26
+ return bigger;
27
+ }
28
+ return copy;
29
+ },
30
+ enumerable: false
31
+ });
32
+ }
18
33
  if (!Promise.withResolvers) {
19
34
  Promise.withResolvers = function withResolvers() {
20
35
  let resolve;
@@ -51,7 +66,10 @@ if (!URL.parse) {
51
66
  enumerable: false,
52
67
  value: function parse(input, base) {
53
68
  try {
54
- return new URL(input, base || globalThis.location && globalThis.location.href);
69
+ return new URL(
70
+ input,
71
+ base || globalThis.location && globalThis.location.href
72
+ );
55
73
  } catch (_) {
56
74
  if (!globalThis.document || !globalThis.document.createElement) {
57
75
  return {};
@@ -48,7 +48,7 @@ import {
48
48
  updateUrlHash,
49
49
  warn,
50
50
  wrapReason
51
- } from "./chunk-5CXGBP2M.js";
51
+ } from "./chunk-PNBBIN2K.js";
52
52
  import {
53
53
  NodeCMapReaderFactory,
54
54
  NodeCanvasFactory,
@@ -63,7 +63,7 @@ import {
63
63
  utf8StringToString,
64
64
  warn,
65
65
  wrapReason
66
- } from "./chunk-5CXGBP2M.js";
66
+ } from "./chunk-PNBBIN2K.js";
67
67
  import {
68
68
  __privateAdd,
69
69
  __privateGet,
@@ -27,6 +27,21 @@ if (!Array.prototype.at) {
27
27
  enumerable: false
28
28
  });
29
29
  }
30
+ if (!ArrayBuffer.prototype.transferToFixedLength) {
31
+ Object.defineProperty(ArrayBuffer.prototype, "transferToFixedLength", {
32
+ value: function transferToFixedLength(newByteLength) {
33
+ const length = typeof newByteLength === "number" ? Math.min(newByteLength, this.byteLength) : this.byteLength;
34
+ const copy = this.slice(0, length);
35
+ if (typeof newByteLength === "number" && newByteLength > length) {
36
+ const bigger = new ArrayBuffer(newByteLength);
37
+ new Uint8Array(bigger).set(new Uint8Array(copy));
38
+ return bigger;
39
+ }
40
+ return copy;
41
+ },
42
+ enumerable: false
43
+ });
44
+ }
30
45
  if (!Promise.withResolvers) {
31
46
  Promise.withResolvers = function withResolvers() {
32
47
  let resolve;
@@ -63,7 +78,10 @@ if (!URL.parse) {
63
78
  enumerable: false,
64
79
  value: function parse(input, base) {
65
80
  try {
66
- return new URL(input, base || globalThis.location && globalThis.location.href);
81
+ return new URL(
82
+ input,
83
+ base || globalThis.location && globalThis.location.href
84
+ );
67
85
  } catch (_) {
68
86
  if (!globalThis.document || !globalThis.document.createElement) {
69
87
  return {};
@@ -6,7 +6,7 @@ import {
6
6
  bidi,
7
7
  convertBlackAndWhiteToRGBA,
8
8
  wrapReason
9
- } from "./chunk-G56GLMCB.js";
9
+ } from "./chunk-B3MHCDGS.js";
10
10
  import {
11
11
  BaseStandardFontDataFactory,
12
12
  CSSConstants,
@@ -9,7 +9,7 @@ import {
9
9
  convertToRGBA,
10
10
  grayToRGBA,
11
11
  wrapReason
12
- } from "./chunk-G56GLMCB.js";
12
+ } from "./chunk-B3MHCDGS.js";
13
13
  import {
14
14
  AbortException,
15
15
  AnnotationActionEventType,
@@ -20,7 +20,7 @@ export class SignatureExtractor {
20
20
  }[];
21
21
  static "__#private@#douglasPeuckerHelper"(points: any, start: any, end: any, output: any): void;
22
22
  static "__#private@#douglasPeucker"(points: any): any[] | null;
23
- static "__#private@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint32Array<ArrayBuffer> | Uint8Array<any>)[];
23
+ static "__#private@#bilateralFilter"(buf: any, width: any, height: any, sigmaS: any, sigmaR: any, kernelSize: any): (Uint8Array<any> | Uint32Array<ArrayBuffer>)[];
24
24
  static "__#private@#getHistogram"(buf: any): Uint32Array<ArrayBuffer>;
25
25
  static "__#private@#toUint8"(buf: any): Uint8ClampedArray<ArrayBuffer>;
26
26
  static "__#private@#guessThreshold"(histogram: any): number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chialab/pdfjs-lib",
3
3
  "description": "A custom Mozilla's PDF.js build with better Node support and extras.",
4
- "version": "1.0.0-alpha.41",
4
+ "version": "1.0.0-alpha.42",
5
5
  "type": "module",
6
6
  "author": "Chialab <dev@chialab.it>",
7
7
  "license": "MIT",