@reldens/utils 0.17.3 → 0.17.4
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 +19 -0
- package/package.json +1 -1
package/lib/shortcuts.js
CHANGED
|
@@ -165,6 +165,25 @@ class Shortcuts
|
|
|
165
165
|
return false;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
+
fetchAllByPropertyOnObject(objectList, propertyName, propertyValue)
|
|
169
|
+
{
|
|
170
|
+
if(!objectList){
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
let objKeys = Object.keys(objectList);
|
|
174
|
+
if(0 === objKeys.length){
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
let results = [];
|
|
178
|
+
for(let i of objKeys){
|
|
179
|
+
let obj = objectList[i];
|
|
180
|
+
if(obj[propertyName] === propertyValue){
|
|
181
|
+
results.push(obj);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return results;
|
|
185
|
+
}
|
|
186
|
+
|
|
168
187
|
serializeFormData(formData)
|
|
169
188
|
{
|
|
170
189
|
if(0 === formData.length){
|