elderwand 0.1.61 → 0.1.63

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.
@@ -99,6 +99,17 @@ module.exports = function(){
99
99
  });
100
100
  addPropertyToClass(global, "fwLog", EWLog)
101
101
 
102
+ addPropertyToClass(Date.prototype, 'getStartOfDay',function(){
103
+ var start = new Date(this.getTime())
104
+ start.setHours(0,0,0,0);
105
+ return start
106
+ })
107
+
108
+ addPropertyToClass(Date.prototype, 'getEndOfDay',function(){
109
+ var start = new Date(this.getTime())
110
+ start.setHours(23,59,59,59);
111
+ return start
112
+ })
102
113
  addPropertyToClass(Array.prototype, 'removeDuplicates',function(predicate){
103
114
  var set = [];
104
115
  for(var key in this){
@@ -197,6 +208,22 @@ module.exports = function(){
197
208
  }
198
209
  return obj;
199
210
  });
211
+ addPropertyToClass(Array.prototype,"group", function(array, blend, keyFunc){
212
+ var obj = {};
213
+ for(var i = 0; i < this.length; i++){
214
+ var item = this[i];
215
+ var key = keyFunc(this[i], i);
216
+ if(item && key && !obj[key]){
217
+ obj[key] = []
218
+ }
219
+
220
+ if(item && key){
221
+ obj[key].push(item);
222
+ }
223
+
224
+ }
225
+ return obj;
226
+ });
200
227
  addPropertyToClass(Array.prototype,"notIn", function(array, comp){
201
228
  var arr = [];
202
229
  for(var i = 0; i < this.length; i++){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "elderwand",
3
- "version": "0.1.61",
3
+ "version": "0.1.63",
4
4
  "description": "Mamtas Technology Internal Framework",
5
5
  "main": "./node_modules/.bin/nodemon index.js",
6
6
  "scripts": {