MCPcopy Index your code
hub / github.com/simstudioai/sim / unwrapPrimitive

Function unwrapPrimitive

apps/sim/lib/execution/isolated-vm-worker.cjs:681–693  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

679 // `.copySync()` to get the real value. Numbers/strings/booleans are
680 // supported; anything exotic falls back to `undefined`.
681 const unwrapPrimitive = (v) => {
682 if (v === null || v === undefined) return v
683 const t = typeof v
684 if (t === 'number' || t === 'string' || t === 'boolean') return v
685 if (v && typeof v.copySync === 'function') {
686 try {
687 return v.copySync()
688 } catch {
689 return undefined
690 }
691 }
692 return v
693 }
694
695 const setTimeoutRef = new ivm.Reference((fnRef, msRef) => {
696 const id = nextTimerId++

Callers 1

executeTaskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected