Utilities Module

Primitive Utilities (id & fn)

Foundational primitives for identity management and functional programming utility patterns.

Identity Utilities (id)

.uuid()

Generates a standard RFC 4122 Compliant Version 4 UUID. This is the recommended primary key strategy for distributed systems within the XyPriss framework.

typescript
const entityId = __sys__.utils.id.uuid();
// → "f47ac10b-58cc-4372-a567-0e02b2c3d479"

Functional Utilities (fn)

.memo(fn)

Wraps a function with a cache that stores results based on input arguments. Subsequent calls with the same arguments will return the cached result instantly.

typescript
const heavyCalc = __sys__.utils.fn.memo((n: number) => {
    // ... expensive iterative operations ...
    return result;
});

const val1 = heavyCalc(42); // Executes
const val2 = heavyCalc(42); // Returns from cache immediately
Dynamic Variables

Learn about standardized key-value stores for application configuration.