@jsonforms/core 3.1.0-alpha.0 → 3.1.0-alpha.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/README.md +3 -3
- package/lib/Helpers.d.ts +1 -1
- package/lib/actions/actions.d.ts +27 -26
- package/lib/generators/Generate.d.ts +1 -1
- package/lib/generators/schema.d.ts +1 -1
- package/lib/i18n/arrayTranslations.d.ts +24 -0
- package/lib/i18n/i18nTypes.d.ts +3 -2
- package/lib/i18n/i18nUtil.d.ts +5 -2
- package/lib/i18n/index.d.ts +1 -0
- package/lib/jsonforms-core.cjs.js +428 -259
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +313 -200
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/models/jsonSchema.d.ts +2 -2
- package/lib/models/uischema.d.ts +1 -1
- package/lib/reducers/cells.d.ts +2 -2
- package/lib/reducers/config.d.ts +1 -1
- package/lib/reducers/core.d.ts +3 -2
- package/lib/reducers/default-data.d.ts +1 -1
- package/lib/reducers/i18n.d.ts +1 -1
- package/lib/reducers/reducers.d.ts +4 -4
- package/lib/reducers/renderers.d.ts +2 -2
- package/lib/reducers/selectors.d.ts +6 -6
- package/lib/reducers/uischemas.d.ts +2 -2
- package/lib/store.d.ts +3 -3
- package/lib/testers/testers.d.ts +1 -1
- package/lib/util/cell.d.ts +3 -4
- package/lib/util/combinators.d.ts +1 -1
- package/lib/util/label.d.ts +1 -1
- package/lib/util/path.d.ts +6 -3
- package/lib/util/renderer.d.ts +11 -7
- package/lib/util/resolvers.d.ts +1 -1
- package/lib/util/runtime.d.ts +2 -2
- package/lib/util/util.d.ts +2 -2
- package/lib/util/validator.d.ts +1 -1
- package/package.json +16 -5
- package/src/Helpers.ts +2 -2
- package/src/actions/actions.ts +59 -61
- package/src/configDefault.ts +1 -1
- package/src/generators/Generate.ts +4 -2
- package/src/generators/schema.ts +30 -26
- package/src/generators/uischema.ts +7 -6
- package/src/i18n/arrayTranslations.ts +54 -0
- package/src/i18n/i18nTypes.ts +12 -7
- package/src/i18n/i18nUtil.ts +66 -16
- package/src/i18n/index.ts +1 -0
- package/src/models/draft4.ts +33 -33
- package/src/models/jsonSchema.ts +2 -2
- package/src/models/uischema.ts +18 -7
- package/src/reducers/cells.ts +10 -9
- package/src/reducers/config.ts +1 -1
- package/src/reducers/core.ts +115 -75
- package/src/reducers/default-data.ts +8 -8
- package/src/reducers/i18n.ts +22 -10
- package/src/reducers/reducers.ts +24 -34
- package/src/reducers/renderers.ts +9 -9
- package/src/reducers/selectors.ts +10 -11
- package/src/reducers/uischemas.ts +27 -26
- package/src/store.ts +4 -4
- package/src/testers/testers.ts +200 -147
- package/src/util/cell.ts +27 -29
- package/src/util/combinators.ts +6 -4
- package/src/util/label.ts +2 -2
- package/src/util/path.ts +15 -8
- package/src/util/renderer.ts +123 -72
- package/src/util/resolvers.ts +16 -14
- package/src/util/runtime.ts +4 -4
- package/src/util/schema.ts +1 -1
- package/src/util/type.ts +5 -3
- package/src/util/uischema.ts +9 -9
- package/src/util/util.ts +54 -54
- package/src/util/validator.ts +2 -2
- package/.nycrc +0 -6
- package/docs/assets/css/main.css +0 -1
- package/docs/assets/images/icons.png +0 -0
- package/docs/assets/images/icons@2x.png +0 -0
- package/docs/assets/images/widgets.png +0 -0
- package/docs/assets/images/widgets@2x.png +0 -0
- package/docs/assets/js/main.js +0 -51
- package/docs/assets/js/search.json +0 -1
- package/docs/classes/gen.html +0 -406
- package/docs/enums/ruleeffect.html +0 -214
- package/docs/globals.html +0 -10568
- package/docs/index.html +0 -1297
- package/docs/interfaces/action.html +0 -166
- package/docs/interfaces/addcellrendereraction.html +0 -181
- package/docs/interfaces/addrendereraction.html +0 -181
- package/docs/interfaces/adduischemaaction.html +0 -181
- package/docs/interfaces/andcondition.html +0 -181
- package/docs/interfaces/anyaction.html +0 -189
- package/docs/interfaces/arraycontrolprops.html +0 -653
- package/docs/interfaces/arraylayoutprops.html +0 -648
- package/docs/interfaces/categorization.html +0 -281
- package/docs/interfaces/category.html +0 -279
- package/docs/interfaces/cellprops.html +0 -452
- package/docs/interfaces/combinatorrendererprops.html +0 -503
- package/docs/interfaces/combinatorsubschemarenderinfo.html +0 -181
- package/docs/interfaces/composablecondition.html +0 -193
- package/docs/interfaces/condition.html +0 -176
- package/docs/interfaces/controlelement.html +0 -280
- package/docs/interfaces/controlprops.html +0 -497
- package/docs/interfaces/controlstate.html +0 -184
- package/docs/interfaces/controlwithdetailprops.html +0 -501
- package/docs/interfaces/dispatchcellprops.html +0 -388
- package/docs/interfaces/dispatchcellstateprops.html +0 -408
- package/docs/interfaces/dispatchpropsofarraycontrol.html +0 -322
- package/docs/interfaces/dispatchpropsofcontrol.html +0 -204
- package/docs/interfaces/dispatchpropsofmultienumcontrol.html +0 -215
- package/docs/interfaces/enumcellprops.html +0 -467
- package/docs/interfaces/enumoption.html +0 -167
- package/docs/interfaces/formatted.html +0 -226
- package/docs/interfaces/grouplayout.html +0 -284
- package/docs/interfaces/horizontallayout.html +0 -234
- package/docs/interfaces/initaction.html +0 -209
- package/docs/interfaces/initactionoptions.html +0 -181
- package/docs/interfaces/internationalizable.html +0 -170
- package/docs/interfaces/jsonformscellrendererregistryentry.html +0 -167
- package/docs/interfaces/jsonformscore.html +0 -251
- package/docs/interfaces/jsonformsdefaultdataregistryentry.html +0 -167
- package/docs/interfaces/jsonformsextendedstate.html +0 -175
- package/docs/interfaces/jsonformsi18nstate.html +0 -181
- package/docs/interfaces/jsonformsprops.html +0 -321
- package/docs/interfaces/jsonformsrendererregistryentry.html +0 -167
- package/docs/interfaces/jsonformsstate.html +0 -170
- package/docs/interfaces/jsonformsstore.html +0 -376
- package/docs/interfaces/jsonformssubstates.html +0 -276
- package/docs/interfaces/jsonformsuischemaregistryentry.html +0 -167
- package/docs/interfaces/jsonschema4.html +0 -758
- package/docs/interfaces/jsonschema7.html +0 -884
- package/docs/interfaces/labelable.html +0 -184
- package/docs/interfaces/labeldescription.html +0 -184
- package/docs/interfaces/labeled.html +0 -182
- package/docs/interfaces/labelelement.html +0 -251
- package/docs/interfaces/labelprops.html +0 -339
- package/docs/interfaces/layout.html +0 -253
- package/docs/interfaces/layoutprops.html +0 -359
- package/docs/interfaces/leafcondition.html +0 -209
- package/docs/interfaces/orcondition.html +0 -181
- package/docs/interfaces/ownpropsofcell.html +0 -321
- package/docs/interfaces/ownpropsofcontrol.html +0 -305
- package/docs/interfaces/ownpropsofenum.html +0 -161
- package/docs/interfaces/ownpropsofenumcell.html +0 -335
- package/docs/interfaces/ownpropsofjsonformsrenderer.html +0 -296
- package/docs/interfaces/ownpropsoflabel.html +0 -286
- package/docs/interfaces/ownpropsoflayout.html +0 -305
- package/docs/interfaces/ownpropsofmasterlistitem.html +0 -289
- package/docs/interfaces/ownpropsofrenderer.html +0 -292
- package/docs/interfaces/referenceschemamap.html +0 -138
- package/docs/interfaces/registerdefaultdataaction.html +0 -181
- package/docs/interfaces/removecellrendereraction.html +0 -181
- package/docs/interfaces/removerendereraction.html +0 -181
- package/docs/interfaces/removeuischemaaction.html +0 -167
- package/docs/interfaces/rendererprops.html +0 -331
- package/docs/interfaces/rule.html +0 -185
- package/docs/interfaces/schemabasedcondition.html +0 -202
- package/docs/interfaces/scopable.html +0 -171
- package/docs/interfaces/scoped.html +0 -183
- package/docs/interfaces/setajvaction.html +0 -167
- package/docs/interfaces/setconfigaction.html +0 -167
- package/docs/interfaces/setlocaleaction.html +0 -167
- package/docs/interfaces/setschemaaction.html +0 -167
- package/docs/interfaces/settranslatoraction.html +0 -181
- package/docs/interfaces/setuischemaaction.html +0 -167
- package/docs/interfaces/setvalidationmodeaction.html +0 -167
- package/docs/interfaces/statepropsofarraycontrol.html +0 -474
- package/docs/interfaces/statepropsofarraylayout.html +0 -461
- package/docs/interfaces/statepropsofcell.html +0 -408
- package/docs/interfaces/statepropsofcombinator.html +0 -449
- package/docs/interfaces/statepropsofcontrol.html +0 -451
- package/docs/interfaces/statepropsofcontrolwithdetail.html +0 -463
- package/docs/interfaces/statepropsofenumcell.html +0 -422
- package/docs/interfaces/statepropsofjsonformsrenderer.html +0 -324
- package/docs/interfaces/statepropsoflabel.html +0 -343
- package/docs/interfaces/statepropsoflayout.html +0 -369
- package/docs/interfaces/statepropsofmasteritem.html +0 -309
- package/docs/interfaces/statepropsofrenderer.html +0 -331
- package/docs/interfaces/statepropsofscopedrenderer.html +0 -391
- package/docs/interfaces/store.html +0 -386
- package/docs/interfaces/testercontext.html +0 -184
- package/docs/interfaces/uischemaelement.html +0 -225
- package/docs/interfaces/unregisterdefaultdataaction.html +0 -167
- package/docs/interfaces/updateaction.html +0 -202
- package/docs/interfaces/updatecoreaction.html +0 -209
- package/docs/interfaces/updateerrorsaction.html +0 -167
- package/docs/interfaces/updatei18naction.html +0 -195
- package/docs/interfaces/verticallayout.html +0 -234
- package/docs/interfaces/withclassname.html +0 -153
- package/rollup.config.js +0 -44
- package/stats.html +0 -3279
- package/test/actions/actions.test.ts +0 -93
- package/test/generators/schema.test.ts +0 -224
- package/test/generators/uischema.test.ts +0 -576
- package/test/i18n/i18nUtil.test.ts +0 -88
- package/test/reducers/core.test.ts +0 -1682
- package/test/reducers/uischemas.test.ts +0 -173
- package/test/testers.test.ts +0 -948
- package/test/util/array.test.ts +0 -28
- package/test/util/cell.test.ts +0 -354
- package/test/util/derivetype.test.ts +0 -101
- package/test/util/label.test.ts +0 -364
- package/test/util/path.test.ts +0 -259
- package/test/util/renderer.test.ts +0 -1830
- package/test/util/resolvers.test.ts +0 -157
- package/test/util/runtime.test.ts +0 -779
- package/tsconfig.json +0 -13
package/src/util/cell.ts
CHANGED
|
@@ -24,9 +24,8 @@
|
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
import isEmpty from 'lodash/isEmpty';
|
|
27
|
-
import union from 'lodash/union';
|
|
28
|
-
import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
|
|
29
27
|
import {
|
|
28
|
+
getErrorTranslator,
|
|
30
29
|
getAjv,
|
|
31
30
|
getConfig,
|
|
32
31
|
getData,
|
|
@@ -34,15 +33,10 @@ import {
|
|
|
34
33
|
getSchema,
|
|
35
34
|
getTranslator,
|
|
36
35
|
} from '../reducers';
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
} from './util';
|
|
42
|
-
import {
|
|
43
|
-
isInherentlyEnabled,
|
|
44
|
-
isVisible,
|
|
45
|
-
} from './runtime';
|
|
36
|
+
import type { JsonFormsCellRendererRegistryEntry } from '../reducers';
|
|
37
|
+
import type { AnyAction, Dispatch } from './type';
|
|
38
|
+
import { Resolve } from './util';
|
|
39
|
+
import { isInherentlyEnabled, isVisible } from './runtime';
|
|
46
40
|
import {
|
|
47
41
|
DispatchPropsOfControl,
|
|
48
42
|
EnumOption,
|
|
@@ -53,11 +47,9 @@ import {
|
|
|
53
47
|
OwnPropsOfEnum,
|
|
54
48
|
StatePropsOfScopedRenderer,
|
|
55
49
|
} from './renderer';
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
|
|
60
|
-
export type { JsonFormsCellRendererRegistryEntry };
|
|
50
|
+
import { getCombinedErrorMessage, getI18nKeyPrefix } from '../i18n';
|
|
51
|
+
import type { JsonFormsState } from '../store';
|
|
52
|
+
import type { JsonSchema } from '../models';
|
|
61
53
|
|
|
62
54
|
export interface OwnPropsOfCell extends OwnPropsOfControl {
|
|
63
55
|
data?: any;
|
|
@@ -126,7 +118,7 @@ export const mapStateToCellProps = (
|
|
|
126
118
|
|
|
127
119
|
/* When determining the enabled state of cells we take a shortcut: At the
|
|
128
120
|
* moment it's only possible to configure enablement and disablement at the
|
|
129
|
-
* control level. Therefore the renderer using the cell, for example a
|
|
121
|
+
* control level. Therefore the renderer using the cell, for example a
|
|
130
122
|
* table renderer, determines whether a cell is enabled and should hand
|
|
131
123
|
* over the prop themselves. If that prop was given, we prefer it over
|
|
132
124
|
* anything else to save evaluation effort (except for the global readonly
|
|
@@ -148,8 +140,15 @@ export const mapStateToCellProps = (
|
|
|
148
140
|
);
|
|
149
141
|
}
|
|
150
142
|
|
|
151
|
-
const
|
|
152
|
-
|
|
143
|
+
const t = getTranslator()(state);
|
|
144
|
+
const te = getErrorTranslator()(state);
|
|
145
|
+
const errors = getCombinedErrorMessage(
|
|
146
|
+
getErrorAt(path, schema)(state),
|
|
147
|
+
te,
|
|
148
|
+
t,
|
|
149
|
+
schema,
|
|
150
|
+
uischema,
|
|
151
|
+
path
|
|
153
152
|
);
|
|
154
153
|
const isValid = isEmpty(errors);
|
|
155
154
|
|
|
@@ -166,7 +165,7 @@ export const mapStateToCellProps = (
|
|
|
166
165
|
config: getConfig(state),
|
|
167
166
|
rootSchema,
|
|
168
167
|
renderers,
|
|
169
|
-
cells
|
|
168
|
+
cells,
|
|
170
169
|
};
|
|
171
170
|
};
|
|
172
171
|
|
|
@@ -175,11 +174,11 @@ export const mapStateToDispatchCellProps = (
|
|
|
175
174
|
ownProps: OwnPropsOfCell
|
|
176
175
|
): DispatchCellStateProps => {
|
|
177
176
|
const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);
|
|
178
|
-
const { renderers, cells, ...otherOwnProps } = ownProps;
|
|
177
|
+
const { renderers: _renderers, cells, ...otherOwnProps } = ownProps;
|
|
179
178
|
return {
|
|
180
179
|
...props,
|
|
181
180
|
...otherOwnProps,
|
|
182
|
-
cells: cells || state.jsonforms.cells || []
|
|
181
|
+
cells: cells || state.jsonforms.cells || [],
|
|
183
182
|
};
|
|
184
183
|
};
|
|
185
184
|
|
|
@@ -198,7 +197,7 @@ export const defaultMapStateToEnumCellProps = (
|
|
|
198
197
|
const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);
|
|
199
198
|
const options: EnumOption[] =
|
|
200
199
|
ownProps.options ||
|
|
201
|
-
props.schema.enum?.map(e =>
|
|
200
|
+
props.schema.enum?.map((e) =>
|
|
202
201
|
enumToEnumOptionMapper(
|
|
203
202
|
e,
|
|
204
203
|
getTranslator()(state),
|
|
@@ -210,11 +209,11 @@ export const defaultMapStateToEnumCellProps = (
|
|
|
210
209
|
props.schema.const,
|
|
211
210
|
getTranslator()(state),
|
|
212
211
|
getI18nKeyPrefix(props.schema, props.uischema, props.path)
|
|
213
|
-
)
|
|
212
|
+
),
|
|
214
213
|
]);
|
|
215
214
|
return {
|
|
216
215
|
...props,
|
|
217
|
-
options
|
|
216
|
+
options,
|
|
218
217
|
};
|
|
219
218
|
};
|
|
220
219
|
|
|
@@ -231,7 +230,7 @@ export const mapStateToOneOfEnumCellProps = (
|
|
|
231
230
|
const props: StatePropsOfCell = mapStateToCellProps(state, ownProps);
|
|
232
231
|
const options: EnumOption[] =
|
|
233
232
|
ownProps.options ||
|
|
234
|
-
(props.schema.oneOf as JsonSchema[])?.map(oneOfSubSchema =>
|
|
233
|
+
(props.schema.oneOf as JsonSchema[])?.map((oneOfSubSchema) =>
|
|
235
234
|
oneOfToEnumOptionMapper(
|
|
236
235
|
oneOfSubSchema,
|
|
237
236
|
getTranslator()(state),
|
|
@@ -240,11 +239,10 @@ export const mapStateToOneOfEnumCellProps = (
|
|
|
240
239
|
);
|
|
241
240
|
return {
|
|
242
241
|
...props,
|
|
243
|
-
options
|
|
242
|
+
options,
|
|
244
243
|
};
|
|
245
244
|
};
|
|
246
245
|
|
|
247
|
-
|
|
248
246
|
/**
|
|
249
247
|
* Synonym for mapDispatchToControlProps.
|
|
250
248
|
*
|
|
@@ -264,6 +262,6 @@ export const defaultMapDispatchToControlProps =
|
|
|
264
262
|
const { handleChange } = mapDispatchToCellProps(dispatch);
|
|
265
263
|
|
|
266
264
|
return {
|
|
267
|
-
handleChange: ownProps.handleChange || handleChange
|
|
265
|
+
handleChange: ownProps.handleChange || handleChange,
|
|
268
266
|
};
|
|
269
267
|
};
|
package/src/util/combinators.ts
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
THE SOFTWARE.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
26
|
+
import type { ControlElement, JsonSchema, UISchemaElement } from '../models';
|
|
27
27
|
import { findUISchema, JsonFormsUISchemaRegistryEntry } from '../reducers';
|
|
28
28
|
import { Resolve } from './util';
|
|
29
29
|
|
|
@@ -56,7 +56,9 @@ export const createCombinatorRenderInfos = (
|
|
|
56
56
|
uischemas: JsonFormsUISchemaRegistryEntry[]
|
|
57
57
|
): CombinatorSubSchemaRenderInfo[] =>
|
|
58
58
|
combinatorSubSchemas.map((subSchema, subSchemaIndex) => {
|
|
59
|
-
const schema = subSchema.$ref
|
|
59
|
+
const schema = subSchema.$ref
|
|
60
|
+
? Resolve.schema(rootSchema, subSchema.$ref, rootSchema)
|
|
61
|
+
: subSchema;
|
|
60
62
|
return {
|
|
61
63
|
schema,
|
|
62
64
|
uischema: findUISchema(
|
|
@@ -68,6 +70,6 @@ export const createCombinatorRenderInfos = (
|
|
|
68
70
|
control,
|
|
69
71
|
rootSchema
|
|
70
72
|
),
|
|
71
|
-
label: createLabel(subSchema, subSchemaIndex, keyword)
|
|
72
|
-
}
|
|
73
|
+
label: createLabel(subSchema, subSchemaIndex, keyword),
|
|
74
|
+
};
|
|
73
75
|
});
|
package/src/util/label.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
|
|
26
26
|
import startCase from 'lodash/startCase';
|
|
27
27
|
|
|
28
|
-
import { ControlElement, JsonSchema, LabelDescription } from '../models';
|
|
28
|
+
import type { ControlElement, JsonSchema, LabelDescription } from '../models';
|
|
29
29
|
import { decode } from './path';
|
|
30
30
|
|
|
31
31
|
const deriveLabel = (
|
|
@@ -79,5 +79,5 @@ export const createLabelDescriptionFrom = (
|
|
|
79
79
|
|
|
80
80
|
const labelDescription = (text: string, show: boolean): LabelDescription => ({
|
|
81
81
|
text: text,
|
|
82
|
-
show: show
|
|
82
|
+
show: show,
|
|
83
83
|
});
|
package/src/util/path.ts
CHANGED
|
@@ -65,20 +65,25 @@ export const toDataPathSegments = (schemaPath: string): string[] => {
|
|
|
65
65
|
|
|
66
66
|
const startFromRoot = decodedSegments[0] === '#' || decodedSegments[0] === '';
|
|
67
67
|
const startIndex = startFromRoot ? 2 : 1;
|
|
68
|
-
return range(startIndex, decodedSegments.length, 2).map(
|
|
68
|
+
return range(startIndex, decodedSegments.length, 2).map(
|
|
69
|
+
(idx) => decodedSegments[idx]
|
|
70
|
+
);
|
|
69
71
|
};
|
|
70
72
|
|
|
71
73
|
/**
|
|
72
|
-
*
|
|
74
|
+
* Convert a schema path (i.e. JSON pointer) to a data path.
|
|
75
|
+
*
|
|
76
|
+
* Data paths can be used in field change event handlers like handleChange.
|
|
77
|
+
*
|
|
73
78
|
* @example
|
|
74
|
-
* toDataPath('#/properties/foo/properties/bar') === '
|
|
79
|
+
* toDataPath('#/properties/foo/properties/bar') === 'foo.bar')
|
|
75
80
|
*
|
|
76
81
|
* @param {string} schemaPath the schema path to be converted
|
|
77
|
-
* @returns {string} the path
|
|
82
|
+
* @returns {string} the data path
|
|
78
83
|
*/
|
|
79
84
|
export const toDataPath = (schemaPath: string): string => {
|
|
80
85
|
return toDataPathSegments(schemaPath).join('.');
|
|
81
|
-
|
|
86
|
+
};
|
|
82
87
|
|
|
83
88
|
export const composeWithUi = (scopableUi: Scopable, path: string): string => {
|
|
84
89
|
if (!isScoped(scopableUi)) {
|
|
@@ -96,11 +101,13 @@ export const composeWithUi = (scopableUi: Scopable, path: string): string => {
|
|
|
96
101
|
|
|
97
102
|
/**
|
|
98
103
|
* Encodes the given segment to be used as part of a JSON Pointer
|
|
99
|
-
*
|
|
104
|
+
*
|
|
100
105
|
* JSON Pointer has special meaning for "/" and "~", therefore these must be encoded
|
|
101
106
|
*/
|
|
102
|
-
export const encode = (segment: string) =>
|
|
107
|
+
export const encode = (segment: string) =>
|
|
108
|
+
segment?.replace(/~/g, '~0').replace(/\//g, '~1');
|
|
103
109
|
/**
|
|
104
110
|
* Decodes a given JSON Pointer segment to its "normal" representation
|
|
105
111
|
*/
|
|
106
|
-
export const decode = (pointerSegment: string) =>
|
|
112
|
+
export const decode = (pointerSegment: string) =>
|
|
113
|
+
pointerSegment?.replace(/~1/g, '/').replace(/~0/, '~');
|