utils package
npm install @radicjs/utils
npm i @radicjs/utils
``
yarn add @radicjs/utils
`$3
`ts
export {
camelCase, cloneDeep, constant, debounce, flatten, get,
has, identity, isArguments, isArrayLike, isArrayLikeObject,
isBuffer, isLength, isMap, isPlainObject, isSet, isTypedArray,
kebabCase, keys, keysIn, last, lowerCase, merge, now,
pad, set, snakeCase, startCase, stubFalse, toFinite,
toInteger, toNumber, toString, unset, upperCase, words
} from 'lodash';
export * from '@radicjs/type-check';declare function defaults(obj: Partial, ...defaults: Partial[]): T;
declare function copy(object: T): T;
declare function deepClone(obj: any, hash?: any): T;
declare function mergeDeep(source?: any, target?: any): any;
declare function dotize(obj: any, prefix?: any): any;
declare const objectify: (obj: any, [k, v]: [any, any]) => any;
declare function strRandom(length?: number): string;
declare function strEnsureLeft(str: string, left: string): string;
declare function strEnsureRight(str: string, right: string): string;
declare function strStripLeft(str: string, left: string): string;
declare function strStripRight(str: string, right: string): string;
declare function ucfirst(string: string): string;
declare function lcfirst(string: string): string;
declare function parameters(str: string, params: Record): string;
declare function escapeStringRegexp(string: string): string;
declare function strIs(pattern: string, value: string, ignoreCase?: boolean): boolean;
declare function uuid(): string;
declare function guid(): string;
declare class Toposort {
edges: any[];
Toposort: typeof Toposort;
add(item: string, deps?: string | string[]): this;
sort(): any[];
clear(): this;
}
type Constructor = new (...args: any[]) => Type;
type TupleToFunction = (...args: T) => R;
type PathValue = P extends
${infer K}.${infer Rest} ? K extends keyof T ? Rest extends string ? PathValue : never : never : P extends keyof T ? T[P] : never;
type DotNotation = {
[K in keyof T & string]: T[K] extends Record ? DotNotation${Prefix}${K}.> | ${Prefix}${K} : ${Prefix}${K};
}[keyof T & string];
type DeepPartial = T extends object ? {
[P in keyof T]?: DeepPartial;
} : T;declare function wait(ms: number, cycles?: number): Promise;
export { type Constructor, type DeepPartial, type DotNotation, type PathValue, Toposort, type TupleToFunction, copy, deepClone, defaults, dotize, escapeStringRegexp, guid, lcfirst, mergeDeep, objectify, parameters, strEnsureLeft, strEnsureRight, strIs, strRandom, strStripLeft, strStripRight, ucfirst, uuid, wait };
`$3
- Total: 92.26 kB
- Gzip: 33.92 kB`
$3
St|File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
--|--------------|---------|----------|---------|---------|-------------------------
š”|All files | 69.37 | 39.13 | 60 | 69.28 |
š¢| Toposort.ts| 90.9 | 85.71 | 75 | 90.69 |42,50,151-153
š¢| camelCase.ts| 100 | 100 | 100 | 100 |
š¢| cloneDeep.ts| 100 | 100 | 0 | 100 |
š¢| kebabCase.ts| 100 | 100 | 100 | 100 |
š¢| kindOf.ts| 100 | 100 | 100 | 100 |
š¢| merge.ts| 100 | 100 | 0 | 100 |
š“| obj.ts| 29.41 | 2.77 | 12.5 | 28.57 |14,43,54-66,77-127
š¢| snakeCase.ts| 100 | 100 | 100 | 100 |
š¢| startCase.ts| 100 | 100 | 100 | 100 |
š¢| str.ts| 80.43 | 63.63 | 71.42 | 81.81 |100-101,112-115,127-129
š¢| wait.ts| 100 | 100 | 100 | 100 |
$3
MIT License$3
Robin Radic$3
GitHub - robinradic/radicjs