@ez4/utils
Advanced tools
Comparing version 0.7.1 to 0.8.0
@@ -1,7 +0,7 @@ | ||
import type { AnyObject } from '../object/generics.js'; | ||
export type ArrayComparisonResult = Record<number, any>; | ||
export type ArrayComparison = { | ||
counts: number; | ||
create?: AnyObject; | ||
update?: AnyObject; | ||
remove?: AnyObject; | ||
create?: ArrayComparisonResult; | ||
update?: ArrayComparisonResult; | ||
remove?: ArrayComparisonResult; | ||
}; | ||
@@ -8,0 +8,0 @@ /** |
/** | ||
* Normalize the given `text` keeping only `a-z`, `0-9`, `-` and `_` characters. | ||
* | ||
* @param text Text to convert. | ||
* @param separator Word separator. | ||
* @returns Returns the converted text. | ||
*/ | ||
export declare const normalize: (text: string, separator: string) => string; | ||
/** | ||
* Convert the given `text` into kebab-case. | ||
@@ -8,1 +16,8 @@ * | ||
export declare const toKebabCase: (text: string) => string; | ||
/** | ||
* Convert the given `text` into camcel_case. | ||
* | ||
* @param text Text to convert. | ||
* @returns Returns the converted text. | ||
*/ | ||
export declare const toCamelCase: (text: string) => string; |
@@ -9,2 +9,3 @@ export type * from './object/generics.js'; | ||
export * from './object/compare.js'; | ||
export * from './object/empty.js'; | ||
export * from './object/equal.js'; | ||
@@ -11,0 +12,0 @@ export * from './object/clone.js'; |
@@ -17,3 +17,3 @@ /** | ||
export type DeepPartial<T extends AnyObject> = { | ||
[P in keyof T]?: T[P] extends AnyObject ? DeepPartial<T[P]> : T[P]; | ||
[P in keyof T]?: NonNullable<T[P]> extends AnyObject ? DeepPartial<T[P]> : T[P]; | ||
}; | ||
@@ -28,3 +28,3 @@ /** | ||
export type PartialProperties<T extends AnyObject> = { | ||
[P in keyof T]?: T[P] extends AnyObject ? PartialProperties<T[P]> | boolean : boolean; | ||
[P in keyof T]?: NonNullable<T[P]> extends AnyObject ? PartialProperties<T[P]> | boolean : boolean; | ||
}; | ||
@@ -40,3 +40,3 @@ /** | ||
export type PartialObject<T extends AnyObject, O extends AnyObject, V extends boolean = true> = { | ||
[P in keyof T as PartialObjectProperty<O[P], P, V>]: O[P] extends AnyObject ? PartialObject<T[P], O[P], V> : T[P]; | ||
[P in keyof T as PartialObjectProperty<O[P], P, V>]: NonNullable<O[P]> extends AnyObject ? PartialObject<T[P], O[P], V> : T[P]; | ||
}; | ||
@@ -43,0 +43,0 @@ /** |
@@ -7,5 +7,5 @@ export type Attempter<T> = (count: number, attempts: number) => Promise<T | undefined> | T | undefined; | ||
* @param attempter Attempter callback. | ||
* @param attempts Maximum number of attempts. Default is: 15 | ||
* @param attempts Maximum number of attempts. Default is: 30 | ||
* @returns Returns the `attempter` result or `null` when all `attempts` are reached. | ||
*/ | ||
export declare const waitFor: <T>(attempter: Attempter<T>, attempts?: number) => Promise<NonNullable<T> | null>; |
{ | ||
"name": "@ez4/utils", | ||
"description": "EZ4: General utilities to use across several packages", | ||
"version": "0.7.1", | ||
"version": "0.8.0", | ||
"author": "Silas B.", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23965
25
393