amourlinguini
Version:
A JSON-based translation file manager.
19 lines • 773 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RegexUtils = void 0;
var LANG_FILE_REGEX = '^{{FILE_NAME}}\\.(?!common)([^.]+)\\.json$';
var RegexUtils = /** @class */ (function () {
function RegexUtils() {
}
RegexUtils.getLangCodes = function (fileName, fileNames) {
var regex = new RegExp(LANG_FILE_REGEX.replace('{{FILE_NAME}}', fileName));
return fileNames.flatMap(function (fileName) {
var _a;
var langCode = (_a = fileName.match(regex)) === null || _a === void 0 ? void 0 : _a[1];
return langCode !== null && langCode !== void 0 ? langCode : [];
});
};
return RegexUtils;
}());
exports.RegexUtils = RegexUtils;
//# sourceMappingURL=regex-utils.js.map