@primno/core
Version:
Front-end framework for Model-Driven Apps of Power Apps and Dynamics 365.
48 lines (47 loc) • 1.4 kB
TypeScript
export declare const EmptyString = "";
/**
* Indicates whether the string is null or empty.
* @param text
*/
export declare function isNullOrEmpty(text: string | null | undefined): text is null | undefined | "";
/**
* Indicates whether an element is a javascript object.
* @param item
*/
export declare function isObject(item: unknown): item is Record<string, unknown>;
/**
* Merges an object with others, including sub-properties.
* @param target
* @param sources
*/
export declare function mergeDeep(target: Record<string, unknown>, ...sources: unknown[]): Record<string, unknown>;
/**
* Determines if an item is a promise.
* @param object
* @returns
*/
export declare function isPromise(object: any): object is Promise<any>;
/**
* Remove {} of a guid
* @param id
*/
export declare function formatId(id: string): string;
/**
* Indicates if the 2 Guid are identical.
* @param id1 Guid 1
* @param id2 Guid 2
*/
export declare function isSameId(id1: string, id2: string): boolean;
/**
* Indicate if the object has the method.
* @param obj Object
* @param methodName Method name.
* @returns true or false
*/
export declare function hasMethod(obj: Record<string | symbol, any>, methodName: string): boolean;
/**
* Gets all methods of an object (prototype include).
* @param obj
* @returns
*/
export declare function getMethods(obj: Record<string | symbol, any>): string[];