UNPKG

@speckle/objectloader2

Version:

This is an updated objectloader for the Speckle viewer written in typescript

33 lines 923 B
export function isBase(maybeBase) { return (maybeBase !== null && typeof maybeBase === 'object' && 'id' in maybeBase && typeof maybeBase.id === 'string'); } export function isReference(maybeRef) { return (maybeRef !== null && typeof maybeRef === 'object' && 'referencedId' in maybeRef && typeof maybeRef.referencedId === 'string'); } export function isScalar(value) { const type = typeof value; return (value === null || type === 'string' || type === 'number' || type === 'boolean' || type === 'bigint' || type === 'symbol' || type === 'undefined'); } export function take(it, count) { const result = []; for (let i = 0; i < count; i++) { const itr = it.next(); if (itr.done) break; result.push(itr.value); } return result; } //# sourceMappingURL=types.js.map