Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(Object.defineProperty: any)(klass, '_classRegistryKey', {
value: name,
writeable: false
});
registry[name] = {
klass,
omit: options.omit || [],
shallow: options.shallow || []
};
}
register('Object', Object);
type SerializedGrid = { buffer: ArrayBuffer };
Grid.serialize = function serialize(grid: Grid, transferables?: Array): SerializedGrid {
const buffer = grid.toArrayBuffer();
if (transferables) {
transferables.push(buffer);
}
return {buffer};
};
Grid.deserialize = function deserialize(serialized: SerializedGrid): Grid {
return new Grid(serialized.buffer);
};
register('Grid', Grid);
register('Color', Color);
register('Error', Error);
register('ResolvedImage', ResolvedImage);