@@ -52,18 +52,17 @@ function _inherits(subClass, superClass) {
5252}
5353
5454function _getPrototypeOf ( o ) {
55- _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf : function _getPrototypeOf ( o ) {
55+ _getPrototypeOf = Object . setPrototypeOf ? Object . getPrototypeOf . bind ( ) : function _getPrototypeOf ( o ) {
5656 return o . __proto__ || Object . getPrototypeOf ( o ) ;
5757 } ;
5858 return _getPrototypeOf ( o ) ;
5959}
6060
6161function _setPrototypeOf ( o , p ) {
62- _setPrototypeOf = Object . setPrototypeOf || function _setPrototypeOf ( o , p ) {
62+ _setPrototypeOf = Object . setPrototypeOf ? Object . setPrototypeOf . bind ( ) : function _setPrototypeOf ( o , p ) {
6363 o . __proto__ = p ;
6464 return o ;
6565 } ;
66-
6766 return _setPrototypeOf ( o , p ) ;
6867}
6968
@@ -82,7 +81,7 @@ function _isNativeReflectConstruct() {
8281
8382function _construct ( Parent , args , Class ) {
8483 if ( _isNativeReflectConstruct ( ) ) {
85- _construct = Reflect . construct ;
84+ _construct = Reflect . construct . bind ( ) ;
8685 } else {
8786 _construct = function _construct ( Parent , args , Class ) {
8887 var a = [ null ] ;
@@ -264,13 +263,21 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
264263
265264var hasOwnProp = Object . prototype . hasOwnProperty ;
266265/**
267- * @typedef {null|boolean|number|string|PlainObject|GenericArray } JSONObject
268- */
266+ * @typedef {null|boolean|number|string|PlainObject|GenericArray } JSONObject
267+ */
268+
269+ /**
270+ * @typedef {any } AnyItem
271+ */
272+
273+ /**
274+ * @typedef {any } AnyResult
275+ */
269276
270277/**
271278 * Copies array and then pushes item into it.
272279 * @param {GenericArray } arr Array to copy and into which to push
273- * @param {any } item Array item to add (to end)
280+ * @param {AnyItem } item Array item to add (to end)
274281 * @returns {GenericArray } Copy of the original array
275282 */
276283
@@ -281,7 +288,7 @@ function push(arr, item) {
281288}
282289/**
283290 * Copies array and then unshifts item into it.
284- * @param {any } item Array item to add (to beginning)
291+ * @param {AnyItem } item Array item to add (to beginning)
285292 * @param {GenericArray } arr Array to copy and into which to unshift
286293 * @returns {GenericArray } Copy of the original array
287294 */
@@ -304,7 +311,7 @@ var NewError = /*#__PURE__*/function (_Error) {
304311 var _super = _createSuper ( NewError ) ;
305312
306313 /**
307- * @param {any } value The evaluated scalar value
314+ * @param {AnyResult } value The evaluated scalar value
308315 */
309316 function NewError ( value ) {
310317 var _this ;
@@ -559,7 +566,7 @@ JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {
559566 if ( callback ) {
560567 var preferredOutput = this . _getPreferredOutput ( fullRetObj ) ;
561568
562- fullRetObj . path = typeof fullRetObj . path === 'string' ? fullRetObj . path : JSONPath . toPathString ( fullRetObj . path ) ; // eslint-disable-next-line node /callback-return
569+ fullRetObj . path = typeof fullRetObj . path === 'string' ? fullRetObj . path : JSONPath . toPathString ( fullRetObj . path ) ; // eslint-disable-next-line n /callback-return
563570
564571 callback ( preferredOutput , type , fullRetObj ) ;
565572 }
@@ -915,8 +922,6 @@ JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropN
915922 try {
916923 return this . vm . runInNewContext ( code , this . currSandbox ) ;
917924 } catch ( e ) {
918- // eslint-disable-next-line no-console
919- console . log ( e ) ;
920925 throw new Error ( 'jsonPath: ' + e . message + ': ' + code ) ;
921926 }
922927} ; // PUBLIC CLASS PROPERTIES AND METHODS
@@ -1002,10 +1007,18 @@ JSONPath.toPathArray = function (expr) {
10021007} ;
10031008
10041009/**
1005- * @callback ConditionCallback
1006- * @param {any } item
1007- * @returns {boolean }
1008- */
1010+ * @typedef {any } ContextItem
1011+ */
1012+
1013+ /**
1014+ * @typedef {any } EvaluatedResult
1015+ */
1016+
1017+ /**
1018+ * @callback ConditionCallback
1019+ * @param {ContextItem } item
1020+ * @returns {boolean }
1021+ */
10091022
10101023/**
10111024 * Copy items out of one array into another.
@@ -1033,7 +1046,7 @@ JSONPath.prototype.vm = {
10331046 * @param {string } expr Expression to evaluate
10341047 * @param {PlainObject } context Object whose items will be added
10351048 * to evaluation
1036- * @returns {any } Result of evaluated code
1049+ * @returns {EvaluatedResult } Result of evaluated code
10371050 */
10381051 runInNewContext : function runInNewContext ( expr , context ) {
10391052 var keys = Object . keys ( context ) ;
0 commit comments