mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-15 21:55:36 +07:00
Fix #153
Implementing the flat function by my own, also a function that removes empty fields from arrays.
This commit is contained in:
@@ -21,6 +21,20 @@
|
||||
* This script is responsible for some tools.
|
||||
*/
|
||||
|
||||
/*
|
||||
* To support Waterfox.
|
||||
*/
|
||||
Array.prototype.rmEmpty = function() {
|
||||
return this.filter(v => v);
|
||||
};
|
||||
|
||||
/*
|
||||
* To support Waterfox.
|
||||
*/
|
||||
Array.prototype.flatten = function() {
|
||||
return this.reduce((a, b) => a.concat(b), []);
|
||||
};
|
||||
|
||||
/**
|
||||
* Check if an object is empty.
|
||||
* @param {Object} obj
|
||||
|
||||
Reference in New Issue
Block a user