File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 9
9
- Support test environment in EARL output.
10
10
- Support benchmark output in EARL output.
11
11
- Benchmark comparison tool.
12
+ - Add "safe mode" to all APIs. Enable by adding ` {safe: true} ` to API options.
13
+ This mode causes processing to fail when data constructs are encountered that
14
+ result in lossy behavior or other data warnings. This is intended to be the
15
+ common way that digital signing and similar applications use this libraray.
12
16
13
17
## 6.0.0 - 2022-06-06
14
18
34
38
35
39
### Removed
36
40
- Experimental non-standard ` protectedMode ` option.
41
+ - ** BREAKING** : Various console warnings were removed. The newly added "safe
42
+ mode" can stop processing where these warnings were.
37
43
38
44
## 5.2.0 - 2021-04-07
39
45
Original file line number Diff line number Diff line change @@ -346,6 +346,24 @@ It is recommended to set a default `user-agent` header for Node.js
346
346
applications. The default for the default Node.js document loader is
347
347
` jsonld.js ` .
348
348
349
+ ### Safe Mode
350
+
351
+ A common use case is to avoid JSON-LD constructs that will result in lossy
352
+ behavior. The JSON-LD specifications have notes about when data is dropped.
353
+ This can be especially important when calling [ ` canonize ` ] [ ] in order to
354
+ digitally sign data. A special "safe mode" is available that will detect these
355
+ situations and cause processing to fail.
356
+
357
+ ** Note** : This mode is designed to be the common way that digital signing and
358
+ similar applications use this library.
359
+
360
+ The ` safe ` options flag set to ` true ` enables this behavior:
361
+
362
+ ``` js
363
+ // expand a document in safe mode
364
+ const expanded = await jsonld .expand (data, {safe: true });
365
+ ```
366
+
349
367
Related Modules
350
368
---------------
351
369
You can’t perform that action at this time.
0 commit comments