Data Utilities (obj & arr)
High-performance operations for deep object manipulation and collection management.
Object Utilities (obj)
.deepClone(obj)
Creates a complete, recursive copy of an object. Handles circular references and complex prototypes.
const originalConfig = { api: { timeout: 5000 }, plugins: ["auth"] };
const newConfig = __sys__.utils.obj.deepClone(originalConfig);.parse(json, fallback?)
A safe alternative to JSON.parse. Returns a fallback value instead of throwing on malformed strings.
const prefs = __sys__.utils.obj.parse(raw, { theme: "light" });.pick() / .omit()
Filters object properties based on a whitelist (pick) or blacklist (omit).
const user = { id: 1, email: "j@d.com", password: "HIDDEN" };
const publicProfile = __sys__.utils.obj.omit(user, ["password"]); // { id: 1, email: "j@d.com" }.flattenObject(obj, separator?)
Recursively reduces a nested object into a single-level object with path-based keys.
const flat = __sys__.utils.obj.flattenObject({ user: { profile: { name: "John" } } });
// → { "user.profile.name": "John" }Array Utilities (arr)
.chunk(array, size)
Splits an array into smaller sub-arrays of a defined maximum size. Ideal for batch processing.
const batches = __sys__.utils.arr.chunk([1, 2, 3, 4, 5, 6, 7], 3);
// → [[1, 2, 3], [4, 5, 6], [7]].unique(array)
Removes duplicate elements while preserving the original order of the first occurrence.
const uniqueIds = __sys__.utils.arr.unique(["A", "B", "A", "C"]); // → ["A", "B", "C"].groupBy(array, keyFn)
Buckets elements of an array into an object based on a discriminator function.
const categorized = __sys__.utils.arr.groupBy(products, (p) => p.category);Master asynchronous control flow and validation guards.
