Sha256: d365056cd89e68562878a92640c774e23543c7b1a0b1a0909443263fc9c22987
Contents?: true
Size: 588 Bytes
Versions: 24
Compression:
Stored size: 588 Bytes
Contents
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = toJSON; function toJSON(value, arg, ctx) { if (Array.isArray(value)) return value.map((v, i) => toJSON(v, String(i), ctx)); if (value && typeof value.toJSON === 'function') { const anchor = ctx && ctx.anchors && ctx.anchors.find(a => a.node === value); if (anchor) ctx.onCreate = res => { anchor.res = res; delete ctx.onCreate; }; const res = value.toJSON(arg, ctx); if (anchor && ctx.onCreate) ctx.onCreate(res); return res; } return value; }
Version data entries
24 entries across 24 versions & 2 rubygems