Comparing version 3.0.6 to 3.0.7
113
index.js
@@ -27,9 +27,2 @@ /* | ||
/** | ||
* Various utilities for JSON References *(http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03)* and | ||
* JSON Pointers *(https://tools.ietf.org/html/rfc6901)*. | ||
* | ||
* @module JsonRefs | ||
*/ | ||
var _ = require('lodash'); | ||
@@ -567,23 +560,23 @@ var gl = require('graphlib'); | ||
* | ||
* @param {string|string[]|function} [filter=function () {return true;}] - The filter to use when gathering JSON | ||
* @property {string|string[]|function} [filter=function () {return true;}] - The filter to use when gathering JSON | ||
* References *(If this value is a single string or an array of strings, the value(s) are expected to be the `type(s)` | ||
* you are interested in collecting as described in {@link module:JsonRefs.getRefDetails}. If it is a function, it is | ||
* expected that the function behaves like {@link module:JsonRefs~RefDetailsFilter}.)* | ||
* @param {boolean} [includeInvalid=false] - Whether or not to include invalid JSON Reference details *(This will make | ||
* it so that objects that are like JSON Reference objects, as in they are an `Object` and the have a `$ref` property, | ||
* but fail validation will be included. This is very useful for when you want to know if you have invalid JSON | ||
* Reference definitions. This will not mean that APIs will process invalid JSON References but the reasons as to why | ||
* the JSON References are invalid will be included in the returned metadata.)* | ||
* @param {object} [loaderOptions] - The options to pass to | ||
* you are interested in collecting as described in {@link getRefDetails}. If it is a function, it is | ||
* expected that the function behaves like {@link RefDetailsFilter}.)* | ||
* @property {boolean} [includeInvalid=false] - Whether or not to include invalid JSON Reference details *(This will | ||
* make it so that objects that are like JSON Reference objects, as in they are an `Object` and the have a `$ref` | ||
* property, but fail validation will be included. This is very useful for when you want to know if you have invalid | ||
* JSON Reference definitions. This will not mean that APIs will process invalid JSON References but the reasons as to | ||
* why the JSON References are invalid will be included in the returned metadata.)* | ||
* @property {object} [loaderOptions] - The options to pass to | ||
* {@link https://github.com/whitlockjc/path-loader/blob/master/docs/API.md#module_PathLoader.load|PathLoader~load} | ||
* @param {string} [location=root.json] - The location of the document being processed *(This property is only useful | ||
* when resolving references as it will be used to locate relative references found within the document being resolved. | ||
* If this value is relative, {@link https://github.com/whitlockjc/path-loader|path-loader} will use | ||
* @property {string} [location=root.json] - The location of the document being processed *(This property is only | ||
* useful when resolving references as it will be used to locate relative references found within the document being | ||
* resolved. If this value is relative, {@link https://github.com/whitlockjc/path-loader|path-loader} will use | ||
* `window.location.href` for the browser and `process.cwd()` for Node.js.)* | ||
* @param {module:JsonRefs~RefPreProcessor} [refPreProcessor] - The callback used to pre-process a JSON Reference like | ||
* @property {RefPreProcessor} [refPreProcessor] - The callback used to pre-process a JSON Reference like | ||
* object *(This is called prior to validating the JSON Reference like object and getting its details)* | ||
* @param {module:JsonRefs~RefPostProcessor} [refPostProcessor] - The callback used to post-process the JSON Reference | ||
* @property {RefPostProcessor} [refPostProcessor] - The callback used to post-process the JSON Reference | ||
* metadata *(This is called prior filtering the references)* | ||
* @param {boolean} [resolveCirculars=false] - Whether to resolve circular references | ||
* @param {string|string[]} [options.subDocPath=[]] - The JSON Pointer or array of path segments to the sub document | ||
* @property {boolean} [resolveCirculars=false] - Whether to resolve circular references | ||
* @property {string|string[]} [subDocPath=[]] - The JSON Pointer or array of path segments to the sub document | ||
* location to search from | ||
@@ -597,3 +590,3 @@ */ | ||
* | ||
* @param {module:JsonRefs~UnresolvedRefDetails} refDetails - The JSON Reference details to test | ||
* @param {UnresolvedRefDetails} refDetails - The JSON Reference details to test | ||
* @param {string[]} path - The path to the JSON Reference | ||
@@ -620,3 +613,3 @@ * | ||
* | ||
* @param {module:JsonRefs~UnresolvedRefDetails} refDetails - The JSON Reference details to test | ||
* @param {UnresolvedRefDetails} refDetails - The JSON Reference details to test | ||
* @param {string[]} path - The path to the JSON Reference | ||
@@ -630,3 +623,3 @@ * | ||
* | ||
* @typedef {module:JsonRefs~UnresolvedRefDetails} ResolvedRefDetails | ||
* @typedef {UnresolvedRefDetails} ResolvedRefDetails | ||
* | ||
@@ -636,3 +629,3 @@ * @property {boolean} [circular] - Whether or not the JSON Reference is circular *(Will not be set if the JSON | ||
* @property {string} fqURI - The fully-qualified version of the `uri` property for | ||
* {@link module:JsonRefs~UnresolvedRefDetails} but with the value being relative to the root | ||
* {@link UnresolvedRefDetails} but with the value being relative to the root | ||
* document | ||
@@ -649,4 +642,4 @@ * @property {boolean} [missing] - Whether or not the referenced value was missing or not *(Will not be set if the | ||
* | ||
* @property {module:JsonRefs~ResolvedRefDetails} refs - An object whose keys are JSON Pointers *(fragment version)* | ||
* to where the JSON Reference is defined and whose values are {@link module:JsonRefs~ResolvedRefDetails} | ||
* @property {ResolvedRefDetails} refs - An object whose keys are JSON Pointers *(fragment version)* | ||
* to where the JSON Reference is defined and whose values are {@link ResolvedRefDetails} | ||
* @property {object} resolved - The array/object with its JSON References fully resolved | ||
@@ -658,3 +651,3 @@ */ | ||
* | ||
* @typedef {module:JsonRefs~ResolvedRefsResults} RetrievedRefsResults | ||
* @typedef {ResolvedRefsResults} RetrievedRefsResults | ||
* | ||
@@ -670,6 +663,6 @@ * @property {object} value - The retrieved document | ||
* | ||
* @property {module:JsonRefs~UnresolvedRefDetails} refs - An object whose keys are JSON Pointers *(fragment version)* | ||
* to where the JSON Reference is defined and whose values are {@link module:JsonRefs~UnresolvedRefDetails} | ||
* @property {UnresolvedRefDetails} refs - An object whose keys are JSON Pointers *(fragment version)* | ||
* to where the JSON Reference is defined and whose values are {@link UnresolvedRefDetails} | ||
* @property {ResolvedRefsResults} - An object whose keys are JSON Pointers *(fragment version)* | ||
* to where the JSON Reference is defined and whose values are {@link module:JsonRefs~ResolvedRefDetails} | ||
* to where the JSON Reference is defined and whose values are {@link ResolvedRefDetails} | ||
* @property {object} value - The retrieved document | ||
@@ -698,3 +691,3 @@ */ | ||
* | ||
* @alias module:JsonRefs.clearCache | ||
* @alias clearCache | ||
*/ | ||
@@ -716,3 +709,3 @@ function clearCache () { | ||
* | ||
* @alias module:JsonRefs.decodePath | ||
* @alias decodePath | ||
*/ | ||
@@ -744,3 +737,3 @@ function decodePath (path) { | ||
* | ||
* @alias module:JsonRefs.encodePath | ||
* @alias encodePath | ||
*/ | ||
@@ -765,10 +758,10 @@ function encodePath (path) { | ||
* @param {array|object} obj - The structure to find JSON References within | ||
* @param {module:JsonRefs~JsonRefsOptions} [options] - The JsonRefs options | ||
* @param {JsonRefsOptions} [options] - The JsonRefs options | ||
* | ||
* @returns {object} an object whose keys are JSON Pointers *(fragment version)* to where the JSON Reference is defined | ||
* and whose values are {@link module:JsonRefs~UnresolvedRefDetails}. | ||
* and whose values are {@link UnresolvedRefDetails}. | ||
* | ||
* @throws {Error} when the input arguments fail validation or if `options.subDocPath` points to an invalid location | ||
* | ||
* @alias module:JsonRefs.findRefs | ||
* @alias findRefs | ||
* | ||
@@ -838,14 +831,14 @@ * @example | ||
* | ||
* This API is identical to {@link module:JsonRefs.findRefs} except this API will retrieve a remote document and then | ||
* return the result of {@link module:JsonRefs.findRefs} on the retrieved document. | ||
* This API is identical to {@link findRefs} except this API will retrieve a remote document and then | ||
* return the result of {@link findRefs} on the retrieved document. | ||
* | ||
* @param {string} location - The location to retrieve *(Can be relative or absolute, just make sure you look at the | ||
* {@link module:JsonRefs~JsonRefsOptions|options documentation} to see how relative references are handled.)* | ||
* @param {module:JsonRefs~JsonRefsOptions} [options] - The JsonRefs options | ||
* {@link JsonRefsOptions|options documentation} to see how relative references are handled.)* | ||
* @param {JsonRefsOptions} [options] - The JsonRefs options | ||
* | ||
* @returns {Promise} a promise that resolves a {@link module:JsonRefs~RetrievedRefsResults} and rejects with an | ||
* @returns {Promise} a promise that resolves a {@link RetrievedRefsResults} and rejects with an | ||
* `Error` when the input arguments fail validation, when `options.subDocPath` points to an invalid location or when | ||
* the location argument points to an unloadable resource | ||
* | ||
* @alias module:JsonRefs.findRefsAt | ||
* @alias findRefsAt | ||
* | ||
@@ -931,5 +924,5 @@ * @example | ||
* | ||
* @returns {module:JsonRefs~UnresolvedRefDetails} the detailed information | ||
* @returns {UnresolvedRefDetails} the detailed information | ||
* | ||
* @alias module:JsonRefs.getRefDetails | ||
* @alias getRefDetails | ||
*/ | ||
@@ -1008,3 +1001,3 @@ function getRefDetails (obj) { | ||
* | ||
* @alias module:JsonRefs.isPtr | ||
* @alias isPtr | ||
* | ||
@@ -1075,3 +1068,3 @@ * @see {@link https://tools.ietf.org/html/rfc6901#section-3} | ||
* | ||
* @alias module:JsonRefs.isRef | ||
* @alias isRef | ||
* | ||
@@ -1106,3 +1099,3 @@ * @see {@link http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3} | ||
* | ||
* @alias module:JsonRefs.pathFromPtr | ||
* @alias pathFromPtr | ||
*/ | ||
@@ -1136,3 +1129,3 @@ function pathFromPtr (ptr) { | ||
* | ||
* @alias module:JsonRefs.pathToPtr | ||
* @alias pathToPtr | ||
*/ | ||
@@ -1152,9 +1145,9 @@ function pathToPtr (path, hashPrefix) { | ||
* @param {array|object} obj - The structure to find JSON References within | ||
* @param {module:JsonRefs~JsonRefsOptions} [options] - The JsonRefs options | ||
* @param {JsonRefsOptions} [options] - The JsonRefs options | ||
* | ||
* @returns {Promise} a promise that resolves a {@link module:JsonRefs~ResolvedRefsResults} and rejects with an | ||
* @returns {Promise} a promise that resolves a {@link ResolvedRefsResults} and rejects with an | ||
* `Error` when the input arguments fail validation, when `options.subDocPath` points to an invalid location or when | ||
* the location argument points to an unloadable resource | ||
* | ||
* @alias module:JsonRefs.resolveRefs | ||
* @alias resolveRefs | ||
* | ||
@@ -1443,14 +1436,14 @@ * @example | ||
* | ||
* This API is identical to {@link module:JsonRefs.resolveRefs} except this API will retrieve a remote document and then | ||
* return the result of {@link module:JsonRefs.resolveRefs} on the retrieved document. | ||
* This API is identical to {@link resolveRefs} except this API will retrieve a remote document and then | ||
* return the result of {@link resolveRefs} on the retrieved document. | ||
* | ||
* @param {string} location - The location to retrieve *(Can be relative or absolute, just make sure you look at the | ||
* {@link module:JsonRefs~JsonRefsOptions|options documentation} to see how relative references are handled.)* | ||
* @param {module:JsonRefs~JsonRefsOptions} [options] - The JsonRefs options | ||
* {@link JsonRefsOptions|options documentation} to see how relative references are handled.)* | ||
* @param {JsonRefsOptions} [options] - The JsonRefs options | ||
* | ||
* @returns {Promise} a promise that resolves a {@link module:JsonRefs~RetrievedResolvedRefsResults} and rejects with an | ||
* @returns {Promise} a promise that resolves a {@link RetrievedResolvedRefsResults} and rejects with an | ||
* `Error` when the input arguments fail validation, when `options.subDocPath` points to an invalid location or when | ||
* the location argument points to an unloadable resource | ||
* | ||
* @alias module:JsonRefs.resolveRefsAt | ||
* @alias resolveRefsAt | ||
* | ||
@@ -1457,0 +1450,0 @@ * @example |
{ | ||
"name": "json-refs", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"description": "Various utilities for JSON References (http://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03).", | ||
@@ -26,5 +26,7 @@ "main": "index.js", | ||
"bin", | ||
"index.d.ts", | ||
"index.js", | ||
"LICENSE" | ||
], | ||
"types": "./index.d.ts", | ||
"homepage": "https://github.com/whitlockjc/json-refs", | ||
@@ -40,2 +42,3 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@otris/jsdoc-tsd": "^1.0.0", | ||
"brfs": "~1.4.3", | ||
@@ -52,2 +55,3 @@ "browserify": "~14.4.0", | ||
"gulp-jsdoc-to-markdown": "^1.2.2", | ||
"gulp-jsdoc3": "^2.0.0", | ||
"gulp-load-plugins": "^1.5.0", | ||
@@ -75,3 +79,3 @@ "gulp-mocha": "~3.0.1", | ||
"native-promise-only": "^0.8.1", | ||
"path-loader": "^1.0.4", | ||
"path-loader": "^1.0.5", | ||
"slash": "^1.0.0", | ||
@@ -78,0 +82,0 @@ "uri-js": "^3.0.2" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
74745
6
1580
28
Updatedpath-loader@^1.0.5