MCPcopy Index your code
hub / github.com/nodejs/node / objectToString

Function objectToString

test/fixtures/wpt/WebCryptoAPI/util/helpers.js:72–87  ·  view source on GitHub ↗
(obj)

Source from the content-addressed store, hash-verified

70// Create a string representation of keyGeneration parameters for
71// test names and labels.
72function objectToString(obj) {
73 var keyValuePairs = [];
74
75 if (Array.isArray(obj)) {
76 return "[" + obj.map(function(elem){return objectToString(elem);}).join(", ") + "]";
77 } else if (typeof obj === "object") {
78 Object.keys(obj).sort().forEach(function(keyName) {
79 keyValuePairs.push(keyName + ": " + objectToString(obj[keyName]));
80 });
81 return "{" + keyValuePairs.join(", ") + "}";
82 } else if (typeof obj === "undefined") {
83 return "undefined";
84 } else {
85 return obj.toString();
86 }
87}
88
89// Is key a CryptoKey object with correct algorithm, extractable, and usages?
90// Is it a secret, private, or public kind of key?

Callers 12

parameterStringFunction · 0.85
parameterStringFunction · 0.85
equalJwkFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85
parameterStringFunction · 0.85

Calls 7

sortMethod · 0.80
mapMethod · 0.65
forEachMethod · 0.65
keysMethod · 0.65
joinMethod · 0.45
pushMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected