Open tshemsedinov opened 4 months ago
Problem with value.type === 'Buffer'
Than it will also say that it's valid buffer if it's not a buffer, but serialized buffer (or better say under-deserialized)
e.g. this way
https://nodejs.org/api/buffer.html
const copy = JSON.parse(json, (key, value) => {
return value && value.type === 'Buffer' ?
Buffer.from(value) :
value;
});
Array.isArray
,Buffer.isBuffer
v8
sandboxesinstance.constructor.name
, this will work also for isolated contexts in v8https://github.com/diia-open-source/be-pkg-utils/blob/e969374fb769e59ab6bbdb709caeba0199e14a8c/src/typeUtils.ts#L1-L13