@sap-ux/store
Version:
NPM module for storing persistent data
42 lines • 1.77 kB
TypeScript
/** Pick the properties listed and return a new object with a shallow-copy */
export declare const pick: <T>(target: T, ...props: Array<keyof T>) => Partial<T> | undefined;
/**
* Checks if any of the values in the object are not `undefined` or `null`
*
* @param obj - the object to check
* @param props - the properties to check on the object
* @returns - `true` if any value is not `undefined` or `null`, `false` otherwise
*/
export declare function hasAnyValue<E extends object, K extends keyof E>(obj: E, props: K[]): boolean;
/** Given an `Error` or any other object thrown, returns an `Error` instance */
export declare function errorInstance(e: Error | unknown): NodeJS.ErrnoException;
/** If input in an instance of `Error` return the message property,
* otherwise convert the input to its string representation
*/
export declare function errorString(e: Error | unknown): string;
export declare enum FioriToolsSettings {
dir = ".fioritools"
}
export declare enum SapTools {
dir = ".saptools"
}
export declare const getFioriToolsDirectory: () => string;
export declare const getSapToolsDirectory: () => string;
/**
* Trims, lowercases and returns plural if a non-empty string
*
* @param s
*/
export declare function toPersistenceName(s: string): string | undefined;
export declare function getEntityFileName(entityName: string): string;
/**
* Simple object matcher that supports nested objects
*
* @param obj - object to inspect
* @param filter - properties and values used for filtering the object.
* @returns - true if the `obj` has equivalent property values to `attrs`
*/
export declare function isMatch(obj: any, filter: any): boolean;
export * from './app-studio.js';
export * from './backend.js';
//# sourceMappingURL=index.d.ts.map