@sap-cloud-sdk/util
Version:
SAP Cloud SDK for JavaScript general utilities
49 lines (48 loc) • 2.06 kB
TypeScript
/**
* Within all files generated by the SDK we use the unix style end of line delimiter.
* We do not consider if the generator is executed on windows or unix systems.
* It will always be `\n` to have consistent clients between operating systems.
* @deprecated Since v4.6.0. Use '\n' directly instead.
*/
export declare const unixEOL = "\n";
/**
* For request payloads, etc., it is convention to use the `\r\n` new line.
* @deprecated Since v4.6.0. Use '\r\n' directly instead.
*/
export declare const webEOL = "\r\n";
/**
* Convert a string to the uppercase snake case. This format is used e.g. for static properties on entity classes.
* @param str - The string to be transformed.
* @returns The input string in the case used by static methods on entity-classes.
*/
export declare function upperCaseSnakeCase(str: string): string;
/**
* Convert a string to camelCase. This format used e.g. for properties on entity class instances.
* @param str - The string to be transformed.
* @returns The transformed string.
*/
export declare function camelCase(str: string): string;
/**
* Convert a string to a human readable format, e.g. it transforms `to_BusinessPartner` to `To Business Partner`.
* @param str - The string to be transformed.
* @returns The transformed string.
*/
export declare function titleFormat(str: string): string;
/**
* Convert a string to pascal case. This format is used e.g. for types.
* @param str - The string to be transformed.
* @returns The transformed string.
*/
export declare function pascalCase(str: string): string;
/**
* Convert a string to kebab case. This format is used e.g. for file names.
* @param str - The string to be transformed.
* @returns The transformed string.
*/
export declare function kebabCase(str: string): string;
/**
* Convert a JSON object to a string using formatting in line with the prettier with indentation and new line at the end.
* @param json - Object to be stringified.
* @returns The JSON object as string.
*/
export declare function formatJson(json: any): string;