npm package: @radicjs/utils
Description: utils package
Latest version: 0.4.0

# @radicjs/utils

### Installation
```
npm i @radicjs/utils
```

```
yarn add @radicjs/utils
```

### Declaration
```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<T>(obj: Partial<T>, ...defaults: Partial<T>[]): T;
declare function copy<T>(object: T): T;
declare function deepClone<T extends any = any>(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, string>): 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<Type = any> = new (...args: any[]) => Type;
type TupleToFunction<T extends any[], R = void> = (...args: T) => R;
type PathValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rest extends string ? PathValue<T[K], Rest> : never : never : P extends keyof T ? T[P] : never;
type DotNotation<T, Prefix extends string = ''> = {
    [K in keyof T & string]: T[K] extends Record<string, any> ? DotNotation<T[K], `${Prefix}${K}.`> | `${Prefix}${K}` : `${Prefix}${K}`;
}[keyof T & string];
type DeepPartial<T> = T extends object ? {
    [P in keyof T]?: DeepPartial<T[P]>;
} : T;

declare function wait(ms: number, cycles?: number): Promise<void>;
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 };
```

### Size
<!-- sizes:start -->
- Total: `92.26 kB`
- Gzip: `33.92 kB`

<!-- sizes:end -->


### Coverage
<!-- coverage:start -->
St|File          | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s       
--|--------------|---------|----------|---------|---------|-------------------------
🟡|All files     |   69.37 |    39.13 |      60 |   69.28 |                         
🟢|&nbsp;[Toposort.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/Toposort.ts)|    90.9 |    85.71 |      75 |   90.69 |[42](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/Toposort.ts#L42),[50](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/Toposort.ts#L50),[151-153](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/Toposort.ts#L151-L153)
🟢|&nbsp;[camelCase.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/camelCase.ts)|     100 |      100 |     100 |     100 |
🟢|&nbsp;[cloneDeep.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/cloneDeep.ts)|     100 |      100 |       0 |     100 |
🟢|&nbsp;[kebabCase.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/kebabCase.ts)|     100 |      100 |     100 |     100 |
🟢|&nbsp;[kindOf.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/kindOf.ts)|     100 |      100 |     100 |     100 |
🟢|&nbsp;[merge.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/merge.ts)|     100 |      100 |       0 |     100 |
🔴|&nbsp;[obj.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/obj.ts)|   29.41 |     2.77 |    12.5 |   28.57 |[14](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/obj.ts#L14),[43](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/obj.ts#L43),[54-66](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/obj.ts#L54-L66),[77-127](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/obj.ts#L77-L127)
🟢|&nbsp;[snakeCase.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/snakeCase.ts)|     100 |      100 |     100 |     100 |
🟢|&nbsp;[startCase.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/startCase.ts)|     100 |      100 |     100 |     100 |
🟢|&nbsp;[str.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/str.ts)|   80.43 |    63.63 |   71.42 |   81.81 |[100-101](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/str.ts#L100-L101),[112-115](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/str.ts#L112-L115),[127-129](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/str.ts#L127-L129)
🟢|&nbsp;[wait.ts](https://github.com/RobinRadic/radicjs/tree/master/packages/utils/src/wait.ts)|     100 |      100 |     100 |     100 |
<!-- coverage:end -->


### License:
MIT License

### Author:
Robin Radic

### Repository:
[GitHub - robinradic/radicjs](https://github.com/robinradic/radicjs)