|
4 | 4 | * @author Dave Longley
|
5 | 5 | *
|
6 | 6 | * @license BSD 3-Clause License
|
7 |
| - * Copyright (c) 2011-2019 Digital Bazaar, Inc. |
| 7 | + * Copyright (c) 2011-2022 Digital Bazaar, Inc. |
8 | 8 | * All rights reserved.
|
9 | 9 | *
|
10 | 10 | * Redistribution and use in source and binary forms, with or without
|
@@ -81,12 +81,10 @@ const {
|
81 | 81 | } = require('./nodeMap');
|
82 | 82 |
|
83 | 83 | const {
|
84 |
| - basicEventHandler: _basicEventHandler, |
85 | 84 | logEventHandler: _logEventHandler,
|
86 | 85 | logWarningEventHandler: _logWarningEventHandler,
|
87 | 86 | setDefaultEventHandler: _setDefaultEventHandler,
|
88 | 87 | strictModeEventHandler: _strictModeEventHandler,
|
89 |
| - throwUnacceptableEventHandler: _throwUnacceptableEventHandler, |
90 | 88 | unhandledEventHandler: _unhandledEventHandler
|
91 | 89 | } = require('./events');
|
92 | 90 |
|
@@ -129,6 +127,7 @@ const _resolvedContextCache = new LRU({max: RESOLVED_CONTEXT_CACHE_MAX_SIZE});
|
129 | 127 | * unmappable values (or to throw an error when they are detected);
|
130 | 128 | * if this function returns `undefined` then the default behavior
|
131 | 129 | * will be used.
|
| 130 | + * [safe] true to use safe mode. |
132 | 131 | * [eventHandler] handler for events.
|
133 | 132 | * [contextResolver] internal use only.
|
134 | 133 | *
|
@@ -268,6 +267,7 @@ jsonld.compact = async function(input, ctx, options) {
|
268 | 267 | * unmappable values (or to throw an error when they are detected);
|
269 | 268 | * if this function returns `undefined` then the default behavior
|
270 | 269 | * will be used.
|
| 270 | + * [safe] true to use safe mode. |
271 | 271 | * [eventHandler] handler for events.
|
272 | 272 | * [contextResolver] internal use only.
|
273 | 273 | *
|
@@ -422,6 +422,7 @@ jsonld.flatten = async function(input, ctx, options) {
|
422 | 422 | * [requireAll] default @requireAll flag (default: true).
|
423 | 423 | * [omitDefault] default @omitDefault flag (default: false).
|
424 | 424 | * [documentLoader(url, options)] the document loader.
|
| 425 | + * [safe] true to use safe mode. |
425 | 426 | * [eventHandler] handler for events.
|
426 | 427 | * [contextResolver] internal use only.
|
427 | 428 | *
|
@@ -521,6 +522,7 @@ jsonld.frame = async function(input, frame, options) {
|
521 | 522 | * [base] the base IRI to use.
|
522 | 523 | * [expandContext] a context to expand with.
|
523 | 524 | * [documentLoader(url, options)] the document loader.
|
| 525 | + * [safe] true to use safe mode. |
524 | 526 | * [eventHandler] handler for events.
|
525 | 527 | * [contextResolver] internal use only.
|
526 | 528 | *
|
@@ -557,6 +559,7 @@ jsonld.link = async function(input, ctx, options) {
|
557 | 559 | * 'application/n-quads' for N-Quads.
|
558 | 560 | * [documentLoader(url, options)] the document loader.
|
559 | 561 | * [useNative] true to use a native canonize algorithm
|
| 562 | + * [safe] true to use safe mode. |
560 | 563 | * [eventHandler] handler for events.
|
561 | 564 | * [contextResolver] internal use only.
|
562 | 565 | *
|
@@ -614,6 +617,7 @@ jsonld.normalize = jsonld.canonize = async function(input, options) {
|
614 | 617 | * (boolean, integer, double), false not to (default: false).
|
615 | 618 | * [rdfDirection] 'i18n-datatype' to support RDF transformation of
|
616 | 619 | * @direction (default: null).
|
| 620 | + * [safe] true to use safe mode. |
617 | 621 | * [eventHandler] handler for events.
|
618 | 622 | *
|
619 | 623 | * @return a Promise that resolves to the JSON-LD document.
|
@@ -664,6 +668,7 @@ jsonld.fromRDF = async function(dataset, options) {
|
664 | 668 | * [produceGeneralizedRdf] true to output generalized RDF, false
|
665 | 669 | * to produce only standard RDF (default: false).
|
666 | 670 | * [documentLoader(url, options)] the document loader.
|
| 671 | + * [safe] true to use safe mode. |
667 | 672 | * [eventHandler] handler for events.
|
668 | 673 | * [contextResolver] internal use only.
|
669 | 674 | *
|
@@ -758,6 +763,7 @@ jsonld.createNodeMap = async function(input, options) {
|
758 | 763 | * new properties where a node is in the `object` position
|
759 | 764 | * (default: true).
|
760 | 765 | * [documentLoader(url, options)] the document loader.
|
| 766 | + * [safe] true to use safe mode. |
761 | 767 | * [eventHandler] handler for events.
|
762 | 768 | * [contextResolver] internal use only.
|
763 | 769 | *
|
@@ -921,6 +927,7 @@ jsonld.get = async function(url, options) {
|
921 | 927 | * @param localCtx the local context to process.
|
922 | 928 | * @param [options] the options to use:
|
923 | 929 | * [documentLoader(url, options)] the document loader.
|
| 930 | + * [safe] true to use safe mode. |
924 | 931 | * [eventHandler] handler for events.
|
925 | 932 | * [contextResolver] internal use only.
|
926 | 933 | *
|
@@ -1008,13 +1015,10 @@ jsonld.registerRDFParser('application/nquads', NQuads.parse);
|
1008 | 1015 | jsonld.url = require('./url');
|
1009 | 1016 |
|
1010 | 1017 | /* Events API and handlers */
|
1011 |
| -jsonld.setDefaultEventHandler = _setDefaultEventHandler; |
1012 |
| -jsonld.basicEventHandler = _basicEventHandler; |
1013 | 1018 | jsonld.logEventHandler = _logEventHandler;
|
1014 | 1019 | jsonld.logWarningEventHandler = _logWarningEventHandler;
|
1015 | 1020 | jsonld.setDefaultEventHandler = _setDefaultEventHandler;
|
1016 | 1021 | jsonld.strictModeEventHandler = _strictModeEventHandler;
|
1017 |
| -jsonld.throwUnacceptableEventHandler = _throwUnacceptableEventHandler; |
1018 | 1022 | jsonld.unhandledEventHandler = _unhandledEventHandler;
|
1019 | 1023 |
|
1020 | 1024 | /* Utility API */
|
|
0 commit comments