@thinkpixellab-public/px-vue 3.0.77 → 3.0.78
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/package.json +1 -1
- package/utils/utils.js +16 -0
package/package.json
CHANGED
package/utils/utils.js
CHANGED
|
@@ -183,6 +183,22 @@ export default {
|
|
|
183
183
|
return false;
|
|
184
184
|
},
|
|
185
185
|
|
|
186
|
+
/**
|
|
187
|
+
* Returns a version with only values that past the test defined in filterFunction.
|
|
188
|
+
*
|
|
189
|
+
* @param {object} obj
|
|
190
|
+
* @param {functintion} filterFunction
|
|
191
|
+
* @return {object}
|
|
192
|
+
*/
|
|
193
|
+
filterObject(obj, filterFunction) {
|
|
194
|
+
return Object.keys(obj)
|
|
195
|
+
.filter(key => filterFunction(obj[key], key))
|
|
196
|
+
.reduce((result, key) => {
|
|
197
|
+
result[key] = obj[key];
|
|
198
|
+
return result;
|
|
199
|
+
}, {});
|
|
200
|
+
},
|
|
201
|
+
|
|
186
202
|
/**
|
|
187
203
|
* Returns an object representing the current query string parameters.
|
|
188
204
|
*/
|