@criticalmanufacturing/dev-i18n-transform
Version:
i18n <--> gettext transform
56 lines (55 loc) • 2.24 kB
TypeScript
export declare class Util {
/**
* Gets the Project information
*/
getProjectInformation(): {
name: string;
version: string;
};
/**
* Splits a string by empty lines into multiple pieces.
* @example
* // returns ["a", "b"]
* util.splitByEmptyLine("a
*
* b");
* @param fileContent File content to be split
* @returns Content of the file split on every empty line.
*/
splitByEmptyLine(fileContent: string): string[];
/**
* This method updates or deletes property of an object
*
* @param sourceObject The source object to start property navigation
* @param propertyArray An array with all nested properties to search for
* @param isDeleteOperation If operation is to delete a property
* @param value New value for property
* @param createFields Defines if the method can created nested objects if needed
* @returns returns false if a given property was not found and true if the field was updated successfully
*/
private deleteOrSetNestedPropertyByArray;
/**
* This method updates a property of an object, based on the set of properties and a new value.
* sourceObject: {
* prop1: {
* prop2 : {
* prop3: 123
* }
* }
* }
* Passing an array literal like ["prop1", "prop2", "prop3"] and a value like "456", will change prop3 from "123" to "456". It creates nested objects along the way
*
* @param sourceObject The source object to start property navigation
* @param propertyArray An array with all nested properties to search for
* @param value New value for property
* @param createFields Defines if the method can created nested objects if needed
* @returns returns false if a given property was not found and true if the field was updated successfully
*/
setNestedPropertyByArray(sourceObject: Object, propertyArray: Array<string>, value: any, createFields: boolean): boolean;
/**
* Gets the default language code
*/
defaultLanguage: string;
}
declare const singleton: Util;
export default singleton;