mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-07 15:16:56 +00:00
* update require got to import got * convert remaining to esm * wip: replace jest with vitest * fix test imports and vitest config * remove dist package.json * fix import in ent test * add dist * move actions/core to prod dependency * remove unused import that was breaking esm compilation * simplify imports * use module.createRequire to import jsonata * add doc link comment * add comments on import insanity * add more comments * update PR tempalte * bump got and remove jest deps * revert debug npm run command * fix fs import * simplify vitest config for each test suite
19 lines
432 B
JavaScript
19 lines
432 B
JavaScript
/**
|
|
* Replaces any dot chars to __ and removes non-ascii charts
|
|
* @param {string} dataKey
|
|
* @param {boolean=} isEnvVar
|
|
*/
|
|
function normalizeOutputKey(dataKey, isEnvVar = false) {
|
|
let outputKey = dataKey
|
|
.replace(".", "__")
|
|
.replace(new RegExp("-", "g"), "")
|
|
.replace(/[^\p{L}\p{N}_-]/gu, "");
|
|
if (isEnvVar) {
|
|
outputKey = outputKey.toUpperCase();
|
|
}
|
|
return outputKey;
|
|
}
|
|
|
|
export {
|
|
normalizeOutputKey
|
|
};
|