Refactor package.json and pnpm-lock.yaml to add rfdc dependency
This commit is contained in:
@@ -72,6 +72,7 @@
|
|||||||
"png-chunk-text": "^1.0.0",
|
"png-chunk-text": "^1.0.0",
|
||||||
"png-chunks-encode": "^1.0.0",
|
"png-chunks-encode": "^1.0.0",
|
||||||
"png-chunks-extract": "^1.0.0",
|
"png-chunks-extract": "^1.0.0",
|
||||||
|
"rfdc": "^1.4.1",
|
||||||
"rollup": "^3.29.4",
|
"rollup": "^3.29.4",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
"sortablejs": "^1.15.2",
|
"sortablejs": "^1.15.2",
|
||||||
|
|||||||
8
pnpm-lock.yaml
generated
8
pnpm-lock.yaml
generated
@@ -173,6 +173,9 @@ importers:
|
|||||||
png-chunks-extract:
|
png-chunks-extract:
|
||||||
specifier: ^1.0.0
|
specifier: ^1.0.0
|
||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
|
rfdc:
|
||||||
|
specifier: ^1.4.1
|
||||||
|
version: 1.4.1
|
||||||
rollup:
|
rollup:
|
||||||
specifier: ^3.29.4
|
specifier: ^3.29.4
|
||||||
version: 3.29.4
|
version: 3.29.4
|
||||||
@@ -3083,6 +3086,9 @@ packages:
|
|||||||
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
|
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
|
||||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||||
|
|
||||||
|
rfdc@1.4.1:
|
||||||
|
resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==}
|
||||||
|
|
||||||
rimraf@3.0.2:
|
rimraf@3.0.2:
|
||||||
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
|
resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -6710,6 +6716,8 @@ snapshots:
|
|||||||
|
|
||||||
reusify@1.0.4: {}
|
reusify@1.0.4: {}
|
||||||
|
|
||||||
|
rfdc@1.4.1: {}
|
||||||
|
|
||||||
rimraf@3.0.2:
|
rimraf@3.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
glob: 7.2.3
|
glob: 7.2.3
|
||||||
|
|||||||
@@ -2,16 +2,20 @@ import { ReadableStream, WritableStream, TransformStream } from "web-streams-pol
|
|||||||
import { Buffer as BufferPolyfill } from 'buffer'
|
import { Buffer as BufferPolyfill } from 'buffer'
|
||||||
import { polyfill as dragPolyfill} from "mobile-drag-drop"
|
import { polyfill as dragPolyfill} from "mobile-drag-drop"
|
||||||
import {scrollBehaviourDragImageTranslateOverride} from 'mobile-drag-drop/scroll-behaviour'
|
import {scrollBehaviourDragImageTranslateOverride} from 'mobile-drag-drop/scroll-behaviour'
|
||||||
|
import rfdc from 'rfdc'
|
||||||
/**
|
/**
|
||||||
* Safe variant of structuredClone for svelte 5 states
|
* Safe variant of structuredClone for svelte 5 states
|
||||||
* if structuredClone is not available, it will use JSON.parse(JSON.stringify(data)) instead
|
* if structuredClone is not available, it will use JSON.parse(JSON.stringify(data)) instead
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const rfdcClone = rfdc({
|
||||||
|
circles:false,
|
||||||
|
})
|
||||||
function safeStructuredClone<T>(data:T):T{
|
function safeStructuredClone<T>(data:T):T{
|
||||||
try {
|
try {
|
||||||
return structuredClone(data)
|
return structuredClone(data)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return JSON.parse(JSON.stringify(data))
|
return rfdcClone(data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user