/
drndsv
/
react
Обзор
Документация
Войти
/
drndsv
/
react
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/@ungap/structured-clone/esm/json.js
21 строка
690 B
drndsv
Initial commit
14 апр 2025, 22:53
14 апр 2025, 22:53
641ac8a
Код
Авторство
О чём код?
/*! (c) Andrea Giammarchi - ISC */ import {deserialize} from './deserialize.js'; import {serialize} from './serialize.js'; const {parse: $parse, stringify: $stringify} = JSON; const options = {json: true, lossy: true}; /** * Revive a previously stringified structured clone. * @param {string} str previously stringified data as string. * @returns {any} whatever was previously stringified as clone. */ export const parse = str => deserialize($parse(str)); /** * Represent a structured clone value as string. * @param {any} any some clone-able value to stringify. * @returns {string} the value stringified. */ export const stringify = any => $stringify(serialize(any, options));