MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / MaybeUnwrapOr

Function MaybeUnwrapOr

test/common/test_helper.h:41–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 */
40template <typename T>
41inline T MaybeUnwrapOr(MaybeOrValue<T> maybe, const T& default_value) {
42#if defined(NODE_ADDON_API_ENABLE_MAYBE)
43 return maybe.UnwrapOr(default_value);
44#else
45 USE(default_value);
46 return maybe;
47#endif
48}
49
50/**
51 * A test helper that converts MaybeOrValue<T> to T by getting the value that

Callers 15

RunJsStringFunction · 0.85
CallWithInvalidReceiverFunction · 0.85
CallFunction · 0.85
ConstructFunction · 0.85

Calls 2

USEFunction · 0.85
UnwrapOrMethod · 0.80

Tested by

no test coverage detected