@intlayer/chokidar
Version:
Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.
23 lines • 1.03 kB
TypeScript
//#region src/utils/verifyIdenticObjectFormat.d.ts
type FlatType = string | number | boolean | object | null | undefined;
type RecursiveType = FlatType | {
[key: string]: RecursiveType;
} | Array<RecursiveType>;
type VerifyIdenticObjectFormatResult = {
isIdentic: boolean;
error?: string;
};
/**
* Verifies that two objects have identical structure (same keys, array lengths, and types)
* but not necessarily the same values.
* Useful for validating translations maintain the same format as the original.
*
* @param object - The object to verify
* @param expectedFormat - The expected format to compare against
* @param path - Current path in the object tree (for error messages)
* @returns true if structures match, throws error with details if they don't
*/
declare const verifyIdenticObjectFormat: (object: RecursiveType, expectedFormat: RecursiveType, path?: string) => VerifyIdenticObjectFormatResult;
//#endregion
export { verifyIdenticObjectFormat };
//# sourceMappingURL=verifyIdenticObjectFormat.d.ts.map