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

Function validateUsagesNotEmpty

lib/internal/crypto/webcrypto_util.js:73–80  ·  view source on GitHub ↗

* Validates that a usage set is not empty. * @param {SafeSet } usagesSet * @returns {SafeSet }

(usagesSet)

Source from the content-addressed store, hash-verified

71 * @returns {SafeSet<string>}
72 */
73function validateUsagesNotEmpty(usagesSet) {
74 if (usagesSet.size === 0) {
75 throw lazyDOMException(
76 'Usages cannot be empty when creating a key.',
77 'SyntaxError');
78 }
79 return usagesSet;
80}
81
82/**
83 * Returns the requested usages that are present in `usagesSet`.

Callers 9

mlDsaGenerateKeyFunction · 0.85
mlKemGenerateKeyFunction · 0.85
c20pGenerateKeyFunction · 0.85
ecGenerateKeyFunction · 0.85
cfrgGenerateKeyFunction · 0.85
hmacGenerateKeyFunction · 0.85
kmacGenerateKeyFunction · 0.85
aesGenerateKeyFunction · 0.85
rsaKeyGenerateFunction · 0.85

Calls 1

lazyDOMExceptionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…