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

Function repeat

src/compute-engine/collection-utils.ts:20–40  ·  view source on GitHub ↗
(
  value: Expression,
  count?: number
)

Source from the content-addressed store, hash-verified

18} from '../common/type/primitive.js';
19import { typeToString } from '../common/type/serialize.js';
20import { Type } from '../common/type/types.js';
21import { CancellationError, checkDeadline } from '../common/interruptible.js';
22import { Expression, CollectionHandlers, Sign } from './global-types.js';
23import type { MathJsonExpression } from '../math-json/types.js';
24import {
25 isFunction,
26 isNumber,
27 isString,
28 isSymbol,
29 sym,
30} from './boxed-expression/type-guards.js';
31
32/** If a collection has fewer than this many elements, eagerly evaluate it.
33 *
34 * For example, evaluate the Union of two sets with 10 elements each will
35 * result in a set with 20 elements.
36 *
37 * If the sum of the sizes of the two sets is greater than
38 * `MAX_SIZE_EAGER_COLLECTION`, the result is a Union expression
39 *
40 */
41export const MAX_SIZE_EAGER_COLLECTION = 100;
42
43export function isFiniteIndexedCollection(col: Expression): boolean {

Callers 1

zipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected