@kaspernj/api-maker 1.0.364 → 1.0.366
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 +2 -2
- package/src/table/table.jsx +1 -0
- package/src/url-encode.mjs +6 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaspernj/api-maker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.366",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint-find-rules": "^4.0.0",
|
|
51
51
|
"eslint-plugin-jest": "^28.2.0",
|
|
52
52
|
"eslint-plugin-react": "^7.23.2",
|
|
53
|
-
"i18n-on-steroids": "^1.0.
|
|
53
|
+
"i18n-on-steroids": "^1.0.15",
|
|
54
54
|
"jest": "^29.0.1",
|
|
55
55
|
"jsdom": "^24.0.0"
|
|
56
56
|
}
|
package/src/table/table.jsx
CHANGED
|
@@ -129,6 +129,7 @@ export default memo(shapeComponent(class ApiMakerTable extends ShapeComponent {
|
|
|
129
129
|
abilities: this.abilitiesToLoad(),
|
|
130
130
|
defaultParams: this.props.defaultParams,
|
|
131
131
|
collection: this.props.collection,
|
|
132
|
+
groupBy: this.props.groupBy,
|
|
132
133
|
ifCondition: collectionReady,
|
|
133
134
|
modelClass: this.props.modelClass,
|
|
134
135
|
onModelsLoaded: this.props.onModelsLoaded,
|
package/src/url-encode.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
+
import escapeStringRegexp from "escape-string-regexp"
|
|
2
|
+
|
|
1
3
|
const replaces = {
|
|
2
4
|
" ": "+",
|
|
3
5
|
"&": "%26",
|
|
4
6
|
"#": "%23",
|
|
7
|
+
"+": "%2B",
|
|
5
8
|
"/": "%2F",
|
|
6
9
|
"?": "%3F"
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
const
|
|
10
|
-
return `${string}`.replaceAll(/( |&|#|\/|\?)/g, (character) => {
|
|
11
|
-
if (!(character in replaces)) {
|
|
12
|
-
throw new Error(`Didn't exist in replaces: "${character}"`)
|
|
13
|
-
}
|
|
12
|
+
const regexp = new RegExp(`(${Object.keys(replaces).map(escapeStringRegexp).join("|")})`, "g")
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const urlEncode = (string) => {
|
|
15
|
+
return String(string).replaceAll(regexp, (character) => replaces[character])
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export default urlEncode
|