@reldens/utils 0.17.4 → 0.17.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/shortcuts.js +17 -2
- package/package.json +1 -1
package/lib/shortcuts.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
*
|
|
3
3
|
* Reldens - Shortcuts
|
|
4
4
|
*
|
|
5
|
-
* Shortcuts collection.
|
|
6
|
-
*
|
|
7
5
|
*/
|
|
8
6
|
|
|
9
7
|
class Shortcuts
|
|
@@ -147,6 +145,23 @@ class Shortcuts
|
|
|
147
145
|
return false;
|
|
148
146
|
}
|
|
149
147
|
|
|
148
|
+
fetchAllByProperty(itemsArray, propertyName, propertyValue)
|
|
149
|
+
{
|
|
150
|
+
if(!this.isArray(itemsArray)){
|
|
151
|
+
return [];
|
|
152
|
+
}
|
|
153
|
+
if(0 === itemsArray.length){
|
|
154
|
+
return [];
|
|
155
|
+
}
|
|
156
|
+
let foundItems = [];
|
|
157
|
+
for(let item of itemsArray){
|
|
158
|
+
if(item[propertyName] === propertyValue){
|
|
159
|
+
foundItems.push(item);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return foundItems;
|
|
163
|
+
}
|
|
164
|
+
|
|
150
165
|
fetchByPropertyOnObject(objectList, propertyName, propertyValue)
|
|
151
166
|
{
|
|
152
167
|
if(!objectList){
|