Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>(command: T): T {
const normalizedOperation = normalizeUpdateOperation(command.operation);
const version = {
id: timeStampWithRandomString(),
op: JSON.stringify(command.operation)
};
const $push = Object.assign({}, normalizedOperation.$push, {
"_PhenylMeta.versions": { $each: [version], $slice: -100 }
});
const newOperation = Object.assign({}, normalizedOperation, { $push });
return Object.assign({}, command, { operation: newOperation });
}