@lowdefy/operators-change-case 4.0.0-rc.0 → 4.0.0-rc.10
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Copyright 2020-
|
|
2
|
+
Copyright 2020-2023 Lowdefy, Inc
|
|
3
3
|
|
|
4
4
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
you may not use this file except in compliance with the License.
|
|
@@ -41,7 +41,7 @@ const prepRegex = (prop, location)=>{
|
|
|
41
41
|
throw new Error(`Operator Error: ${e.message}. Received: ${JSON.stringify(prop)} at ${location}.`);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
const prep = (args, { location
|
|
44
|
+
const prep = (args, { location })=>{
|
|
45
45
|
const options = args[1];
|
|
46
46
|
if (!type.isNone(options) && !type.isObject(options)) {
|
|
47
47
|
throw new Error(`Operator Error: options must be an object. Received ${JSON.stringify(options)} at ${location}.`);
|
|
@@ -56,7 +56,7 @@ const prep = (args, { location })=>{
|
|
|
56
56
|
}
|
|
57
57
|
return args;
|
|
58
58
|
};
|
|
59
|
-
const convertArray = ({ methodName
|
|
59
|
+
const convertArray = ({ methodName, on, options })=>{
|
|
60
60
|
return on.map((item)=>{
|
|
61
61
|
if (type.isString(item)) {
|
|
62
62
|
return changeCase[methodName](item, options);
|
|
@@ -64,7 +64,7 @@ const convertArray = ({ methodName , on , options })=>{
|
|
|
64
64
|
return item;
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
const convertObject = ({ methodName
|
|
67
|
+
const convertObject = ({ methodName, on, options })=>{
|
|
68
68
|
const result = {};
|
|
69
69
|
const keyConverter = get(options, 'convertKeys') ? (key)=>changeCase[methodName](key, options) : (key)=>key;
|
|
70
70
|
const valueConverter = get(options, 'convertValues', {
|
|
@@ -79,7 +79,7 @@ const convertObject = ({ methodName , on , options })=>{
|
|
|
79
79
|
});
|
|
80
80
|
return result;
|
|
81
81
|
};
|
|
82
|
-
const makeCaseChanger = ({ methodName
|
|
82
|
+
const makeCaseChanger = ({ methodName })=>(on, options = {})=>{
|
|
83
83
|
if (type.isString(on)) {
|
|
84
84
|
return changeCase[methodName](on, options);
|
|
85
85
|
}
|
|
@@ -117,7 +117,7 @@ Object.keys(changeCase).forEach((methodName)=>{
|
|
|
117
117
|
prep
|
|
118
118
|
};
|
|
119
119
|
});
|
|
120
|
-
function change_case({ params
|
|
120
|
+
function change_case({ params, location, methodName }) {
|
|
121
121
|
return runClass({
|
|
122
122
|
functions,
|
|
123
123
|
location,
|
package/dist/operatorsClient.js
CHANGED
package/dist/operatorsServer.js
CHANGED
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/operators-change-case",
|
|
3
|
-
"version": "4.0.0-rc.
|
|
3
|
+
"version": "4.0.0-rc.10",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -39,22 +39,22 @@
|
|
|
39
39
|
"build": "swc src --out-dir dist --config-file ../../../../.swcrc --delete-dir-on-start --copy-files",
|
|
40
40
|
"clean": "rm -rf dist",
|
|
41
41
|
"prepublishOnly": "pnpm build",
|
|
42
|
-
"test": "
|
|
42
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@lowdefy/helpers": "4.0.0-rc.
|
|
46
|
-
"@lowdefy/operators": "4.0.0-rc.
|
|
45
|
+
"@lowdefy/helpers": "4.0.0-rc.10",
|
|
46
|
+
"@lowdefy/operators": "4.0.0-rc.10",
|
|
47
47
|
"change-case": "4.1.2"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@swc/cli": "0.1.
|
|
51
|
-
"@swc/core": "1.
|
|
52
|
-
"@swc/jest": "0.2.
|
|
53
|
-
"jest": "28.1.
|
|
54
|
-
"jest-environment-jsdom": "28.1.
|
|
50
|
+
"@swc/cli": "0.1.62",
|
|
51
|
+
"@swc/core": "1.3.70",
|
|
52
|
+
"@swc/jest": "0.2.27",
|
|
53
|
+
"jest": "28.1.3",
|
|
54
|
+
"jest-environment-jsdom": "28.1.3"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "537af074f27770e32da9da8d48490f2eda94b406"
|
|
60
60
|
}
|