dotize
dotize copied to clipboard
Need types for typescript usage
Heres chatgpt version
/* eslint-disable @typescript-eslint/no-explicit-any */
// Convert complex js object to dot notation js object
// url: https://github.com/vardars/dotize
// author: vardars
declare module "dotize" {
interface Dotize {
valTypes: {
none: string;
primitive: string;
object: string;
array: string;
};
getValType(val: any): string;
getPathType(arrPath: any[]): string[];
isUndefined(obj: any): boolean;
isNumber(f: any): boolean;
isEmptyObj(obj: any): boolean;
isNotObject(obj: any): boolean;
isEmptyArray(arr: any[]): boolean;
isNotArray(arr: any[]): boolean;
removeEmptyArrayItem(arr: any[]): any[];
getFieldName(
field: any,
prefix: string,
isRoot: boolean,
isArrayItem: boolean,
isArray?: boolean,
): string;
startsWith(val: string, valToSearch: string): boolean;
convert(obj: any, prefix?: string): any;
backward(obj: any, prefix?: string): any;
}
const dotize: Dotize;
export = dotize;
}
I added types to be used with ts, can you check it? it's been a while, lol. :) with version 0.5.0
I think it is resolved in 0.6.0
import dotize from 'dotize';