
META-INF.resources.designer.js.definition-builder.util.lang.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.portal.workflow.kaleo.designer.web Show documentation
Show all versions of com.liferay.portal.workflow.kaleo.designer.web Show documentation
Liferay Portal Workflow Kaleo Designer Web
The newest version!
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
const sub = (langKey: string, args: string[]) => {
const SPLIT_REGEX = /({\d+})/g;
const keyArray = langKey
.split(SPLIT_REGEX)
.filter((val) => val.length !== 0);
for (let i = 0; i < args.length; i++) {
const arg = args[i];
const indexKey = `{${i}}`;
let argIndex = keyArray.indexOf(indexKey);
while (argIndex >= 0) {
keyArray.splice(argIndex, 1, arg);
argIndex = keyArray.indexOf(indexKey);
}
}
return keyArray.join('');
};
export default {
sub,
};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy