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

Function unlessInvalidState

test/parallel/test-crypto-dh-generate-keys.js:14–22  ·  view source on GitHub ↗
(f)

Source from the content-addressed store, hash-verified

12 const size = crypto.getFips() || hasOpenSSL3 ? 1024 : 256;
13
14 function unlessInvalidState(f) {
15 try {
16 return f();
17 } catch (err) {
18 if (err.code !== 'ERR_CRYPTO_INVALID_STATE') {
19 throw err;
20 }
21 }
22 }
23
24 function testGenerateKeysChangesKeys(setup, expected) {
25 const dh = crypto.createDiffieHellman(size);

Callers 1

Calls 1

fFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…