MCPcopy Create free account
hub / github.com/nodejs/node / cloneAlgorithm

Function cloneAlgorithm

lib/internal/crypto/keys.js:1017–1028  ·  view source on GitHub ↗
(raw)

Source from the content-addressed store, hash-verified

1015const kSlotUsages = 7;
1016
1017function cloneAlgorithm(raw) {
1018 const cloned = { ...raw };
1019 if (ObjectPrototypeHasOwnProperty(cloned, 'hash') &&
1020 cloned.hash !== undefined) {
1021 cloned.hash = { ...cloned.hash };
1022 }
1023 if (ObjectPrototypeHasOwnProperty(cloned, 'publicExponent') &&
1024 cloned.publicExponent !== undefined) {
1025 cloned.publicExponent = new Uint8Array(cloned.publicExponent);
1026 }
1027 return cloned;
1028}
1029
1030function cloneInternalAlgorithm(raw) {
1031 const cloned = { __proto__: null, ...raw };

Callers 2

[kInspect]Method · 0.85
algorithmMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected