filestack-adaptive
Version:
HTML5 picture elements powered by Filestack
37 lines (36 loc) • 1.23 kB
TypeScript
declare const utils: {
/**
* Creates a new list out of the two supplied by creating each possible pair from the lists.
* It works similar to https://ramdajs.com/docs/#xprod
* @param arr - An array to be processed
*/
cartesian: (arr: any[]) => any;
/**
* Split an array into many arrays with a provided chunk factor
* @param array - An original array to be splitted
* @param chunk - A number of elements which new arrays will contain
*/
arrToChunks: (array: any[], chunk?: number) => any[][];
/**
* Remove falsey values from object.
* @param obj - An object to be filtered
*/
removeEmpty: (obj: any) => any;
/**
* Utility to get numbers from ambiguous types.
* @param value - A value to be checked
*/
getNumber: (value: any) => number;
/**
* Utility to get unit of width or resolution
* @param value - A value from which a unit will be extracted
*/
getUnit: (value: any) => string;
/**
* Flat elements in array to provided depthness
* @param arr - The array to flatten
* @param depth - A maximum recursion depth
*/
flat: (arr: any[], depth: number) => [];
};
export default utils;