getta 1.0.5 → 1.0.6
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/dist/cjs/index.cjs +1 -664
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +1 -620
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +82 -0
- package/dist/types/cjs/helpers/defaultPathTemplateCallback/index.d.cts +1 -1
- package/dist/types/cjs/helpers/defaultPathTemplateCallback/index.d.cts.map +1 -1
- package/dist/types/esm/helpers/defaultPathTemplateCallback/index.d.ts +1 -1
- package/dist/types/esm/helpers/defaultPathTemplateCallback/index.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +35 -35
- package/src/helpers/defaultPathTemplateCallback/index.test.ts +6 -0
- package/src/helpers/defaultPathTemplateCallback/index.ts +3 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "getta",
|
|
3
3
|
"description": "An isomorphic rest client based on the Fetch API.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.6",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/getta",
|
|
@@ -35,25 +35,25 @@
|
|
|
35
35
|
"lodash-es": "<5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@babel/cli": "^7.
|
|
39
|
-
"@babel/core": "^7.
|
|
40
|
-
"@babel/eslint-parser": "^7.
|
|
38
|
+
"@babel/cli": "^7.23.0",
|
|
39
|
+
"@babel/core": "^7.23.2",
|
|
40
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
41
41
|
"@babel/plugin-proposal-decorators": "^7.23.3",
|
|
42
|
-
"@babel/plugin-syntax-import-assertions": "^7.
|
|
42
|
+
"@babel/plugin-syntax-import-assertions": "^7.22.5",
|
|
43
43
|
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
44
44
|
"@babel/plugin-transform-export-namespace-from": "^7.23.4",
|
|
45
45
|
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
46
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
47
|
-
"@babel/preset-env": "^7.
|
|
48
|
-
"@babel/preset-react": "^7.
|
|
49
|
-
"@babel/preset-typescript": "^7.
|
|
50
|
-
"@babel/runtime": "^7.
|
|
46
|
+
"@babel/plugin-transform-runtime": "^7.23.2",
|
|
47
|
+
"@babel/preset-env": "^7.23.2",
|
|
48
|
+
"@babel/preset-react": "^7.22.15",
|
|
49
|
+
"@babel/preset-typescript": "^7.23.2",
|
|
50
|
+
"@babel/runtime": "^7.23.2",
|
|
51
51
|
"@cachemap/core": "^5.0.8",
|
|
52
52
|
"@cachemap/map": "^5.0.6",
|
|
53
|
-
"@commitlint/cli": "^17.
|
|
54
|
-
"@commitlint/config-conventional": "^17.
|
|
55
|
-
"@commitlint/prompt-cli": "^17.
|
|
56
|
-
"@jest/globals": "^29.
|
|
53
|
+
"@commitlint/cli": "^17.7.2",
|
|
54
|
+
"@commitlint/config-conventional": "^17.7.0",
|
|
55
|
+
"@commitlint/prompt-cli": "^17.7.2",
|
|
56
|
+
"@jest/globals": "^29.7.0",
|
|
57
57
|
"@repodog/babel-config": "^1.1.11",
|
|
58
58
|
"@repodog/cli": "^1.4.1",
|
|
59
59
|
"@repodog/commitlint-config": "^1.1.6",
|
|
@@ -65,31 +65,31 @@
|
|
|
65
65
|
"@repodog/rollup-config": "^1.1.8",
|
|
66
66
|
"@repodog/syncpack-config": "^1.2.3",
|
|
67
67
|
"@repodog/ts-config": "^1.3.0",
|
|
68
|
-
"@rollup/plugin-babel": "^6.0.
|
|
68
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
69
69
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
70
|
-
"@rollup/plugin-image": "^3.0.
|
|
71
|
-
"@rollup/plugin-json": "^6.0.
|
|
72
|
-
"@rollup/plugin-node-resolve": "^15.
|
|
73
|
-
"@rollup/plugin-terser": "^0.4.
|
|
74
|
-
"@types/jest": "^25.
|
|
70
|
+
"@rollup/plugin-image": "^3.0.3",
|
|
71
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
73
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
74
|
+
"@types/jest": "^25.2.3",
|
|
75
75
|
"@types/lodash-es": "^4.17.9",
|
|
76
76
|
"@types/node": "^20.11.0",
|
|
77
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
78
|
-
"@typescript-eslint/parser": "^5.
|
|
79
|
-
"babel-jest": "^29.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
78
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
79
|
+
"babel-jest": "^29.7.0",
|
|
80
80
|
"babel-plugin-codegen": "^4.1.5",
|
|
81
81
|
"babel-plugin-macros": "^3.1.0",
|
|
82
|
-
"core-js": "^3.
|
|
82
|
+
"core-js": "^3.33.0",
|
|
83
83
|
"cts-types": "^0.0.6",
|
|
84
84
|
"del-cli": "^5.1.0",
|
|
85
|
-
"eslint": "^8.
|
|
86
|
-
"eslint-config-prettier": "^8.
|
|
87
|
-
"eslint-import-resolver-typescript": "^3.
|
|
88
|
-
"eslint-plugin-import": "^2.
|
|
89
|
-
"eslint-plugin-jest": "^27.2
|
|
85
|
+
"eslint": "^8.51.0",
|
|
86
|
+
"eslint-config-prettier": "^8.10.0",
|
|
87
|
+
"eslint-import-resolver-typescript": "^3.6.1",
|
|
88
|
+
"eslint-plugin-import": "^2.28.1",
|
|
89
|
+
"eslint-plugin-jest": "^27.4.2",
|
|
90
90
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
91
91
|
"eslint-plugin-prettier": "^4.2.1",
|
|
92
|
-
"eslint-plugin-sort-class-members": "^1.
|
|
92
|
+
"eslint-plugin-sort-class-members": "^1.19.0",
|
|
93
93
|
"eslint-plugin-sort-destructure-keys": "^1.5.0",
|
|
94
94
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
95
95
|
"eslint-plugin-typescript-sort-keys": "^2.3.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"generate-changelog": "^1.8.0",
|
|
99
99
|
"husky": "^8.0.3",
|
|
100
100
|
"identity-obj-proxy": "^3.0.0",
|
|
101
|
-
"jest": "^29.
|
|
101
|
+
"jest": "^29.7.0",
|
|
102
102
|
"jest-environment-jsdom": "^29.7.0",
|
|
103
103
|
"jest-environment-node": "^29.7.0",
|
|
104
104
|
"jest-mock": "^29.7.0",
|
|
@@ -106,14 +106,14 @@
|
|
|
106
106
|
"markdownlint-cli": "^0.34.0",
|
|
107
107
|
"node-fetch": "^3.3.2",
|
|
108
108
|
"prettier": "^2.8.8",
|
|
109
|
-
"rollup": "^3.
|
|
109
|
+
"rollup": "^3.29.4",
|
|
110
110
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
111
|
-
"rollup-plugin-copy": "^3.
|
|
111
|
+
"rollup-plugin-copy": "^3.5.0",
|
|
112
112
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
113
113
|
"suppress-experimental-warnings": "^1.1.17",
|
|
114
114
|
"syncpack": "^12.3.0",
|
|
115
|
-
"type-fest": "^3.
|
|
116
|
-
"typescript": "^5.
|
|
115
|
+
"type-fest": "^3.13.1",
|
|
116
|
+
"typescript": "^5.2.2",
|
|
117
117
|
"zod": "^3.22.4"
|
|
118
118
|
},
|
|
119
119
|
"keywords": [
|
|
@@ -8,4 +8,10 @@ describe('defaultPathTemplateCallback', () => {
|
|
|
8
8
|
'/direct/rest/content/catalog/product/136-7317?format=standard'
|
|
9
9
|
);
|
|
10
10
|
});
|
|
11
|
+
|
|
12
|
+
it('SHOULD populate the path template correctly when the data value is a zero', () => {
|
|
13
|
+
expect(
|
|
14
|
+
defaultPathTemplateCallback(defaultPath, { ...defaultPathTemplateData, 'id,+': 0 }, DEFAULT_PATH_TEMPLATE_REGEX)
|
|
15
|
+
).toBe('/direct/rest/content/catalog/product/0?format=standard');
|
|
16
|
+
});
|
|
11
17
|
});
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export const defaultPathTemplateCallback = (
|
|
2
2
|
pathTemplate: string,
|
|
3
|
-
data: Record<string, string>,
|
|
3
|
+
data: Record<string, string | number | boolean>,
|
|
4
4
|
pathTemplateRegExp: RegExp
|
|
5
5
|
) => {
|
|
6
6
|
const dataKeys = Object.keys(data);
|
|
7
7
|
|
|
8
8
|
return pathTemplate.replace(pathTemplateRegExp, match => {
|
|
9
9
|
for (const key of dataKeys) {
|
|
10
|
-
if (match.includes(key) && data[key]) {
|
|
11
|
-
return data[key]
|
|
10
|
+
if (match.includes(key) && data[key] !== undefined) {
|
|
11
|
+
return String(data[key]);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|