@wandzai/utils 1.0.52-wandz-3542-interactions-events-1 → 1.0.52-wandz-3542-interactions-events-1-test-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/common.d.ts +1 -1
- package/src/snowflake.d.ts +0 -1
- package/src/snowflake.js +3 -12
- package/src/snowflake.js.map +1 -1
package/package.json
CHANGED
package/src/common.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export declare const upperCaseFirstChar: (word: string) => string;
|
|
|
9
9
|
export declare const upperCaseFirstCharOfEachWord: (str: string) => string;
|
|
10
10
|
export declare const jsonToConsistentString: (jsonObj: any) => string;
|
|
11
11
|
export declare const booleanStringToBoolean: (value: string) => boolean;
|
|
12
|
-
export declare const booleanStringToNumber: (value: string) =>
|
|
12
|
+
export declare const booleanStringToNumber: (value: string) => 1 | 0;
|
package/src/snowflake.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export declare const buildProcedureJsonString: (procedure: string, params: Record<string, any>, paramValueWrappingOverride?: Record<string, (value: string) => string>) => string;
|
|
2
1
|
export declare const buildComplexTypedProcedure: (procedure: string, params: {
|
|
3
2
|
[paramName: string]: any;
|
|
4
3
|
}) => string;
|
package/src/snowflake.js
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildProcedureWithValues = exports.buildComplexTypedProcedure =
|
|
4
|
-
const
|
|
5
|
-
return `CALL ${procedure}(${Object.entries(params)
|
|
6
|
-
.map(([k, v]) => {
|
|
7
|
-
const wrapMethod = paramValueWrappingOverride[k];
|
|
8
|
-
const valuePart = wrapMethod ? wrapMethod(v) : `\'${v}\'`;
|
|
9
|
-
return `${k} => ${valuePart}`;
|
|
10
|
-
})
|
|
11
|
-
.join(',')});`;
|
|
12
|
-
};
|
|
13
|
-
exports.buildProcedureJsonString = buildProcedureJsonString;
|
|
3
|
+
exports.buildProcedureWithValues = exports.buildComplexTypedProcedure = void 0;
|
|
4
|
+
const utils_1 = require("@wandzai/utils");
|
|
14
5
|
const formatParamValue = (value) => {
|
|
15
6
|
if (Array.isArray(value)) {
|
|
16
|
-
return
|
|
7
|
+
return (0, utils_1.stringifyWithSingleQuotes)(value);
|
|
17
8
|
}
|
|
18
9
|
else if (typeof value === 'boolean') {
|
|
19
10
|
return value ? 'TRUE' : 'FALSE';
|
package/src/snowflake.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../../libs/utils/src/snowflake.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"snowflake.js","sourceRoot":"","sources":["../../../../libs/utils/src/snowflake.ts"],"names":[],"mappings":";;;AAAA,0CAAyD;AAEzD,MAAM,gBAAgB,GAAG,CAAC,KAAU,EAAU,EAAE;IAC9C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,IAAA,iCAAyB,EAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IAClC,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;SAAM,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAC1B,OAAO,MAAM,CAAC;IAChB,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;aAC7B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,gB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