data-structure-typed
Advanced tools
Comparing version 0.8.6 to 0.8.16
@@ -1,1 +0,1 @@ | ||
export * from './data-structures'; | ||
export * from './utils'; |
@@ -1,2 +0,9 @@ | ||
import { AnyFunction } from './types'; | ||
export type AnyFunction<A extends any[] = any[], R = any> = (...args: A) => R; | ||
export type Primitive = number | string | boolean | symbol | undefined | null | void | AnyFunction | Date; | ||
export type Cast<T, TComplex> = { | ||
[M in keyof TComplex]: T; | ||
}; | ||
export type DeepLeavesWrap<T, TComplex> = T extends string ? Cast<string, TComplex> : T extends number ? Cast<number, TComplex> : T extends boolean ? Cast<boolean, TComplex> : T extends undefined ? Cast<undefined, TComplex> : T extends null ? Cast<null, TComplex> : T extends void ? Cast<void, TComplex> : T extends symbol ? Cast<symbol, TComplex> : T extends AnyFunction ? Cast<AnyFunction, TComplex> : T extends Date ? Cast<Date, TComplex> : { | ||
[K in keyof T]: T[K] extends (infer U)[] ? DeepLeavesWrap<U, TComplex>[] : DeepLeavesWrap<T[K], TComplex>; | ||
}; | ||
export type JSONSerializable = { | ||
@@ -9,115 +16,32 @@ [key: string]: any; | ||
} | ||
export declare function randomText(length: number): string; | ||
export declare const uuidV4: () => string; | ||
export declare class IncrementId { | ||
private _id; | ||
private readonly _prefix; | ||
constructor(prefix?: string); | ||
getId(): string; | ||
export type TypeName<T> = T extends string ? 'string' : T extends number ? 'number' : T extends boolean ? 'boolean' : T extends undefined ? 'undefined' : T extends AnyFunction ? 'function' : 'object'; | ||
export type JsonKeys<T> = keyof { | ||
[P in keyof T]: number; | ||
}; | ||
/** | ||
* A function that emits a side effect and does not return anything. | ||
*/ | ||
export type Procedure = (...args: any[]) => void; | ||
export type DebounceOptions = { | ||
isImmediate?: boolean; | ||
maxWait?: number; | ||
}; | ||
export interface DebouncedFunction<F extends Procedure> { | ||
(this: ThisParameterType<F>, ...args: Parameters<F>): void; | ||
cancel: () => void; | ||
} | ||
export declare function incrementId(prefix?: string): () => string; | ||
export declare const getValue: <T, K extends keyof T>(obj: T, names: K[]) => T[K][]; | ||
export declare const isObject: (object: string | JSONObject | boolean | AnyFunction | number) => boolean; | ||
export declare const looseEqual: (a: any, b: any) => boolean; | ||
export declare const strictEqual: (a: any, b: any) => boolean; | ||
export declare const strictObjectIsEqual: (a: any, b: any) => boolean; | ||
export declare const deepObjectStrictEqual: (object1: JSONSerializable, object2: JSONSerializable) => boolean; | ||
export declare const isTypeEqual: <T>(obj: unknown) => void; | ||
export declare function reverseColor(oldColor: string): string; | ||
export declare const isSameStructure: (objA: unknown, objB: unknown) => boolean; | ||
export declare const isLeafParent: (obj: JSONObject) => boolean; | ||
export declare const addDays: (date: Date, days: number) => Date; | ||
export declare class WaitManager { | ||
private _time1; | ||
get time1(): number; | ||
private _time2; | ||
get time2(): number; | ||
private _time3; | ||
get time3(): number; | ||
private _time4; | ||
get time4(): number; | ||
private _time10; | ||
get time10(): number; | ||
private _time20; | ||
get time20(): number; | ||
private _time30; | ||
get time50(): number; | ||
private _time60; | ||
get time60(): number; | ||
private _cusTime; | ||
get cusTime(): number; | ||
set cusTime(v: number); | ||
private readonly _nXSpeed; | ||
constructor(nXSpeed?: number); | ||
export type MonthKey = 'January' | 'February' | 'March' | 'April' | 'May' | 'June' | 'July' | 'August' | 'September' | 'October' | 'November' | 'December'; | ||
export type Month = { | ||
[key in MonthKey]: string; | ||
}; | ||
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | ||
export declare class TreeNode<T> { | ||
id: string; | ||
name?: string | undefined; | ||
value?: T | undefined; | ||
children?: TreeNode<T>[] | undefined; | ||
constructor(id: string, name?: string, value?: T, children?: TreeNode<T>[]); | ||
addChildren(children: TreeNode<T> | TreeNode<T>[]): void; | ||
getHeight(): number; | ||
} | ||
export declare const wait: (ms: number, resolveValue?: any) => Promise<unknown>; | ||
export declare class AuthAPIError extends Error { | ||
protected serverErrorStack: string | undefined; | ||
protected serverErrorCode: string | undefined; | ||
constructor(serverErrorMessage: string, serverErrorCode?: string, serverErrorStack?: string); | ||
} | ||
export declare class BunnyAPIError extends Error { | ||
protected serverErrorStack: string | undefined; | ||
protected serverErrorCode: string | undefined; | ||
constructor(serverErrorMessage: string, serverErrorCode?: string, serverErrorStack?: string); | ||
} | ||
export declare class NomicsAPIError extends Error { | ||
protected serverErrorStack: string | undefined; | ||
protected serverErrorCode: string | undefined; | ||
constructor(serverErrorMessage: string, serverErrorCode?: string, serverErrorStack?: string); | ||
} | ||
export declare function extractValue<Item>(data: { | ||
key: string; | ||
value: Item; | ||
}[]): Item[]; | ||
export declare function keyValueToArray<Item>(data: { | ||
[key: string]: Item; | ||
}): Item[]; | ||
export declare function minuted(time: number): string; | ||
export declare function randomDate(start?: Date, end?: Date, specificProbabilityStart?: Date, specificProbability?: number): Date; | ||
export declare const capitalizeWords: (str: string) => string; | ||
export declare const capitalizeFirstLetter: (str: string) => string; | ||
export declare const comparerArray: <T>(otherArray: T[], limitKeys?: string[]) => (current: T) => boolean; | ||
export declare const onlyInA: <T>(a: T[], b: T[]) => T[]; | ||
export declare const onlyInB: <T>(a: T[], b: T[]) => T[]; | ||
export declare const diffAB: <T>(a: T[], b: T[]) => T[]; | ||
export declare class StringUtil { | ||
static toCamelCase(str: string): string; | ||
static toSnakeCase(str: string): string; | ||
static toPascalCase(str: string): string; | ||
static toConstantCase(str: string): string; | ||
static toKebabCase(str: string): string; | ||
static toLowerCase(str: string): string; | ||
static toTitleCase(str: string): string; | ||
static toSentenceCase(str: string): string; | ||
static toPathCase(str: string): string; | ||
static toDotCase(str: string): string; | ||
} | ||
type ToCase = 'camel' | 'snake' | 'pascal' | 'constant' | 'kebab' | 'lower' | 'title' | 'sentence' | 'path' | 'dot'; | ||
export declare const deepKeysConvert: (obj: any, toType?: ToCase) => any; | ||
export declare const deepRemoveByKey: (obj: any, keysToBeRemoved: string[]) => any; | ||
export declare const deepRenameKeys: (obj: JSONSerializable, keysMap: { | ||
[x: string]: string; | ||
}) => JSONSerializable; | ||
export declare const deepReplaceValues: (obj: JSONSerializable, keyReducerMap: { | ||
[x: string]: (item: JSONSerializable) => any; | ||
}) => JSONSerializable; | ||
export declare const deepAdd: (obj: JSONSerializable, keyReducerMap: { | ||
[x: string]: (item: JSONSerializable) => any; | ||
}, isItemRootParent?: boolean) => [] | JSONObject; | ||
export declare const bunnyConsole: { | ||
log: (headerLog?: string, ...args: any[]) => void; | ||
warn: (headerLog?: string, ...args: any[]) => void; | ||
error: (headerLog?: string, ...args: any[]) => void; | ||
}; | ||
export declare const timeStart: () => number; | ||
export declare const timeEnd: (startTime: number, headerLog?: string, consoleConditionFn?: ((timeSpent: number) => boolean) | undefined) => void; | ||
export declare const arrayRemove: <T>(array: T[], predicate: (item: T, index: number, array: T[]) => boolean) => T[]; | ||
export declare function memo(): (target: Object, propertyKey: string, descriptor: PropertyDescriptor) => void; | ||
export declare function zip<T = number, T1 = number>(array1: T[], array2: T1[], options?: { | ||
isToObj: boolean; | ||
}): [T, T1][] | { | ||
x: T; | ||
y: T1; | ||
}[]; | ||
export {}; | ||
export type OrderType = 'InOrder' | 'PreOrder' | 'PostOrder'; |
{ | ||
"name": "data-structure-typed", | ||
"version": "0.8.6", | ||
"version": "0.8.16", | ||
"description": "Hash (CoordinateSet, CoordinateMap) Heap (MaxHeap, MinHeap) Binary Tree (AVL Tree, Binary Indexed Tree, Binary Search Tree, Segment Tree, Tree Multiset) Graph (Directed Graph, Undirected Graph) Linked List (Singly Linked List, Doubly Linked List) Matrix Priority Queue (Max Priority Queue, Min Priority Queue) Queue (Queue, Dequeue) Stack Trie", | ||
@@ -65,5 +65,6 @@ "main": "dist/index.js", | ||
"bugs": { | ||
"url": "https://github.com/zrwusa/data-structure-ts/issues" | ||
"url": "https://github.com/zrwusa/data-structure-typed/issues" | ||
}, | ||
"homepage": "https://github.com/zrwusa/data-structure-ts#readme", | ||
"homepage": "https://github.com/zrwusa/data-structure-typed#readme", | ||
"types": "dist/index.d.ts", | ||
"devDependencies": { | ||
@@ -70,0 +71,0 @@ "@types/lodash": "^4.14.178", |
@@ -16,3 +16,3 @@ { | ||
"moduleResolution": "node", | ||
"declarationDir": "./dist/types", | ||
"declarationDir": "./dist", | ||
"skipLibCheck": true | ||
@@ -29,3 +29,4 @@ | ||
"include": [ | ||
"src" | ||
"src", | ||
"node_modules/data-structure-typed" | ||
], | ||
@@ -32,0 +33,0 @@ "exclude": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
524824
217
14834
0
2