diff --git a/packages/transformers/src/operations/transformer.js b/packages/transformers/src/operations/transformer.js index 36a07193..59df39dd 100644 --- a/packages/transformers/src/operations/transformer.js +++ b/packages/transformers/src/operations/transformer.js @@ -15,7 +15,7 @@ export const transformerWithArg = (func, name, value, args) => { const arg = args.find(a => a.name === name); if (!arg) { - throw new Error('Invalid Argument for ${name}'); + throw new Error(`Invalid Argument for ${name}`); } return new Promise((resolve, reject) => { @@ -36,7 +36,7 @@ export const transformerWithTwoArgs = (func, name1, name2, value, args) => { const arg2 = args.find(a => a.name === name2); if (!arg1 || !arg2) { - throw new Error('Invalid Argument for ${name1} or ${name2}'); + throw new Error(`Invalid Argument for ${name1} or ${name2}`); } return new Promise((resolve, reject) => { @@ -56,7 +56,7 @@ export const rawTransformerWithArg = (func, name, value, args) => { const arg = args.find(a => a.name === name); if (!arg) { - throw new Error('Invalid Argument for ${name}'); + throw new Error(`Invalid Argument for ${name}`); } return new Promise((resolve, reject) => { @@ -68,12 +68,10 @@ export const rawTransformerWithArg = (func, name, value, args) => { }); }; -export const rawTransformerWithoutArg = (func, value) => { - return new Promise((resolve, reject) => { - try { - resolve(func(value)); - } catch (error) { - reject(error); - } - }); -}; +export const rawTransformerWithoutArg = (func, value) => new Promise((resolve, reject) => { + try { + resolve(func(value)); + } catch (error) { + reject(error); + } +});