extra-object
Version:
A collection of methods for working with Objects.
788 lines (781 loc) ⢠29.3 kB
TypeScript
/**
* Entries is a list of key-value pairs, with unique keys (indices).
* [š](https://github.com/nodef/extra-object/wiki/Entries)
*/
type Entries = Iterable<[string, any]>;
/**
* Lists is a pair of key list and value list, with unique keys (indices).
* [š](https://github.com/nodef/extra-object/wiki/Lists)
*/
type Lists = [Iterable<string>, Iterable<any>];
/**
* Handle reading of a single value.
* [š](https://github.com/nodef/extra-object/wiki/ReadFunction)
* @returns value
*/
type ReadFunction<T> = () => T;
/**
* Handle combining of two values.
* [š](https://github.com/nodef/extra-object/wiki/CombineFunction)
* @param a a value
* @param b another value
* @returns combined value
*/
type CombineFunction = (a: any, b: any) => any;
/**
* Handle comparison of two values.
* [š](https://github.com/nodef/extra-object/wiki/CompareFunction)
* @param a a value
* @param b another value
* @returns a<b: -ve, a=b: 0, a>b: +ve
*/
type CompareFunction = (a: any, b: any) => number;
/**
* Handle processing of values in an object.
* [š](https://github.com/nodef/extra-object/wiki/ProcessFunction)
* @param v value in object
* @param k key of value in object
* @param x object containing the value
*/
type ProcessFunction = (v: any, k: string, x: object) => void;
/**
* Handle selection of entries in an object.
* [š](https://github.com/nodef/extra-object/wiki/TestFunction)
* @param v value in object
* @param k key of value in object
* @param x object containing the value
* @returns selected?
*/
type TestFunction = (v: any, k: string, x: object) => boolean;
/**
* Handle transformation of a value to another.
* [š](https://github.com/nodef/extra-object/wiki/MapFunction)
* @param v value in object
* @param k key of value in object
* @param x object containing the value
* @returns transformed value
*/
type MapFunction = (v: any, k: string, x: object) => any;
/**
* Handle reduction of multiple values into a single value.
* [š](https://github.com/nodef/extra-object/wiki/ReduceFunction)
* @param acc accumulator (temporary result)
* @param v value in object
* @param k key of value in object
* @param x object containing the value
* @returns reduced value
*/
type ReduceFunction = (acc: any, v: any, k: string, x: object) => any;
/**
* Handle ending of a combined object.
* [š](https://github.com/nodef/extra-object/wiki/EndFunction)
* @param dones iįµŹ° object done?
* @returns combined object done?
*/
type EndFunction = (dones: boolean[]) => boolean;
/**
* Check if value is an object.
* [š](https://github.com/nodef/extra-object/wiki/is)
* @param v a value
* @returns v is an object?
*/
declare function is(v: any): v is object;
/**
* List all keys.
* [š](https://github.com/nodef/extra-object/wiki/keys)
* @param x an object
* @returns kā, kā, ... | [kįµ¢, vįµ¢] ā x
*/
declare function keys(x: object): Iterable<string>;
/**
* List all values.
* [š](https://github.com/nodef/extra-object/wiki/values)
* @param x an object
* @returns vā, vā, ... | [kįµ¢, vįµ¢] ā x
*/
declare function values(x: object): Iterable<any>;
/**
* List all key-value pairs.
* [š](https://github.com/nodef/extra-object/wiki/entries)
* @param x an object
* @returns [kā, vā], [kā, vā], ... | [kįµ¢, vįµ¢] ā x
*/
declare function entries(x: object): Entries;
/**
* Convert entries to object.
* [š](https://github.com/nodef/extra-object/wiki/fromEntries)
* @param x entries
* @returns x as object
*/
declare function fromEntries(x: Entries): object;
/**
* Convert lists to object.
* [š](https://github.com/nodef/extra-object/wiki/fromLists)
* @param x lists, i.e. [keys, values]
* @returns x as object
*/
declare function fromLists(x: Lists): object;
/**
* Compare two objects.
* [š](https://github.com/nodef/extra-object/wiki/compare)
* @param x an object
* @param y another object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns x=y: 0, otherwise: -ve/+ve
*/
declare function compare(x: object, y: object, fc?: CompareFunction | null, fm?: MapFunction | null): number;
/**
* Check if two objects are equal.
* [š](https://github.com/nodef/extra-object/wiki/isEqual)
* @param x an object
* @param y another object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns fm(x[kįµ¢]) ā fm(y[kįµ¢]) ā kįµ¢ ā x, y
*/
declare function isEqual(x: object, y: object, fc?: CompareFunction | null, fm?: MapFunction | null): boolean;
/**
* Get the number of keys in an object.
* [š](https://github.com/nodef/extra-object/wiki/size)
* @param x an object
* @returns |x|
*/
declare function size(x: object): number;
/**
* Check if an object is empty.
* [š](https://github.com/nodef/extra-object/wiki/isEmpty)
* @param x an object
* @returns |x| = 0?
*/
declare function isEmpty(x: object): boolean;
/**
* Get value at specified key.
* [š](https://github.com/nodef/extra-object/wiki/get)
* @param x an object
* @param k key
* @returns x[k]
*/
declare function get(x: object, k: string): any;
/**
* Get values at keys.
* [š](https://github.com/nodef/extra-object/wiki/getAll)
* @param x an object
* @param ks keys
* @returns [x[k], x[l], ...] | [k, l, ...] = ks
*/
declare function getAll(x: object, ks: string[]): any[];
/**
* Get value at path in a nested object.
* [š](https://github.com/nodef/extra-object/wiki/getPath)
* @param x a nested object
* @param p path
* @returns x[kā][kā][...] | [kā, kā, ...] = p
*/
declare function getPath(x: object, p: string[]): any;
/**
* Check if nested object has a path.
* [š](https://github.com/nodef/extra-object/wiki/hasPath)
* @param x a nested object
* @param p path
* @returns x[kā][kā][...] exists? | [kā, kā, ...] = p
*/
declare function hasPath(x: object, p: string[]): boolean;
/**
* Set value at specified key.
* [š](https://github.com/nodef/extra-object/wiki/set)
* @param x an object
* @param k key
* @param v value
* @returns x' | x' = x; x'[k] = v
*/
declare function set(x: object, k: string, v: any): object;
/**
* Set value at specified key.
* [š](https://github.com/nodef/extra-object/wiki/set$)
* @param x an object (updated)
* @param k key
* @param v value
* @returns x | x[k] = v
*/
declare function set$(x: object, k: string, v: any): object;
/**
* Set value at path in a nested object.
* [š](https://github.com/nodef/extra-object/wiki/setPath$)
* @param x a nested object (updated)
* @param p path
* @param v value
* @returns x | x[kā][kā][...] = v; [kā, kā, ...] = p
*/
declare function setPath$(x: object, p: string[], v: any): any;
/**
* Exchange two values in an object.
* [š](https://github.com/nodef/extra-object/wiki/swap)
* @param x an object
* @param k a key
* @param l another key
* @returns x' | x' = x; x'[k] = x[l]; x'[l] = x[k]
*/
declare function swap(x: object, k: string, l: string): object;
/**
* Exchange two values in an object.
* [š](https://github.com/nodef/extra-object/wiki/swap$)
* @param x an object (updated)
* @param k a key
* @param l another key
* @returns x | x[i] ā x[j]
*/
declare function swap$(x: object, k: string, l: string): object;
/**
* Remove an entry from object.
* [š](https://github.com/nodef/extra-object/wiki/remove)
* @param x an object
* @param k key
* @returns x \\: [k]
*/
declare function remove(x: object, k: string): object;
/**
* Remove an entry from object.
* [š](https://github.com/nodef/extra-object/wiki/remove$)
* @param x an object (updated)
* @param k key
* @returns x = x \\: [k]
*/
declare function remove$(x: object, k: string): object;
/**
* Remove value at path in a nested object.
* [š](https://github.com/nodef/extra-object/wiki/removePath$)
* @param x a nested object (updated)
* @param p path
* @returns x = x \\: [kā][kā][...] | [kā, kā, ...] = p
*/
declare function removePath$(x: object, p: string[]): any;
/**
* Count values which satisfy a test.
* [š](https://github.com/nodef/extra-object/wiki/count)
* @param x an object
* @param ft test function (v, k, x)
* @returns Ī£tįµ¢ | tįµ¢ = 1 if ft(vįµ¢) else 0; [kįµ¢, vįµ¢] ā x
*/
declare function count(x: object, ft: TestFunction): number;
/**
* Count occurrences of values.
* [š](https://github.com/nodef/extra-object/wiki/countAs)
* @param x an object
* @param fm map function (v, k, x)
* @returns Map \{value ā count\}
*/
declare function countAs(x: object, fm?: MapFunction | null): Map<any, number>;
/**
* Find smallest value.
* [š](https://github.com/nodef/extra-object/wiki/min)
* @param x an object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns v | v ⤠vįµ¢; [kįµ¢, vįµ¢] ā x
*/
declare function min(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): any;
/**
* Find smallest entry.
* [š](https://github.com/nodef/extra-object/wiki/minEntry)
* @param x an object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [min_key, min_value]
*/
declare function minEntry(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): [string, any];
/**
* Find largest value.
* [š](https://github.com/nodef/extra-object/wiki/max)
* @param x an object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns v | v ā„ vįµ¢; [kįµ¢, vįµ¢] ā x
*/
declare function max(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): any;
/**
* Find largest entry.
* [š](https://github.com/nodef/extra-object/wiki/maxEntry)
* @param x an object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [max_key, max_value]
*/
declare function maxEntry(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): [string, any];
/**
* Find smallest and largest values.
* [š](https://github.com/nodef/extra-object/wiki/range)
* @param x a map
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [min_value, max_value]
*/
declare function range(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): [any, any];
/**
* Find smallest and largest entries.
* [š](https://github.com/nodef/extra-object/wiki/rangeEntries)
* @param x an object
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [min_entry, max_entry]
*/
declare function rangeEntries(x: object, fc?: CompareFunction | null, fm?: MapFunction | null): [[string, any], [string, any]];
/**
* Gets first entry from object (default order).
* [š](https://github.com/nodef/extra-object/wiki/head)
* @param x an object
* @param ed default entry
* @returns [kā, vā] if x ā Φ else ed | [kā, vā] ā x
*/
declare function head(x: object, ed?: [string, any]): [string, any];
/**
* Get object without its first entry (default order).
* [š](https://github.com/nodef/extra-object/wiki/tail)
* @param x an object
* @returns x \\ \{[kā, vā]\} if x ā Φ else x | [kā, vā] ā x
*/
declare function tail(x: object): object;
/**
* Keep first n entries only (default order).
* [š](https://github.com/nodef/extra-object/wiki/take)
* @param x an object
* @param n number of entries [1]
* @returns \{[kā, vā], [kā, vā], ...\} | [kįµ¢, vįµ¢] ā x and |\{[kā, vā], [kā, vā], ...\}| ⤠n
*/
declare function take(x: object, n?: number): object;
/**
* Keep first n entries only (default order).
* [š](https://github.com/nodef/extra-object/wiki/take$)
* @param x an object (updated)
* @param n number of entries [1]
* @returns x = \{[kā, vā], [kā, vā], ...\} | [kįµ¢, vįµ¢] ā x and |\{[kā, vā], [kā, vā], ...\}| ⤠n
*/
declare function take$(x: object, n?: number): object;
/**
* Remove first n entries (default order).
* [š](https://github.com/nodef/extra-object/wiki/drop)
* @param x an object
* @param n number of entries [1]
* @returns \{[kā, vā], [kāāā, vāāā], ...\} | [kįµ¢, vįµ¢] ā x and |\{[kā, vā], [kāāā, vāāā], ...\}| ⤠max(|x| - n, 0)
*/
declare function drop(x: object, n?: number): object;
/**
* Remove first n entries (default order).
* [š](https://github.com/nodef/extra-object/wiki/drop$)
* @param x an object (updated)
* @param n number of entries [1]
* @returns x = \{[kā, vā], [kāāā, vāāā], ...\} | [kįµ¢, vįµ¢] ā x and |\{[kā, vā], [kāāā, vāāā], ...\}| ⤠max(|x| - n, 0)
*/
declare function drop$(x: object, n?: number): object;
/**
* List all possible subsets.
* [š](https://github.com/nodef/extra-object/wiki/subsets)
* @param x an object
* @param n number of entries [-1 ā any]
* @returns entries selected by bit from 0..2^|x| if n<0; only of length n otherwise
*/
declare function subsets(x: object, n?: number): IterableIterator<object>;
/**
* Pick an arbitrary key.
* [š](https://github.com/nodef/extra-object/wiki/randomKey)
* @param x an object
* @param fr random number generator ([0, 1))
* @returns kįµ¢ | [kįµ¢, vįµ¢] ā x
*/
declare function randomKey(x: object, fr?: ReadFunction<number> | null): string;
/**
* Pick an arbitrary entry.
* [š](https://github.com/nodef/extra-object/wiki/randomEntry)
* @param x an object
* @param fr random number generator ([0, 1))
* @returns [kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x
*/
declare function randomEntry(x: object, fr?: ReadFunction<number> | null): [string, any];
/**
* Pick an arbitrary subset.
* [š](https://github.com/nodef/extra-object/wiki/randomSubset)
* @param x an object
* @param n number of entries [-1 ā any]
* @param fr random number generator ([0, 1))
* @returns \{[kįµ¢, vįµ¢], [kā±¼, vā±¼], ...\} | [kįµ¢, vįµ¢], [kā±¼, vā±¼], ... ā x; |\{[kįµ¢, vįµ¢], [kā±¼, vā±¼], ...\}| = |x| if n<0 else n
*/
declare function randomSubset(x: object, n?: number, fr?: ReadFunction<number> | null): object;
/**
* Check if object has a key.
* [š](https://github.com/nodef/extra-object/wiki/has)
* @param x an object
* @param k search key
* @returns [k, *] ā x?
*/
declare function has(x: object, k: string): boolean;
/**
* Check if object has a value.
* [š](https://github.com/nodef/extra-object/wiki/hasValue)
* @param x an object
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [*, v] ā x?
*/
declare function hasValue(x: object, v: any, fc?: CompareFunction | null, fm?: MapFunction | null): boolean;
/**
* Check if object has an entry.
* [š](https://github.com/nodef/extra-object/wiki/hasEntry)
* @param x an object
* @param e search entry ([k, v])
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [k, v] ā x? | [k, v] = e
*/
declare function hasEntry(x: object, e: [string, any], fc?: CompareFunction | null, fm?: MapFunction | null): boolean;
/**
* Check if object has a subset.
* [š](https://github.com/nodef/extra-object/wiki/hasSubset)
* @param x an object
* @param y search subset
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns y ā x?
*/
declare function hasSubset(x: object, y: object, fc?: CompareFunction | null, fm?: MapFunction | null): boolean;
/**
* Find value of an entry passing a test.
* [š](https://github.com/nodef/extra-object/wiki/find)
* @param x an object
* @param ft test function (v, k, x)
* @returns v | ft(v) = true; [k, v] ā x
*/
declare function find(x: object, ft: TestFunction): any;
/**
* Find values of entries passing a test.
* [š](https://github.com/nodef/extra-object/wiki/findAll)
* @param x an object
* @param ft test function (v, k, x)
* @returns [vā, vā, ...] | ft(vįµ¢) = true; [kįµ¢, vįµ¢] ā x
*/
declare function findAll(x: object, ft: TestFunction): any[];
/**
* Find key of an entry passing a test.
* [š](https://github.com/nodef/extra-object/wiki/search)
* @param x an object
* @param ft test function (v, k, x)
* @returns k | ft(x[k]) passes
*/
declare function search(x: object, ft: TestFunction): string;
/**
* Find all keys of entries passing a test.
* [š](https://github.com/nodef/extra-object/wiki/searchAll)
* @param x an object
* @param ft test function (v, k, x)
* @returns [kā, kā, ...] | ft(x[kįµ¢]) passes
*/
declare function searchAll(x: object, ft: TestFunction): string[];
/**
* Find key with a given value.
* [š](https://github.com/nodef/extra-object/wiki/searchValue)
* @param x an object
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns k | fm(x[k]) ā fm(v)
*/
declare function searchValue(x: object, v: any, fc?: CompareFunction | null, fm?: MapFunction | null): string;
/**
* Find keys with a given value.
* [š](https://github.com/nodef/extra-object/wiki/searchValueAll)
* @param x an object
* @param v search value
* @param fc compare function (a, b)
* @param fm map function (v, k, x)
* @returns [kā, kā, ...] | fm(x[kįµ¢]) ā fm(v)
*/
declare function searchValueAll(x: object, v: any, fc?: CompareFunction | null, fm?: MapFunction | null): string[];
/**
* Call a function for each entry.
* [š](https://github.com/nodef/extra-object/wiki/forEach)
* @param x an object
* @param fp called function (v, k, x)
*/
declare function forEach(x: object, fp: ProcessFunction): void;
/**
* Check if any value satisfies a test.
* [š](https://github.com/nodef/extra-object/wiki/some)
* @param x an object
* @param ft test function (v, k, x)
* @returns true if ft(vįµ¢) = true for some [kįµ¢, vįµ¢] ā x
*/
declare function some(x: object, ft?: TestFunction | null): boolean;
/**
* Check if all values satisfy a test.
* [š](https://github.com/nodef/extra-object/wiki/every)
* @param x an object
* @param ft test function (v, k, x)
* @returns true if ft(vįµ¢) = true for all [kįµ¢, vįµ¢] ā x
*/
declare function every(x: object, ft: TestFunction): boolean;
/**
* Transform values of an object.
* [š](https://github.com/nodef/extra-object/wiki/map)
* @param x an object
* @param fm map function (v, k, x)
* @returns \{[kā, fm(vā)], [kā, fm(vā)], ...\} | [kįµ¢, vįµ¢] ā x
*/
declare function map(x: object, fm: MapFunction): object;
/**
* Transform values of an object.
* [š](https://github.com/nodef/extra-object/wiki/map$)
* @param x an object (updated)
* @param fm map function (v, k, x)
* @returns x = \{[kā, fm(vā)], [kā, fm(vā)], ...\} | [kįµ¢, vįµ¢] ā x
*/
declare function map$(x: object, fm: MapFunction): object;
/**
* Reduce values to a single value.
* [š](https://github.com/nodef/extra-object/wiki/reduce)
* @param x an object
* @param fr reduce function (acc, v, k, x)
* @param acc initial value
* @returns fr(fr(acc, vā), vā)... | fr(acc, vā) = vā if acc not given
*/
declare function reduce(x: object, fr: ReduceFunction, acc?: any): any;
/**
* Keep entries which pass a test.
* [š](https://github.com/nodef/extra-object/wiki/filter)
* @param x an object
* @param ft test function (v, k, x)
* @returns \{[kā, vā], [kā, vā], ...\} | ft(vįµ¢) = true; [kįµ¢, vįµ¢] ā x
*/
declare function filter(x: object, ft: TestFunction): object;
/**
* Keep entries which pass a test.
* [š](https://github.com/nodef/extra-object/wiki/filter$)
* @param x an object (updated)
* @param ft test function (v, k, x)
* @returns x = \{[kā, vā], [kā, vā], ...\} | ft(vįµ¢) = true; [kįµ¢, vįµ¢] ā x
*/
declare function filter$(x: object, ft: TestFunction): object;
/**
* Get object with given keys.
* [š](https://github.com/nodef/extra-object/wiki/filterAt)
* @param x an object
* @param ks keys
* @returns \{[kā, vā], [kā, vā], ...\} | kįµ¢ ā ks; [kįµ¢, vįµ¢] ā x
*/
declare function filterAt(x: object, ks: string[]): object;
/**
* Get object with given keys.
* [š](https://github.com/nodef/extra-object/wiki/filterAt$)
* @param x an object (updated)
* @param ks keys
* @returns x = \{[kā, vā], [kā, vā], ...\} | kįµ¢ ā ks; [kįµ¢, vįµ¢] ā x
*/
declare function filterAt$(x: object, ks: string[]): object;
/**
* Discard entries which pass a test.
* [š](https://github.com/nodef/extra-object/wiki/reject)
* @param x an object
* @param ft test function (v, k, x)
* @returns \{[kā, vā], [kā, vā], ...\} | ft(vįµ¢) = false; [kįµ¢, vįµ¢] ā x
*/
declare function reject(x: object, ft: TestFunction): object;
/**
* Discard entries which pass a test.
* [š](https://github.com/nodef/extra-object/wiki/reject$)
* @param x an object (updated)
* @param ft test function (v, k, x)
* @returns x = \{[kā, vā], [kā, vā], ...\} | ft(vįµ¢) = false; [kįµ¢, vįµ¢] ā x
*/
declare function reject$(x: object, ft: TestFunction): object;
/**
* Get object without given keys.
* [š](https://github.com/nodef/extra-object/wiki/rejectAt)
* @param x an object
* @param ks keys
* @returns \{[kā, vā], [kā, vā], ...\} | kįµ¢ ā ks; [kįµ¢, vįµ¢] ā x
*/
declare function rejectAt(x: object, ks: string[]): object;
/**
* Get object without given keys.
* [š](https://github.com/nodef/extra-object/wiki/rejectAt$)
* @param x an object (updated)
* @param ks keys
* @returns x = \{[kā, vā], [kā, vā], ...\} | kįµ¢ ā ks; [kįµ¢, vįµ¢] ā x
*/
declare function rejectAt$(x: object, ks: string[]): object;
/**
* Flatten nested object to given depth.
* [š](https://github.com/nodef/extra-object/wiki/flat)
* @param x a nested object
* @param n maximum depth [-1 ā all]
* @param fm map function (v, k, x)
* @param ft test function for flatten (v, k, x)
* @returns flat map
*/
declare function flat(x: object, n?: number, fm?: MapFunction | null, ft?: TestFunction | null): object;
/**
* Flatten nested object, using map function.
* [š](https://github.com/nodef/extra-object/wiki/flatMap)
* @param x a nested object
* @param fm map function (v, k, x)
* @param ft test function (v, k, x)
* @returns flat map
*/
declare function flatMap(x: object, fm?: MapFunction | null, ft?: TestFunction | null): object;
/**
* Combine matching entries from objects.
* [š](https://github.com/nodef/extra-object/wiki/zip)
* @param xs objects
* @param fm map function (vs, k)
* @param fe end function (dones) [array.some]
* @param vd default value
* @returns \{"kā": fm([xā[kā], xā[kā], ...]), "kā": fm([xā[kā], xā[kā], ...]), ...\}
*/
declare function zip(xs: object[], fm?: MapFunction | null, fe?: EndFunction | null, vd?: any): object;
/**
* Segregate entries by test result.
* [š](https://github.com/nodef/extra-object/wiki/partition)
* @param x an object
* @param ft test function (v, k, x)
* @returns [satisfies, doesnt]
*/
declare function partition(x: object, ft: TestFunction): [object, object];
/**
* Segregate entries by similarity.
* [š](https://github.com/nodef/extra-object/wiki/partitionAs)
* @param x an object
* @param fm map function (v, k, x)
* @returns Map \{key ā values\}
*/
declare function partitionAs(x: object, fm: MapFunction): Map<any, object>;
/**
* Break object into chunks of given size.
* [š](https://github.com/nodef/extra-object/wiki/chunk)
* @param x an object
* @param n chunk size [1]
* @param s chunk step [n]
* @returns [x[0..n], x[s..s+n], x[2s..2s+n], ...]
*/
declare function chunk(x: object, n?: number, s?: number): object[];
/**
* Combine entries from objects, preferring last.
* [š](https://github.com/nodef/extra-object/wiki/concat)
* @param xs objects
* @returns xā āŖ xā āŖ ... | [xā, xā, ...] = xs
*/
declare function concat(...xs: object[]): object;
/**
* Combines entries from objects, preferring last.
* [š](https://github.com/nodef/extra-object/wiki/concat$)
* @param x an object (updated)
* @param ys other objects
* @returns x = x āŖ yā āŖ yā āŖ ... | [yā, yā, ...] = ys
*/
declare function concat$(x: object, ...ys: object[]): object;
/**
* Join entries together into a string.
* [š](https://github.com/nodef/extra-object/wiki/join)
* @param x an object
* @param sep separator [,]
* @param asc associator [=]
* @returns "kā=vā,kā=vā,..." | [kįµ¢, vįµ¢] ā x
*/
declare function join(x: object, sep?: string, asc?: string): string;
/**
* Check if objects have no common keys.
* [š](https://github.com/nodef/extra-object/wiki/isDisjoint)
* @param x an object
* @param y another object
* @returns x ⩠y = Φ?
*/
declare function isDisjoint(x: object, y: object): boolean;
/**
* Obtain keys present in any object.
* [š](https://github.com/nodef/extra-object/wiki/unionKeys)
* @param xs objects
* @returns [kā, kā, ...] | [kįµ¢, vįµ¢] ā xā āŖ xā, ...; [xā, xā, ...] = xs
*/
declare function unionKeys(...xs: object[]): Set<string>;
/**
* Obtain entries present in any object.
* [š](https://github.com/nodef/extra-object/wiki/union)
* @param x an object
* @param y another object
* @param fc combine function (a, b)
* @returns x āŖ y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x or [kįµ¢, vįµ¢] ā y\}
*/
declare function union(x: object, y: object, fc?: CombineFunction | null): object;
/**
* Obtain entries present in any object.
* [š](https://github.com/nodef/extra-object/wiki/union$)
* @param x an object (updated)
* @param y another object
* @param fc combine function (a, b)
* @returns x = x āŖ y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x or [kįµ¢, vįµ¢] ā y\}
*/
declare function union$(x: object, y: object, fc?: CombineFunction | null): object;
/**
* Obtain keys present in all objects.
* [š](https://github.com/nodef/extra-object/wiki/intersectionKeys)
* @param xs objects
* @returns [kā, kā, ...] | [kįµ¢, vįµ¢] ā xā ā© xā, ...; [xā, xā, ...] = xs
*/
declare function intersectionKeys(...xs: object[]): Set<string>;
/**
* Obtain entries present in both objects.
* [š](https://github.com/nodef/extra-object/wiki/intersection)
* @param x an object
* @param y another object
* @param fc combine function (a, b)
* @returns x ā© y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x and [kįµ¢, vįµ¢] ā y\}
*/
declare function intersection(x: object, y: object, fc?: CombineFunction | null): object;
/**
* Obtain entries present in both objects.
* [š](https://github.com/nodef/extra-object/wiki/intersection$)
* @param x an object (updated)
* @param y another object
* @param fc combine function (a, b)
* @returns x = x ā© y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x and [kįµ¢, vįµ¢] ā y\}
*/
declare function intersection$(x: object, y: object, fc?: CombineFunction | null): object;
/**
* Obtain entries not present in another object.
* [š](https://github.com/nodef/extra-object/wiki/difference)
* @param x an object
* @param y another object
* @returns x - y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x, [kįµ¢, *] ā y\}
*/
declare function difference(x: object, y: object): object;
/**
* Obtain entries not present in another object.
* [š](https://github.com/nodef/extra-object/wiki/difference$)
* @param x an object (updated)
* @param y another object
* @returns x = x - y = \{[kįµ¢, vįµ¢] | [kįµ¢, vįµ¢] ā x, [kįµ¢, *] ā y\}
*/
declare function difference$(x: object, y: object): object;
/**
* Obtain entries not present in both objects.
* [š](https://github.com/nodef/extra-object/wiki/symmetricDifference)
* @param x an object
* @param y another object
* @returns x-y āŖ y-x
*/
declare function symmetricDifference(x: object, y: object): object;
/**
* Obtain entries not present in both objects.
* [š](https://github.com/nodef/extra-object/wiki/symmetricDifference$)
* @param x an object (updated)
* @param y another object
* @returns x = x-y āŖ y-x
*/
declare function symmetricDifference$(x: object, y: object): object;
/**
* List cartesian product of objects.
* [š](https://github.com/nodef/extra-object/wiki/cartesianProduct)
* @param xs objects
* @param fm map function (vs)
* @returns xā Ć xā Ć ... = \{\{[kā, vā], [kā, vā], ...\} | [kā, vā] ā xā, [kā, vā] ā xā, ...]\}
*/
declare function cartesianProduct(xs: object[], fm?: MapFunction | null): IterableIterator<any>;
export { CombineFunction, CompareFunction, EndFunction, Entries, Lists, MapFunction, ProcessFunction, ReadFunction, ReduceFunction, TestFunction, cartesianProduct, chunk, compare, concat, concat$, count, countAs, difference, difference$, drop, drop$, entries, randomEntry as entry, every, filter, filter$, filterAt, filterAt$, find, findAll, flat, flatMap, forEach, fromEntries, fromLists, get, getAll, getPath, has, hasEntry, has as hasKey, hasPath, hasSubset, hasValue, head, intersection, intersection$, intersectionKeys, is, isDisjoint, isEmpty, isEqual, join, randomKey as key, keys, size as length, map, map$, max, maxEntry, min, minEntry, partition, partitionAs, randomEntry, randomKey, randomSubset, range, rangeEntries, reduce, reject, reject$, rejectAt, rejectAt$, remove, remove$, removePath$, search, searchAll, searchValue, searchValueAll, set, set$, setPath$, size, some, randomSubset as subset, subsets, swap, swap$, symmetricDifference, symmetricDifference$, tail, take, take$, union, union$, unionKeys, values, zip };