12
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2026-05-14 20:40:32 +00:00

fixing more issues cjs->esm

This commit is contained in:
Leif Ødegård Uhlen 2026-05-05 12:23:04 +02:00
parent 8733839291
commit 9a905dc843
2 changed files with 12 additions and 1 deletions

View file

@ -1,5 +1,5 @@
import * as core from '@actions/core';
import stringToJson from '@cycjimmy/awesome-js-funcs/typeConversion/stringToJson.js';
import stringToJson from './stringToJson.js';
import inputs from './inputs.json' with { type: 'json' };;
/**

11
src/stringToJson.js Normal file
View file

@ -0,0 +1,11 @@
// stringToJson.js
const strToJsonFunc = (str) => (new Function(`return ${str}`))();
const strToJson = (str) => {
try {
return strToJsonFunc(str);
} catch (e) {
return str;
}
};
export default (str) => strToJson(strToJson(str));