MCPcopy
hub / github.com/webpack/webpack / serialize

Function serialize

lib/json/JsonData.js:63–68  ·  view source on GitHub ↗

* Serializes this instance into the provided serializer context. * @param {JsonData} obj JSONData object * @param {ObjectSerializerContext} context context

(obj, { write })

Source from the content-addressed store, hash-verified

61 * @param {ObjectSerializerContext} context context
62 */
63 serialize(obj, { write }) {
64 if (obj._buffer === undefined && obj._data !== undefined) {
65 obj._buffer = Buffer.from(JSON.stringify(obj._data));
66 }
67 write(obj._buffer);
68 },
69 /**
70 * Restores this instance from the provided deserializer context.
71 * @param {ObjectDeserializerContext} context context

Callers 1

applyMethod · 0.50

Calls 1

writeFunction · 0.85

Tested by

no test coverage detected