rtf-codec 3.0.2 → 3.0.3
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.
- package/dist/codec.d.cts +18 -18
- package/dist/codec.d.ts +18 -18
- package/dist/embedded-object.cjs +12 -3
- package/dist/embedded-object.js +12 -3
- package/package.json +3 -3
package/dist/codec.d.cts
CHANGED
|
@@ -96,9 +96,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
96
96
|
symbol: z.ZodString;
|
|
97
97
|
name: z.ZodOptional<z.ZodString>;
|
|
98
98
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
99
|
-
time: "time";
|
|
100
99
|
length: "length";
|
|
101
100
|
mass: "mass";
|
|
101
|
+
time: "time";
|
|
102
102
|
electricCurrent: "electricCurrent";
|
|
103
103
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
104
104
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -244,9 +244,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
244
244
|
symbol: z.ZodString;
|
|
245
245
|
name: z.ZodOptional<z.ZodString>;
|
|
246
246
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
247
|
-
time: "time";
|
|
248
247
|
length: "length";
|
|
249
248
|
mass: "mass";
|
|
249
|
+
time: "time";
|
|
250
250
|
electricCurrent: "electricCurrent";
|
|
251
251
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
252
252
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -392,9 +392,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
392
392
|
symbol: z.ZodString;
|
|
393
393
|
name: z.ZodOptional<z.ZodString>;
|
|
394
394
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
395
|
-
time: "time";
|
|
396
395
|
length: "length";
|
|
397
396
|
mass: "mass";
|
|
397
|
+
time: "time";
|
|
398
398
|
electricCurrent: "electricCurrent";
|
|
399
399
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
400
400
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -540,9 +540,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
540
540
|
symbol: z.ZodString;
|
|
541
541
|
name: z.ZodOptional<z.ZodString>;
|
|
542
542
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
543
|
-
time: "time";
|
|
544
543
|
length: "length";
|
|
545
544
|
mass: "mass";
|
|
545
|
+
time: "time";
|
|
546
546
|
electricCurrent: "electricCurrent";
|
|
547
547
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
548
548
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -600,7 +600,7 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
600
600
|
presentation: z.ZodOptional<z.ZodObject<{
|
|
601
601
|
latex: z.ZodString;
|
|
602
602
|
}, z.core.$strip>>;
|
|
603
|
-
content: z.ZodOptional<z.
|
|
603
|
+
content: z.ZodOptional<z.ZodType<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression, z.core.$ZodTypeInternals<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression>>>;
|
|
604
604
|
provenance: z.ZodOptional<z.ZodObject<{
|
|
605
605
|
source: z.ZodString;
|
|
606
606
|
pageRef: z.ZodOptional<z.ZodString>;
|
|
@@ -719,9 +719,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
719
719
|
symbol: z.ZodString;
|
|
720
720
|
name: z.ZodOptional<z.ZodString>;
|
|
721
721
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
722
|
-
time: "time";
|
|
723
722
|
length: "length";
|
|
724
723
|
mass: "mass";
|
|
724
|
+
time: "time";
|
|
725
725
|
electricCurrent: "electricCurrent";
|
|
726
726
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
727
727
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -785,7 +785,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
785
785
|
bottomPt: z.ZodNumber;
|
|
786
786
|
leftPt: z.ZodNumber;
|
|
787
787
|
}, z.core.$strip>;
|
|
788
|
-
blocks: z.ZodArray<z.
|
|
788
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
789
789
|
breakType: z.ZodOptional<z.ZodEnum<{
|
|
790
790
|
nextPage: "nextPage";
|
|
791
791
|
continuous: "continuous";
|
|
@@ -826,9 +826,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
826
826
|
symbol: z.ZodString;
|
|
827
827
|
name: z.ZodOptional<z.ZodString>;
|
|
828
828
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
829
|
-
time: "time";
|
|
830
829
|
length: "length";
|
|
831
830
|
mass: "mass";
|
|
831
|
+
time: "time";
|
|
832
832
|
electricCurrent: "electricCurrent";
|
|
833
833
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
834
834
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -928,7 +928,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
928
928
|
widthPt: z.ZodNumber;
|
|
929
929
|
heightPt: z.ZodNumber;
|
|
930
930
|
}, z.core.$strip>>>;
|
|
931
|
-
blocks: z.ZodArray<z.
|
|
931
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
932
932
|
}, z.core.$strip>>;
|
|
933
933
|
notes: z.ZodString;
|
|
934
934
|
source: z.ZodOptional<z.ZodObject<{
|
|
@@ -965,9 +965,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
965
965
|
symbol: z.ZodString;
|
|
966
966
|
name: z.ZodOptional<z.ZodString>;
|
|
967
967
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
968
|
-
time: "time";
|
|
969
968
|
length: "length";
|
|
970
969
|
mass: "mass";
|
|
970
|
+
time: "time";
|
|
971
971
|
electricCurrent: "electricCurrent";
|
|
972
972
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
973
973
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -1416,7 +1416,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
1416
1416
|
columns: z.ZodArray<z.ZodNumber>;
|
|
1417
1417
|
}, z.core.$strip>>;
|
|
1418
1418
|
}, z.core.$strip>;
|
|
1419
|
-
embeddedObjects: z.ZodOptional<z.ZodArray<z.
|
|
1419
|
+
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodType<import("document-schema.js").ContentEmbeddedObject, import("document-schema.js").ContentEmbeddedObject, z.core.$ZodTypeInternals<import("document-schema.js").ContentEmbeddedObject, import("document-schema.js").ContentEmbeddedObject>>>>;
|
|
1420
1420
|
dataValidations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1421
1421
|
ranges: z.ZodArray<z.ZodObject<{
|
|
1422
1422
|
startRow: z.ZodNumber;
|
|
@@ -1425,11 +1425,11 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
1425
1425
|
endColumn: z.ZodNumber;
|
|
1426
1426
|
}, z.core.$strip>>;
|
|
1427
1427
|
type: z.ZodEnum<{
|
|
1428
|
-
decimal: "decimal";
|
|
1429
|
-
list: "list";
|
|
1430
1428
|
date: "date";
|
|
1431
1429
|
custom: "custom";
|
|
1432
1430
|
time: "time";
|
|
1431
|
+
decimal: "decimal";
|
|
1432
|
+
list: "list";
|
|
1433
1433
|
whole: "whole";
|
|
1434
1434
|
textLength: "textLength";
|
|
1435
1435
|
}>;
|
|
@@ -2062,9 +2062,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2062
2062
|
symbol: z.ZodString;
|
|
2063
2063
|
name: z.ZodOptional<z.ZodString>;
|
|
2064
2064
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2065
|
-
time: "time";
|
|
2066
2065
|
length: "length";
|
|
2067
2066
|
mass: "mass";
|
|
2067
|
+
time: "time";
|
|
2068
2068
|
electricCurrent: "electricCurrent";
|
|
2069
2069
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2070
2070
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -2164,7 +2164,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2164
2164
|
widthPt: z.ZodNumber;
|
|
2165
2165
|
heightPt: z.ZodNumber;
|
|
2166
2166
|
}, z.core.$strip>>>;
|
|
2167
|
-
blocks: z.ZodArray<z.
|
|
2167
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
2168
2168
|
}, z.core.$strip>>;
|
|
2169
2169
|
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2170
2170
|
kind: z.ZodLiteral<"rect">;
|
|
@@ -2453,9 +2453,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2453
2453
|
symbol: z.ZodString;
|
|
2454
2454
|
name: z.ZodOptional<z.ZodString>;
|
|
2455
2455
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2456
|
-
time: "time";
|
|
2457
2456
|
length: "length";
|
|
2458
2457
|
mass: "mass";
|
|
2458
|
+
time: "time";
|
|
2459
2459
|
electricCurrent: "electricCurrent";
|
|
2460
2460
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2461
2461
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -2513,7 +2513,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2513
2513
|
presentation: z.ZodOptional<z.ZodObject<{
|
|
2514
2514
|
latex: z.ZodString;
|
|
2515
2515
|
}, z.core.$strip>>;
|
|
2516
|
-
content: z.ZodOptional<z.
|
|
2516
|
+
content: z.ZodOptional<z.ZodType<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression, z.core.$ZodTypeInternals<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression>>>;
|
|
2517
2517
|
provenance: z.ZodOptional<z.ZodObject<{
|
|
2518
2518
|
source: z.ZodString;
|
|
2519
2519
|
pageRef: z.ZodOptional<z.ZodString>;
|
|
@@ -2553,9 +2553,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2553
2553
|
symbol: z.ZodString;
|
|
2554
2554
|
name: z.ZodOptional<z.ZodString>;
|
|
2555
2555
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2556
|
-
time: "time";
|
|
2557
2556
|
length: "length";
|
|
2558
2557
|
mass: "mass";
|
|
2558
|
+
time: "time";
|
|
2559
2559
|
electricCurrent: "electricCurrent";
|
|
2560
2560
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2561
2561
|
amountOfSubstance: "amountOfSubstance";
|
package/dist/codec.d.ts
CHANGED
|
@@ -96,9 +96,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
96
96
|
symbol: z.ZodString;
|
|
97
97
|
name: z.ZodOptional<z.ZodString>;
|
|
98
98
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
99
|
-
time: "time";
|
|
100
99
|
length: "length";
|
|
101
100
|
mass: "mass";
|
|
101
|
+
time: "time";
|
|
102
102
|
electricCurrent: "electricCurrent";
|
|
103
103
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
104
104
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -244,9 +244,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
244
244
|
symbol: z.ZodString;
|
|
245
245
|
name: z.ZodOptional<z.ZodString>;
|
|
246
246
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
247
|
-
time: "time";
|
|
248
247
|
length: "length";
|
|
249
248
|
mass: "mass";
|
|
249
|
+
time: "time";
|
|
250
250
|
electricCurrent: "electricCurrent";
|
|
251
251
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
252
252
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -392,9 +392,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
392
392
|
symbol: z.ZodString;
|
|
393
393
|
name: z.ZodOptional<z.ZodString>;
|
|
394
394
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
395
|
-
time: "time";
|
|
396
395
|
length: "length";
|
|
397
396
|
mass: "mass";
|
|
397
|
+
time: "time";
|
|
398
398
|
electricCurrent: "electricCurrent";
|
|
399
399
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
400
400
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -540,9 +540,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
540
540
|
symbol: z.ZodString;
|
|
541
541
|
name: z.ZodOptional<z.ZodString>;
|
|
542
542
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
543
|
-
time: "time";
|
|
544
543
|
length: "length";
|
|
545
544
|
mass: "mass";
|
|
545
|
+
time: "time";
|
|
546
546
|
electricCurrent: "electricCurrent";
|
|
547
547
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
548
548
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -600,7 +600,7 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
600
600
|
presentation: z.ZodOptional<z.ZodObject<{
|
|
601
601
|
latex: z.ZodString;
|
|
602
602
|
}, z.core.$strip>>;
|
|
603
|
-
content: z.ZodOptional<z.
|
|
603
|
+
content: z.ZodOptional<z.ZodType<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression, z.core.$ZodTypeInternals<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression>>>;
|
|
604
604
|
provenance: z.ZodOptional<z.ZodObject<{
|
|
605
605
|
source: z.ZodString;
|
|
606
606
|
pageRef: z.ZodOptional<z.ZodString>;
|
|
@@ -719,9 +719,9 @@ declare const rtfCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Arr
|
|
|
719
719
|
symbol: z.ZodString;
|
|
720
720
|
name: z.ZodOptional<z.ZodString>;
|
|
721
721
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
722
|
-
time: "time";
|
|
723
722
|
length: "length";
|
|
724
723
|
mass: "mass";
|
|
724
|
+
time: "time";
|
|
725
725
|
electricCurrent: "electricCurrent";
|
|
726
726
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
727
727
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -785,7 +785,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
785
785
|
bottomPt: z.ZodNumber;
|
|
786
786
|
leftPt: z.ZodNumber;
|
|
787
787
|
}, z.core.$strip>;
|
|
788
|
-
blocks: z.ZodArray<z.
|
|
788
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
789
789
|
breakType: z.ZodOptional<z.ZodEnum<{
|
|
790
790
|
nextPage: "nextPage";
|
|
791
791
|
continuous: "continuous";
|
|
@@ -826,9 +826,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
826
826
|
symbol: z.ZodString;
|
|
827
827
|
name: z.ZodOptional<z.ZodString>;
|
|
828
828
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
829
|
-
time: "time";
|
|
830
829
|
length: "length";
|
|
831
830
|
mass: "mass";
|
|
831
|
+
time: "time";
|
|
832
832
|
electricCurrent: "electricCurrent";
|
|
833
833
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
834
834
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -928,7 +928,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
928
928
|
widthPt: z.ZodNumber;
|
|
929
929
|
heightPt: z.ZodNumber;
|
|
930
930
|
}, z.core.$strip>>>;
|
|
931
|
-
blocks: z.ZodArray<z.
|
|
931
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
932
932
|
}, z.core.$strip>>;
|
|
933
933
|
notes: z.ZodString;
|
|
934
934
|
source: z.ZodOptional<z.ZodObject<{
|
|
@@ -965,9 +965,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
965
965
|
symbol: z.ZodString;
|
|
966
966
|
name: z.ZodOptional<z.ZodString>;
|
|
967
967
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
968
|
-
time: "time";
|
|
969
968
|
length: "length";
|
|
970
969
|
mass: "mass";
|
|
970
|
+
time: "time";
|
|
971
971
|
electricCurrent: "electricCurrent";
|
|
972
972
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
973
973
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -1416,7 +1416,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
1416
1416
|
columns: z.ZodArray<z.ZodNumber>;
|
|
1417
1417
|
}, z.core.$strip>>;
|
|
1418
1418
|
}, z.core.$strip>;
|
|
1419
|
-
embeddedObjects: z.ZodOptional<z.ZodArray<z.
|
|
1419
|
+
embeddedObjects: z.ZodOptional<z.ZodArray<z.ZodType<import("document-schema.js").ContentEmbeddedObject, import("document-schema.js").ContentEmbeddedObject, z.core.$ZodTypeInternals<import("document-schema.js").ContentEmbeddedObject, import("document-schema.js").ContentEmbeddedObject>>>>;
|
|
1420
1420
|
dataValidations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1421
1421
|
ranges: z.ZodArray<z.ZodObject<{
|
|
1422
1422
|
startRow: z.ZodNumber;
|
|
@@ -1425,11 +1425,11 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
1425
1425
|
endColumn: z.ZodNumber;
|
|
1426
1426
|
}, z.core.$strip>>;
|
|
1427
1427
|
type: z.ZodEnum<{
|
|
1428
|
-
decimal: "decimal";
|
|
1429
|
-
list: "list";
|
|
1430
1428
|
date: "date";
|
|
1431
1429
|
custom: "custom";
|
|
1432
1430
|
time: "time";
|
|
1431
|
+
decimal: "decimal";
|
|
1432
|
+
list: "list";
|
|
1433
1433
|
whole: "whole";
|
|
1434
1434
|
textLength: "textLength";
|
|
1435
1435
|
}>;
|
|
@@ -2062,9 +2062,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2062
2062
|
symbol: z.ZodString;
|
|
2063
2063
|
name: z.ZodOptional<z.ZodString>;
|
|
2064
2064
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2065
|
-
time: "time";
|
|
2066
2065
|
length: "length";
|
|
2067
2066
|
mass: "mass";
|
|
2067
|
+
time: "time";
|
|
2068
2068
|
electricCurrent: "electricCurrent";
|
|
2069
2069
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2070
2070
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -2164,7 +2164,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2164
2164
|
widthPt: z.ZodNumber;
|
|
2165
2165
|
heightPt: z.ZodNumber;
|
|
2166
2166
|
}, z.core.$strip>>>;
|
|
2167
|
-
blocks: z.ZodArray<z.
|
|
2167
|
+
blocks: z.ZodLazy<z.ZodArray<z.ZodType<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock, z.core.$ZodTypeInternals<import("document-schema.js").ContentBlock, import("document-schema.js").ContentBlock>>>>;
|
|
2168
2168
|
}, z.core.$strip>>;
|
|
2169
2169
|
vectors: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2170
2170
|
kind: z.ZodLiteral<"rect">;
|
|
@@ -2453,9 +2453,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2453
2453
|
symbol: z.ZodString;
|
|
2454
2454
|
name: z.ZodOptional<z.ZodString>;
|
|
2455
2455
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2456
|
-
time: "time";
|
|
2457
2456
|
length: "length";
|
|
2458
2457
|
mass: "mass";
|
|
2458
|
+
time: "time";
|
|
2459
2459
|
electricCurrent: "electricCurrent";
|
|
2460
2460
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2461
2461
|
amountOfSubstance: "amountOfSubstance";
|
|
@@ -2513,7 +2513,7 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2513
2513
|
presentation: z.ZodOptional<z.ZodObject<{
|
|
2514
2514
|
latex: z.ZodString;
|
|
2515
2515
|
}, z.core.$strip>>;
|
|
2516
|
-
content: z.ZodOptional<z.
|
|
2516
|
+
content: z.ZodOptional<z.ZodType<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression, z.core.$ZodTypeInternals<import("document-schema.js").MathExpression, import("document-schema.js").MathExpression>>>;
|
|
2517
2517
|
provenance: z.ZodOptional<z.ZodObject<{
|
|
2518
2518
|
source: z.ZodString;
|
|
2519
2519
|
pageRef: z.ZodOptional<z.ZodString>;
|
|
@@ -2553,9 +2553,9 @@ declare const rtfContentCodec: z.ZodCodec<z.ZodCustom<Uint8Array<ArrayBuffer>, U
|
|
|
2553
2553
|
symbol: z.ZodString;
|
|
2554
2554
|
name: z.ZodOptional<z.ZodString>;
|
|
2555
2555
|
dimension: z.ZodRecord<z.ZodEnum<{
|
|
2556
|
-
time: "time";
|
|
2557
2556
|
length: "length";
|
|
2558
2557
|
mass: "mass";
|
|
2558
|
+
time: "time";
|
|
2559
2559
|
electricCurrent: "electricCurrent";
|
|
2560
2560
|
thermodynamicTemperature: "thermodynamicTemperature";
|
|
2561
2561
|
amountOfSubstance: "amountOfSubstance";
|
package/dist/embedded-object.cjs
CHANGED
|
@@ -176,7 +176,6 @@ function writeEmbeddedObjectData(embedded) {
|
|
|
176
176
|
return out;
|
|
177
177
|
}
|
|
178
178
|
function knownContentEmbeddedObjectFields(embedded) {
|
|
179
|
-
const source = document_schema_js.SourceResidueSchema.safeParse(embedded.source);
|
|
180
179
|
return {
|
|
181
180
|
objectKind: embedded.objectKind,
|
|
182
181
|
document: embedded.document,
|
|
@@ -185,9 +184,19 @@ function knownContentEmbeddedObjectFields(embedded) {
|
|
|
185
184
|
...embedded.anchorColumn === void 0 ? {} : { anchorColumn: embedded.anchorColumn },
|
|
186
185
|
...embedded.offsetXPt === void 0 ? {} : { offsetXPt: embedded.offsetXPt },
|
|
187
186
|
...embedded.offsetYPt === void 0 ? {} : { offsetYPt: embedded.offsetYPt },
|
|
188
|
-
...source
|
|
187
|
+
...embedded.source === void 0 ? {} : { source: embedded.source }
|
|
189
188
|
};
|
|
190
189
|
}
|
|
190
|
+
function isRecord(value) {
|
|
191
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
192
|
+
}
|
|
193
|
+
function withoutInvalidSource(value) {
|
|
194
|
+
if (!isRecord(value) || !("source" in value)) return value;
|
|
195
|
+
if (document_schema_js.SourceResidueSchema.safeParse(value.source).success) return value;
|
|
196
|
+
const sanitized = {};
|
|
197
|
+
for (const [key, entry] of Object.entries(value)) if (key !== "source") sanitized[key] = entry;
|
|
198
|
+
return sanitized;
|
|
199
|
+
}
|
|
191
200
|
function readEmbeddedObjectData(bytes) {
|
|
192
201
|
try {
|
|
193
202
|
const header = readObjectHeader(bytes);
|
|
@@ -202,7 +211,7 @@ function readEmbeddedObjectData(bytes) {
|
|
|
202
211
|
const olePackage = (0, archive_codec.readOlePackage)(packageStream.bytes);
|
|
203
212
|
const text = new TextDecoder("utf-8").decode(olePackage.fileBytes);
|
|
204
213
|
const parsed = JSON.parse(text);
|
|
205
|
-
const result = document_schema_js.ContentEmbeddedObjectSchema.safeParse(parsed);
|
|
214
|
+
const result = document_schema_js.ContentEmbeddedObjectSchema.safeParse(withoutInvalidSource(parsed));
|
|
206
215
|
if (!result.success) return;
|
|
207
216
|
skipPresentationObject(bytes, nativeDataStart + nativeDataSize);
|
|
208
217
|
return knownContentEmbeddedObjectFields(result.data);
|
package/dist/embedded-object.js
CHANGED
|
@@ -175,7 +175,6 @@ function writeEmbeddedObjectData(embedded) {
|
|
|
175
175
|
return out;
|
|
176
176
|
}
|
|
177
177
|
function knownContentEmbeddedObjectFields(embedded) {
|
|
178
|
-
const source = SourceResidueSchema.safeParse(embedded.source);
|
|
179
178
|
return {
|
|
180
179
|
objectKind: embedded.objectKind,
|
|
181
180
|
document: embedded.document,
|
|
@@ -184,9 +183,19 @@ function knownContentEmbeddedObjectFields(embedded) {
|
|
|
184
183
|
...embedded.anchorColumn === void 0 ? {} : { anchorColumn: embedded.anchorColumn },
|
|
185
184
|
...embedded.offsetXPt === void 0 ? {} : { offsetXPt: embedded.offsetXPt },
|
|
186
185
|
...embedded.offsetYPt === void 0 ? {} : { offsetYPt: embedded.offsetYPt },
|
|
187
|
-
...source
|
|
186
|
+
...embedded.source === void 0 ? {} : { source: embedded.source }
|
|
188
187
|
};
|
|
189
188
|
}
|
|
189
|
+
function isRecord(value) {
|
|
190
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
191
|
+
}
|
|
192
|
+
function withoutInvalidSource(value) {
|
|
193
|
+
if (!isRecord(value) || !("source" in value)) return value;
|
|
194
|
+
if (SourceResidueSchema.safeParse(value.source).success) return value;
|
|
195
|
+
const sanitized = {};
|
|
196
|
+
for (const [key, entry] of Object.entries(value)) if (key !== "source") sanitized[key] = entry;
|
|
197
|
+
return sanitized;
|
|
198
|
+
}
|
|
190
199
|
function readEmbeddedObjectData(bytes) {
|
|
191
200
|
try {
|
|
192
201
|
const header = readObjectHeader(bytes);
|
|
@@ -201,7 +210,7 @@ function readEmbeddedObjectData(bytes) {
|
|
|
201
210
|
const olePackage = readOlePackage(packageStream.bytes);
|
|
202
211
|
const text = new TextDecoder("utf-8").decode(olePackage.fileBytes);
|
|
203
212
|
const parsed = JSON.parse(text);
|
|
204
|
-
const result = ContentEmbeddedObjectSchema.safeParse(parsed);
|
|
213
|
+
const result = ContentEmbeddedObjectSchema.safeParse(withoutInvalidSource(parsed));
|
|
205
214
|
if (!result.success) return;
|
|
206
215
|
skipPresentationObject(bytes, nativeDataStart + nativeDataSize);
|
|
207
216
|
return knownContentEmbeddedObjectFields(result.data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rtf-codec",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.3",
|
|
4
4
|
"description": "Hand-written Rich Text Format (RTF 1.9.1) reader and writer against the shared document-schema.js content pivot.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"license": "MIT",
|
|
81
81
|
"packageManager": "pnpm@11.6.0",
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"archive-codec": "^1.6.
|
|
84
|
-
"document-schema.js": "^6.2.
|
|
83
|
+
"archive-codec": "^1.6.3",
|
|
84
|
+
"document-schema.js": "^6.2.2",
|
|
85
85
|
"zod": "^4.4.3"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|