mirror of
https://github.com/usebruno/bruno.git
synced 2025-02-15 01:10:14 +01:00
fix: remove removeQuotes()
This commit is contained in:
parent
27ef28ae9b
commit
dbf1cad124
@ -22,12 +22,12 @@ const toNumber = (value) => {
|
||||
return Number.isInteger(num) ? parseInt(value, 10) : parseFloat(value);
|
||||
};
|
||||
|
||||
const removeQuotes = (str) => {
|
||||
if ((str.startsWith('"') && str.endsWith('"')) || (str.startsWith("'") && str.endsWith("'"))) {
|
||||
return str.slice(1, -1);
|
||||
}
|
||||
return str;
|
||||
};
|
||||
// const removeQuotes = (str) => {
|
||||
// if ((str.startsWith('"') && str.endsWith('"')) || (str.startsWith("'") && str.endsWith("'"))) {
|
||||
// return str.slice(1, -1);
|
||||
// }
|
||||
// return str;
|
||||
// };
|
||||
|
||||
const executeQuickJsVm = ({ script: externalScript, context: externalContext, scriptType = 'template-literal' }) => {
|
||||
if (!externalScript?.length || typeof externalScript !== 'string') {
|
||||
@ -44,7 +44,8 @@ const executeQuickJsVm = ({ script: externalScript, context: externalContext, sc
|
||||
if (externalScript === 'null') return null;
|
||||
if (externalScript === 'undefined') return undefined;
|
||||
|
||||
externalScript = removeQuotes(externalScript);
|
||||
// This is commented out as part of the fix for #3758
|
||||
// externalScript = removeQuotes(externalScript);
|
||||
|
||||
const vm = QuickJSSyncContext;
|
||||
|
||||
@ -94,7 +95,8 @@ const executeQuickJsVmAsync = async ({ script: externalScript, context: external
|
||||
if (externalScript === 'null') return null;
|
||||
if (externalScript === 'undefined') return undefined;
|
||||
|
||||
externalScript = removeQuotes(externalScript);
|
||||
// This is commented out as part of the fix for #3758
|
||||
// externalScript = removeQuotes(externalScript);
|
||||
|
||||
try {
|
||||
const module = await newQuickJSWASMModule();
|
||||
|
@ -85,13 +85,15 @@ const evaluateJsTemplateLiteral = (templateLiteral, context) => {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
if (templateLiteral.startsWith('"') && templateLiteral.endsWith('"')) {
|
||||
return templateLiteral.slice(1, -1);
|
||||
}
|
||||
// This is commented out as part of the fix for #3758
|
||||
// if (templateLiteral.startsWith('"') && templateLiteral.endsWith('"')) {
|
||||
// return templateLiteral.slice(1, -1);
|
||||
// }
|
||||
|
||||
if (templateLiteral.startsWith("'") && templateLiteral.endsWith("'")) {
|
||||
return templateLiteral.slice(1, -1);
|
||||
}
|
||||
// This is commented out as part of the fix for #3758
|
||||
// if (templateLiteral.startsWith("'") && templateLiteral.endsWith("'")) {
|
||||
// return templateLiteral.slice(1, -1);
|
||||
// }
|
||||
|
||||
if (!isNaN(templateLiteral)) {
|
||||
const number = Number(templateLiteral);
|
||||
|
Loading…
Reference in New Issue
Block a user