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

Function allNameVariants

test/fixtures/wpt/WebCryptoAPI/util/helpers.js:270–279  ·  view source on GitHub ↗
(name, slowTest)

Source from the content-addressed store, hash-verified

268// Algorithm name specifiers are case-insensitive. Generate several
269// case variations of a given name.
270function allNameVariants(name, slowTest) {
271 var upCaseName = name.toUpperCase();
272 var lowCaseName = name.toLowerCase();
273 var mixedCaseName = upCaseName.substring(0, 1) + lowCaseName.substring(1);
274
275 // for slow tests effectively cut the amount of work in third by only
276 // returning one variation
277 if (slowTest) return [mixedCaseName];
278 return unique([upCaseName, lowCaseName, mixedCaseName]);
279}
280
281// Builds a hex string representation for an array-like input.
282// "bytes" can be an Array of bytes, an ArrayBuffer, or any TypedArray.

Callers 1

run_testFunction · 0.85

Calls 1

uniqueFunction · 0.70

Tested by

no test coverage detected