siren-parser
Advanced tools
Comparing version 6.4.0 to 6.5.0
@@ -17,5 +17,5 @@ (function(f){var g;if(typeof window!=='undefined'){g=window}else if(typeof self!=='undefined'){g=self}g=g.D2L||(g.D2L={});g=g.Hypermedia||(g.Hypermedia={});g=g.Siren||(g.Siren={});g.Parse=f()})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
"use strict";function contains(t,n){return"string"==typeof n?t.indexOf(n)>-1:void 0!==t.find(function(t){return t.match(n)})}function hasProperty(t,n){return"string"==typeof n?t.hasOwnProperty(n):contains(Object.keys(t),n)}function getMatchingValue(t,n){if("string"==typeof n)return t[n];for(var r=Object.keys(t),e=0;e<r.length;e++){var a=r[e];if(a.match(n))return t[a]}}function getMatchingValuesByAll(t,n,r){if(!Array.isArray(n)||!r)return[];for(var e=[],a=0;a<t.length;a++){var i=t[a];n.every(function(t){return contains(i[r],t)})&&e.push(i)}return e}module.exports={contains:contains,hasProperty:hasProperty,getMatchingValue:getMatchingValue,getMatchingValuesByAll:getMatchingValuesByAll}; | ||
"use strict";function contains(t,n){return"string"==typeof n?t.indexOf(n)>-1:void 0!==t.find(function(t){return t.match(n)})}function hasProperty(t,n){return"string"==typeof n?t.hasOwnProperty(n):contains(Object.keys(t),n)}function getMatchingValue(t,n){if("string"==typeof n)return t[n];for(var r=Object.keys(t),e=0;e<r.length;e++){var a=r[e];if(a.match(n))return t[a]}}function getMatchingValuesByAll(t,n,r){if(!Array.isArray(n)||!r)return[];for(var e=[],a=0;a<t.length;a++){var i=t[a],o=i[r];o&&n.every(function(t){return contains(o,t)})&&e.push(i)}return e}module.exports={contains:contains,hasProperty:hasProperty,getMatchingValue:getMatchingValue,getMatchingValuesByAll:getMatchingValuesByAll}; | ||
},{}]},{},[2])(2) | ||
}); |
@@ -17,5 +17,5 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g=(g.D2L||(g.D2L = {}));g=(g.Hypermedia||(g.Hypermedia = {}));g=(g.Siren||(g.Siren = {}));g.Parse = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
},{}],6:[function(require,module,exports){ | ||
"use strict";function contains(t,n){return"string"==typeof n?t.indexOf(n)>-1:void 0!==t.find(function(t){return t.match(n)})}function hasProperty(t,n){return"string"==typeof n?t.hasOwnProperty(n):contains(Object.keys(t),n)}function getMatchingValue(t,n){if("string"==typeof n)return t[n];for(var r=Object.keys(t),e=0;e<r.length;e++){var a=r[e];if(a.match(n))return t[a]}}function getMatchingValuesByAll(t,n,r){if(!Array.isArray(n)||!r)return[];for(var e=[],a=0;a<t.length;a++){var i=t[a];n.every(function(t){return contains(i[r],t)})&&e.push(i)}return e}module.exports={contains:contains,hasProperty:hasProperty,getMatchingValue:getMatchingValue,getMatchingValuesByAll:getMatchingValuesByAll}; | ||
"use strict";function contains(t,n){return"string"==typeof n?t.indexOf(n)>-1:void 0!==t.find(function(t){return t.match(n)})}function hasProperty(t,n){return"string"==typeof n?t.hasOwnProperty(n):contains(Object.keys(t),n)}function getMatchingValue(t,n){if("string"==typeof n)return t[n];for(var r=Object.keys(t),e=0;e<r.length;e++){var a=r[e];if(a.match(n))return t[a]}}function getMatchingValuesByAll(t,n,r){if(!Array.isArray(n)||!r)return[];for(var e=[],a=0;a<t.length;a++){var i=t[a],o=i[r];o&&n.every(function(t){return contains(o,t)})&&e.push(i)}return e}module.exports={contains:contains,hasProperty:hasProperty,getMatchingValue:getMatchingValue,getMatchingValuesByAll:getMatchingValuesByAll}; | ||
},{}]},{},[2])(2) | ||
}); |
{ | ||
"name": "siren-parser", | ||
"version": "6.4.0", | ||
"version": "6.5.0", | ||
"description": "Pretty much the opposite of dominicbarnes/node-siren-writer", | ||
@@ -5,0 +5,0 @@ "main": "src/Entity.js", |
@@ -43,16 +43,17 @@ 'use strict'; | ||
const vals = []; | ||
const results = []; | ||
for (var i = 0; i < arrayLike.length; i++) { | ||
var like = arrayLike[i]; | ||
var val = like[propertyToMatch]; | ||
if (arrayOfStringOrRegex.every( | ||
if (val && arrayOfStringOrRegex.every( | ||
function(y) { | ||
return contains(like[propertyToMatch], y); | ||
return contains(val, y); | ||
}) | ||
) { | ||
vals.push(like); | ||
results.push(like); | ||
} | ||
} | ||
return vals; | ||
return results; | ||
} | ||
@@ -59,0 +60,0 @@ |
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
92656
916