UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

23 lines 753 B
import crypto from "crypto-js"; const getFileHash = (filePath) => { const hash = crypto.SHA3(filePath); return hash.toString(crypto.enc.Base64).replace(/[^A-Z\d]/gi, "").substring(0, 20); }; const kebabCaseToCamelCase = (name) => { return name.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((word) => { const lowerWord = word.toLowerCase(); let capitalized = lowerWord.charAt(0).toUpperCase() + lowerWord.slice(1); capitalized = capitalized.replace( /(\d)([a-z])/g, (_, number, char) => number + char.toUpperCase() ); return capitalized; }).join(""); }; const sortAlphabetically = (a, b) => a.localeCompare(b); export { getFileHash, kebabCaseToCamelCase, sortAlphabetically }; //# sourceMappingURL=utils.mjs.map