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:
parent
8733839291
commit
9a905dc843
2 changed files with 12 additions and 1 deletions
|
|
@ -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
11
src/stringToJson.js
Normal 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));
|
||||
Loading…
Add table
Add a link
Reference in a new issue