@formkit/utils
Advanced tools
Comparing version 1.0.0-beta.6-f937439 to 1.0.0-beta.7-058570b
@@ -23,3 +23,3 @@ /** | ||
*/ | ||
export declare function clone<T extends Record<string, unknown> | unknown[] | null>(obj: T): T; | ||
export declare function clone<T extends Record<string, unknown> | unknown[] | null>(obj: T, explicit?: string[]): T; | ||
@@ -55,6 +55,9 @@ /** | ||
* @param deep - Indicate if we should recurse into the object | ||
* @param explicit - Explicit keys | ||
* @returns boolean | ||
* @public | ||
*/ | ||
export declare function eq(valA: any, valB: any, deep?: boolean): boolean; | ||
export declare function eq(valA: any, // eslint-disable-line | ||
valB: any, // eslint-disable-line | ||
deep?: boolean, explicit?: string[]): boolean; | ||
@@ -119,12 +122,12 @@ /** | ||
export declare function init<T extends object>(obj: T): T & { | ||
__init: true; | ||
__init?: true; | ||
}; | ||
/** | ||
* Determines if an object is an object or not. | ||
* @param o - any value | ||
* Checks if an object is a simple array or record. | ||
* @param o - A value to check | ||
* @returns | ||
* @public | ||
*/ | ||
export declare function isObject(o: any): boolean; | ||
export declare function isObject(o: unknown): o is Record<PropertyKey, unknown> | unknown[]; | ||
@@ -139,3 +142,3 @@ /** | ||
*/ | ||
export declare function isPojo(o: any): boolean; | ||
export declare function isPojo(o: any): o is Record<string, any>; | ||
@@ -158,2 +161,10 @@ /** | ||
/** | ||
* Determines if an object is an object or not. | ||
* @param o - any value | ||
* @returns | ||
* @public | ||
*/ | ||
export declare function isRecord(o: unknown): o is Record<PropertyKey, unknown>; | ||
/** | ||
* This converts camel-case to kebab case. It ONLY converts from camel to kebab. | ||
@@ -224,2 +235,10 @@ * @param str - Converts camel to kebab | ||
/** | ||
* Very shallowly clones the given object. | ||
* @param obj - The object to shallow clone | ||
* @returns | ||
* @public | ||
*/ | ||
export declare function shallowClone<T>(obj: T, explicit?: string[]): T; | ||
/** | ||
* Turn any string into a URL/DOM safe string. | ||
@@ -231,2 +250,9 @@ * @public | ||
/** | ||
* Spreads an object or an array, otherwise returns the same value. | ||
* @param obj - Any value, but will spread objects and arrays | ||
* @public | ||
*/ | ||
export declare function spread<T>(obj: T, explicit?: string[]): T; | ||
/** | ||
* Generates a random string. | ||
@@ -233,0 +259,0 @@ * @returns string |
{ | ||
"name": "@formkit/utils", | ||
"version": "1.0.0-beta.6-f937439", | ||
"version": "1.0.0-beta.7-058570b", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "Shared utilities for FormKit packages", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45206
1484