MCPcopy Create free account
hub / github.com/R-js/libRmath.js / isScalar

Function isScalar

scripts/nodeWalker.ts:9–12  ·  view source on GitHub ↗
(u: any)

Source from the content-addressed store, hash-verified

7type GeneralValue = ScalarValue | ScalarValueArray | JSObject | JSObject[];
8
9function isScalar(u: any): u is ScalarValue {
10 const tt = typeof u;
11 return ['bigint', 'string', 'number', 'boolean', 'undefined'].includes(tt) || u === null;
12}
13
14function isArray(u: any): u is (ScalarValueArray | JSObject[]) {
15 return u !== null && u !== undefined && Array.isArray(u) && u.length > 0;

Callers 1

recursiveDescendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected