MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / safe

Function safe

test/compute-engine/nightly/comparison-matrix.test.ts:113–120  ·  view source on GitHub ↗
(f: () => any)

Source from the content-addressed store, hash-verified

111
112describeNightly('NIGHTLY comparison — isSame/is/isEqual are symmetric', () => {
113 const safe = (f: () => any): string => {
114 try {
115 const v = f();
116 return v === undefined ? 'undef' : String(v);
117 } catch (e: any) {
118 return 'THROW:' + String(e?.message).slice(0, 40);
119 }
120 };
121 for (const m of ['isSame', 'is', 'isEqual'] as const) {
122 it(`${m}(a,b) === ${m}(b,a)`, () => {
123 const asym: string[] = [];

Callers 1

Calls 2

sliceMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected