fix: an error occured in switch language in stt
This commit is contained in:
@@ -2,12 +2,12 @@ import _ from 'lodash';
|
|||||||
|
|
||||||
function toShellSafeMultilineJson(value: any): string {
|
function toShellSafeMultilineJson(value: any): string {
|
||||||
const json = JSON.stringify(value, null, 2);
|
const json = JSON.stringify(value, null, 2);
|
||||||
const escaped = json.replace(/'/g, `'\\''`);
|
const escaped = json?.replace(/'/g, `'\\''`);
|
||||||
return `${escaped}`;
|
return `${escaped}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function toShellSafeJson(value: any): string {
|
function toShellSafeJson(value: any): string {
|
||||||
return JSON.stringify(value, null, 2).replace(/'/g, `'\\''`);
|
return JSON.stringify(value, null, 2)?.replace(/'/g, `'\\''`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// curl format
|
// curl format
|
||||||
@@ -16,6 +16,7 @@ export const formatCurlArgs = (
|
|||||||
isFormdata?: boolean
|
isFormdata?: boolean
|
||||||
) => {
|
) => {
|
||||||
if (isFormdata) {
|
if (isFormdata) {
|
||||||
|
console.log('parameters===', parameters);
|
||||||
return _.keys(parameters).reduce((acc: string, key: string) => {
|
return _.keys(parameters).reduce((acc: string, key: string) => {
|
||||||
const val = parameters[key];
|
const val = parameters[key];
|
||||||
const value =
|
const value =
|
||||||
|
|||||||
Reference in New Issue
Block a user