@es-joy/jsoe 0.20.6 → 0.22.0
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/CHANGES.md +8 -0
- package/badges/coverage-badge.svg +1 -1
- package/dist/formats/structuredCloning.d.ts.map +1 -1
- package/dist/index.js +34 -35
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
- package/rollup.config.js +2 -0
- package/src/deepEqual.js +1 -0
- package/src/deepEqual.js.map +1 -0
- package/src/formats/structuredCloning.js +33 -35
package/CHANGES.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="428" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="orange" stroke="#000" d="M0 0h120v20H0zM120 0h109v20H120zM229 0h87v20h-87zM316 0h112v20H316z"/><path fill="url(#smooth)" d="M0 0h428v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 99.
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="428" height="20"><defs><style>text{font-size:11px;font-family:Verdana,DejaVu Sans,Geneva,sans-serif}text.shadow{fill:#010101;fill-opacity:.3}text.high{fill:#fff}</style><linearGradient id="smooth" x2="0" y2="100%"><stop offset="0" stop-color="#aaa" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><mask id="round"><rect width="100%" height="100%" rx="3" fill="#fff"/></mask></defs><g id="bg" mask="url(#round)"><path fill="orange" stroke="#000" d="M0 0h120v20H0zM120 0h109v20H120zM229 0h87v20h-87zM316 0h112v20H316z"/><path fill="url(#smooth)" d="M0 0h428v20H0z"/></g><g id="fg"><text class="shadow" x="5.5" y="15">Statements 99.84%</text><text class="high" x="5" y="14">Statements 99.84%</text><text class="shadow" x="125.5" y="15">Branches 99.49%</text><text class="high" x="125" y="14">Branches 99.49%</text><text class="shadow" x="234.5" y="15">Lines 99.84%</text><text class="high" x="234" y="14">Lines 99.84%</text><text class="shadow" x="321.5" y="15">Functions 99.87%</text><text class="high" x="321" y="14">Functions 99.87%</text></g></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structuredCloning.d.ts","sourceRoot":"","sources":["../../src/formats/structuredCloning.js"],"names":[],"mappings":";;;;;oCAwBa,CAAC,IAAI,EAAE;IACnB,QAAY,EAAE,MAAM,CAAC;IACrB,IAAQ,EAAE,OAAO,aAAa,EAAE,aAAa,CAAC;IAC9C,KAAS,EAAE,OAAO,eAAe,EAAE,oBAAoB,CAAC;IACxD,cAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAiB,CAAC,EAAE,OAAO,sBAAsB,EAAE,WAAW,CAAC;IAC/D,cAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAa,CAAC,EAAE,MAAM,CAAA;CACnB,KAAK,WAAW,GAAC,IAAI;kCAIZ,OAAO,kBAAkB,EAAE,mBAAmB;AA+b3D,6CAA6C;AAC7C,iCADW,OAAO,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"structuredCloning.d.ts","sourceRoot":"","sources":["../../src/formats/structuredCloning.js"],"names":[],"mappings":";;;;;oCAwBa,CAAC,IAAI,EAAE;IACnB,QAAY,EAAE,MAAM,CAAC;IACrB,IAAQ,EAAE,OAAO,aAAa,EAAE,aAAa,CAAC;IAC9C,KAAS,EAAE,OAAO,eAAe,EAAE,oBAAoB,CAAC;IACxD,cAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAiB,CAAC,EAAE,OAAO,sBAAsB,EAAE,WAAW,CAAC;IAC/D,cAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAa,CAAC,EAAE,MAAM,CAAA;CACnB,KAAK,WAAW,GAAC,IAAI;kCAIZ,OAAO,kBAAkB,EAAE,mBAAmB;AA+b3D,6CAA6C;AAC7C,iCADW,OAAO,eAAe,EAAE,MAAM,CAyIvC"}
|
package/dist/index.js
CHANGED
|
@@ -3672,47 +3672,45 @@ const canonicalTypeToAvailableTypeAndSchema = (
|
|
|
3672
3672
|
|
|
3673
3673
|
/** @type {import('../formats.js').Format} */
|
|
3674
3674
|
const structuredCloning = {
|
|
3675
|
-
iterate (records, stateObj) {
|
|
3675
|
+
async iterate (records, stateObj) {
|
|
3676
3676
|
/* istanbul ignore if -- Just a guard */
|
|
3677
3677
|
if (!stateObj.format) {
|
|
3678
3678
|
stateObj.format = 'structuredCloning';
|
|
3679
3679
|
}
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
return Object.hasOwn(typeSpecSet, prop);
|
|
3693
|
-
});
|
|
3694
|
-
}
|
|
3695
|
-
);
|
|
3696
|
-
structuredCloningFixed.splice(
|
|
3697
|
-
// Add after userObjects
|
|
3698
|
-
1,
|
|
3699
|
-
0,
|
|
3700
|
-
W
|
|
3701
|
-
);
|
|
3702
|
-
const typeson = new c({
|
|
3703
|
-
encapsulateObserver: encapsulateObserver(stateObj)
|
|
3704
|
-
}).register(structuredCloningFixed);
|
|
3705
|
-
typeson.encapsulate(records);
|
|
3706
|
-
// Todo (low): We might want to run async encapsulate for
|
|
3707
|
-
// async types (and put this after Promise resolves)
|
|
3708
|
-
if (stateObj.error) {
|
|
3709
|
-
reject(stateObj.error);
|
|
3710
|
-
} else {
|
|
3711
|
-
resolve(/** @type {Required<import('../types.js').StateObject>} */ (
|
|
3712
|
-
stateObj
|
|
3713
|
-
));
|
|
3680
|
+
|
|
3681
|
+
const structuredCloningFixed = ie.filter(
|
|
3682
|
+
(typeSpecSet) => {
|
|
3683
|
+
return ![
|
|
3684
|
+
// Not yet supported within JSOE
|
|
3685
|
+
'imagedata',
|
|
3686
|
+
'imagebitmap',
|
|
3687
|
+
'cryptokey',
|
|
3688
|
+
'domquad'
|
|
3689
|
+
].some((prop) => {
|
|
3690
|
+
return Object.hasOwn(typeSpecSet, prop);
|
|
3691
|
+
});
|
|
3714
3692
|
}
|
|
3693
|
+
);
|
|
3694
|
+
structuredCloningFixed.splice(
|
|
3695
|
+
// Add after userObjects
|
|
3696
|
+
1,
|
|
3697
|
+
0,
|
|
3698
|
+
W
|
|
3699
|
+
);
|
|
3700
|
+
const typeson = new c({
|
|
3701
|
+
encapsulateObserver: encapsulateObserver(stateObj)
|
|
3702
|
+
}).register(structuredCloningFixed);
|
|
3703
|
+
|
|
3704
|
+
await typeson.encapsulateAsync(records, null, {
|
|
3705
|
+
throwOnBadSyncType: false
|
|
3715
3706
|
});
|
|
3707
|
+
|
|
3708
|
+
if (stateObj.error) {
|
|
3709
|
+
throw stateObj.error;
|
|
3710
|
+
}
|
|
3711
|
+
return (/** @type {Required<import('../types.js').StateObject>} */ (
|
|
3712
|
+
stateObj
|
|
3713
|
+
));
|
|
3716
3714
|
},
|
|
3717
3715
|
getTypesAndSchemasForState (types, state) {
|
|
3718
3716
|
if (state && types.getContextInfo('structuredCloning', state)) {
|
|
@@ -21839,3 +21837,4 @@ async function formatAndTypeChoices ({
|
|
|
21839
21837
|
}
|
|
21840
21838
|
|
|
21841
21839
|
export { Formats, Types, formatAndTypeChoices, getFormatAndSchemaChoices, getTypesForSchema, buildTypeChoices as typeChoices };
|
|
21840
|
+
//# sourceMappingURL=index.js.map
|