Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

data-engine

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-engine - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

14

cjs/data-engine.development.js

@@ -1,2 +0,2 @@

/** @license Data-Engine v3.0.0
/** @license Data-Engine v3.0.1
* data-engine.development.js

@@ -129,3 +129,3 @@ *

/**
* Getter for data
* Getter for filtered data
*

@@ -137,3 +137,3 @@ * @return {array} sorted and filtered array

get: function () {
return this.getData();
return this.FilterEngine.FilteredData;
}

@@ -153,3 +153,3 @@ }]);

this.setData = function (data) {
return _this.FilterEngine.setData(data);
_this.filterEngine.Data = data;
};

@@ -169,4 +169,4 @@

this.createFilter = function (name, value, type) {
return _this.FilterEngine.createFilter(name, value, type);
this.addFilter = function (name, value, type) {
return _this.FilterEngine.addFilter(name, value, type);
};

@@ -199,3 +199,3 @@

this.getData = function () {
return _this.FilterEngine.FilteredData;
return _this.Data;
};

@@ -202,0 +202,0 @@ };

@@ -1,2 +0,2 @@

/** @license Data-Engine v3.0.0
/** @license Data-Engine v3.0.1
* data-engine.production.min.js

@@ -10,4 +10,4 @@ *

'use strict';var f=require("data-filter"),g=require("data-sort"),h=require("filter-value"),k=function(){function b(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(a,e,c){e&&b(a.prototype,e);c&&b(a,c);return a}}(),m=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.data,c=a.primaryKey,d=a.sortFunction;a=a.direction;if(!(this instanceof
b))throw new TypeError("Cannot call a class as a function");l.call(this);this.filterEngine=new f({data:e,sortEngine:new g({data:e,primaryKey:c,sortFunction:d,direction:a})})}k(b,[{key:"FilterEngine",get:function(){return this.filterEngine}},{key:"SortEngine",get:function(){return this.filterEngine.SortEngine}},{key:"Data",set:function(a){this.setData(a)},get:function(){return this.getData()}}]);return b}();m.Filter=f;m.Sort=g;m.FilterValue=h;
function l(){var b=this;this.setData=function(a){return b.FilterEngine.setData(a)};this.updateFilters=function(){var a;return(a=b.FilterEngine).update.apply(a,arguments)};this.removeFilters=function(){var a;return(a=b.FilterEngine).removeFilters.apply(a,arguments)};this.createFilter=function(a,e,c){return b.FilterEngine.createFilter(a,e,c)};this.clearFilters=function(){return b.FilterEngine.clearFilters()};this.setSortFunction=function(a){return b.SortEngine.setSortFunction(a)};this.setPrimaryKey=
function(a){return b.SortEngine.setPrimaryKey(a)};this.removePrimaryKey=function(){return b.SortEngine.removePrimaryKey()};this.setDefaultSort=function(){return b.SortEngine.setDefaultSort()};this.sortBy=function(a){return b.SortEngine.sortBy(a)};this.getData=function(){return b.FilterEngine.FilteredData}}var n=Object.freeze({default:m}),p=n&&m||n;module.exports=p["default"]?p["default"]:p;
b))throw new TypeError("Cannot call a class as a function");l.call(this);this.filterEngine=new f({data:e,sortEngine:new g({data:e,primaryKey:c,sortFunction:d,direction:a})})}k(b,[{key:"FilterEngine",get:function(){return this.filterEngine}},{key:"SortEngine",get:function(){return this.filterEngine.SortEngine}},{key:"Data",set:function(a){this.setData(a)},get:function(){return this.FilterEngine.FilteredData}}]);return b}();m.Filter=f;m.Sort=g;m.FilterValue=h;
function l(){var b=this;this.setData=function(a){b.filterEngine.Data=a};this.updateFilters=function(){var a;return(a=b.FilterEngine).update.apply(a,arguments)};this.removeFilters=function(){var a;return(a=b.FilterEngine).removeFilters.apply(a,arguments)};this.addFilter=function(a,e,c){return b.FilterEngine.addFilter(a,e,c)};this.clearFilters=function(){return b.FilterEngine.clearFilters()};this.setSortFunction=function(a){return b.SortEngine.setSortFunction(a)};this.setPrimaryKey=function(a){return b.SortEngine.setPrimaryKey(a)};
this.removePrimaryKey=function(){return b.SortEngine.removePrimaryKey()};this.setDefaultSort=function(){return b.SortEngine.setDefaultSort()};this.sortBy=function(a){return b.SortEngine.sortBy(a)};this.getData=function(){return b.Data}}var n=Object.freeze({default:m}),p=n&&m||n;module.exports=p["default"]?p["default"]:p;
{
"name": "data-engine",
"description": "Data engine is small data management lib for some sort and filter.",
"version": "3.0.0",
"version": "3.0.1",
"keywords": [

@@ -50,5 +50,5 @@ "Data",

"loose-envify": "^1.1.0",
"filter-value": "^3.0.0",
"data-filter": "^3.0.0",
"data-sort": "^3.0.0"
"filter-value": "^3.0.1",
"data-filter": "^3.0.1",
"data-sort": "^3.0.1"
},

@@ -55,0 +55,0 @@ "browserify": {

@@ -44,3 +44,3 @@ # DATA-ENGINE

const filteredData = engine.removeFilters(filter, filter2, filter3);
const filteredData = engine.createFilter(name, value, type);
const filteredData = engine.addFilter(name, value, type);
const filteredData = engine.clearFilters();

@@ -47,0 +47,0 @@ ```

@@ -1,2 +0,2 @@

/** @license Engine v3.0.0
/** @license Engine v3.0.1
* data-engine.development.js

@@ -544,3 +544,3 @@ *

get: function () {
return this.getData();
return this.data;
}

@@ -693,3 +693,3 @@ }, {

_this.data = [];
return;
return [];
}

@@ -700,2 +700,3 @@ _this.data = data;

}
return _this.data;
};

@@ -797,3 +798,3 @@

this.getData = function () {
return _this.data;
return _this.Data;
};

@@ -841,3 +842,3 @@ };

this.Data = data;
this.filtered = this.data;
this.filtered = this.getData();
}

@@ -855,3 +856,8 @@ /**

set: function (data) {
this.setData(data);
if (data && Array.isArray(data)) {
this.data = data;
this.updateFilter();
}
this.data = [];
this.filtered = [];
}

@@ -865,3 +871,3 @@ /**

get: function () {
return this.data;
return this.getData();
}

@@ -1004,9 +1010,9 @@ /**

this.setData = function (data) {
if (Array.isArray(data)) {
_this.data = data;
_this.updateFilter();
}
_this.data = [];
_this.Data = data;
};
this.getData = function () {
return _this.data;
};
this.createFilter = function (name, value, type) {

@@ -1055,4 +1061,4 @@ return new filterValue$1(name, value, type);

_this.filters = {};
_this.filtered = _this.updateFce(_this.data);
return _this.filtered;
_this.updateFilter();
return _this.FilteredData;
};

@@ -1062,3 +1068,3 @@

_this.filtered = _this.updateFce(_this.data.filter(_this.filterAll));
return _this.filtered;
return _this.FilteredData;
};

@@ -1076,8 +1082,8 @@

this.filterWOSort = function () {
return _this.filtered;
this.filterWOSort = function (data) {
return data;
};
this.filterWSort = function () {
return _this.SortEngine.setData(_this.filtered);
this.filterWSort = function (data) {
return _this.SortEngine.setData(data);
};

@@ -1212,3 +1218,3 @@

/**
* Getter for data
* Getter for filtered data
*

@@ -1220,3 +1226,3 @@ * @return {array} sorted and filtered array

get: function () {
return this.getData();
return this.FilterEngine.FilteredData;
}

@@ -1236,3 +1242,3 @@ }]);

this.setData = function (data) {
return _this.FilterEngine.setData(data);
_this.filterEngine.Data = data;
};

@@ -1252,4 +1258,4 @@

this.createFilter = function (name, value, type) {
return _this.FilterEngine.createFilter(name, value, type);
this.addFilter = function (name, value, type) {
return _this.FilterEngine.addFilter(name, value, type);
};

@@ -1282,3 +1288,3 @@

this.getData = function () {
return _this.FilterEngine.FilteredData;
return _this.Data;
};

@@ -1285,0 +1291,0 @@ };

@@ -1,2 +0,2 @@

/** @license Data-Engine v3.0.0
/** @license Data-Engine v3.0.1
* data-engine.production.min.js

@@ -22,14 +22,14 @@ *

function(a){var b=r[typeof a]||null;return b?b:null===a?"null":Array.isArray(a)?"array":a instanceof RegExp?"regexp":a instanceof Date?"date":a.from&&a.to&&p(a.from)===p(a.to)?"range":null}},k=Object.freeze({default:c});c=k&&c||k;var m=c["default"]?c["default"]:c,y=function(){function b(a,b){for(var e=0;e<b.length;e++){var c=b[e];c.enumerable=c.enumerable||!1;c.configurable=!0;"value"in c&&(c.writable=!0);Object.defineProperty(a,c.key,c)}}return function(a,e,c){e&&b(a.prototype,e);c&&b(a,c);return a}}();
c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.data,c=a.primaryKey,d=a.sortFunction;a=a.direction;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");z.call(this);this.Direction=a;this.sortFunc=this.defaultSort;this.SortFunction=d;this.PrimaryKey=c;this.Data=e}y(b,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.getData()}},{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"Direction",
set:function(a){this.direction="boolean"===typeof a?a:!0},get:function(){return this.direction}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)},get:function(){return this.primaryKey}}]);return b}();var z=function(){var b=this;this.primaryKey=null;this.direction=!0;this.data=[];this.currentName=null;this.setData=function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;Array.isArray(a)?(b.data=a,c&&b.sortData()):b.data=[]};this.setSortFunction=function(a){"function"===typeof a&&
c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=a.data,c=a.primaryKey,d=a.sortFunction;a=a.direction;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");z.call(this);this.Direction=a;this.sortFunc=this.defaultSort;this.SortFunction=d;this.PrimaryKey=c;this.Data=e}y(b,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.data}},{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"Direction",set:function(a){this.direction=
"boolean"===typeof a?a:!0},get:function(){return this.direction}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)},get:function(){return this.primaryKey}}]);return b}();var z=function(){var b=this;this.primaryKey=null;this.direction=!0;this.data=[];this.currentName=null;this.setData=function(a){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(!Array.isArray(a))return b.data=[],[];b.data=a;c&&b.sortData();return b.data};this.setSortFunction=function(a){"function"===typeof a&&
(b.sortFunc=a,b.isCustomFunction=!0)};this.setPrimaryKey=function(a){!b.isCustomFunction&&"string"===typeof a&&0<a.length&&(b.primaryKey=a,null===b.currentName&&(b.currentName=a),b.setOwnSortFunction())};this.removePrimaryKey=function(){b.primaryKey=null;b.setOwnSortFunction()};this.setDefaultSort=function(){b.isCustomFunction=!1;b.setOwnSortFunction()};this.comparePrimaryKey=function(a,c){a=a[b.primaryKey];c=c[b.primaryKey];return a===c?0:a>c===b.direction?1:-1};this.compare=function(a,c){a=a[b.currentName];
c=c[b.currentName];return a===c?0:a>c===b.direction?1:-1};this.sortBy=function(a){if(b.currentName===a)return b.reverseData();b.currentName=a;b.setOwnSortFunction();return b.sortData()};this.setOwnSortFunction=function(){var a=b.primaryKey,c=b.currentName;b.isCustomFunction||(b.sortFunc=null!==a&&a!==c?b.defaultSortWithKey:b.defaultSort)};this.defaultSortWithKey=function(a,c){var e=a[b.currentName],d=c[b.currentName];return e===d?b.comparePrimaryKey(a,c):e>d===b.direction?1:-1};this.defaultSort=function(a,
c){return b.compare(a,c)};this.sortData=function(){b.currentName&&(b.data=b.data.sort(b.sortFunc));return b.data};this.reverseData=function(){b.data=b.data.reverse();return b.data};this.getData=function(){return b.data}};c=(k=Object.freeze({default:c}))&&c||k;var n=c["default"]?c["default"]:c,A=function(){function b(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(a,c,d){c&&b(a.prototype,
c);d&&b(a,d);return a}}();c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=a.data;a=a.sortEngine;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");B.call(this);this.filters={};this.SortEngine=a;this.Data=c;this.filtered=this.data}A(b,[{key:"Data",set:function(a){this.setData(a)},get:function(){return this.data}},{key:"FilteredData",get:function(){return this.getFilteredData()}},{key:"SortEngine",set:function(a){a instanceof
n?(this.sortEngine=a,this.updateFce=this.filterWSort):(this.sortEngine=null,this.updateFce=this.filterWOSort)},get:function(){return this.sortEngine}}]);return b}();c.FilterValue=m;c.Sort=n;var B=function(){var b=this;this.updateFce=this.filterWOSort;this.data=[];this.filtered=[];this.sortEngine=null;this.setData=function(a){Array.isArray(a)&&(b.data=a,b.updateFilter());b.data=[]};this.createFilter=function(a,b,c){return new m(a,b,c)};this.addFilter=function(a,c,d){return b.update(b.createFilter(a,
c,d))};this.update=function(){for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];var f=b.getFilteredData;c.forEach(function(a){if(!(a instanceof m))throw new TypeError(a+" has to have filterValue instance");b.filters[a.Name]=a;f=b.updateFilter});return f()};this.removeFilters=function(){for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];var f=b.getFilteredData;c.forEach(function(a){a="string"===typeof a?a:a.Name;b.filters[a]&&(delete b.filters[a],f=b.updateFilter)});
return f()};this.clearFilters=function(){b.filters={};b.filtered=b.updateFce(b.data);return b.filtered};this.updateFilter=function(){b.filtered=b.updateFce(b.data.filter(b.filterAll));return b.filtered};this.filterAll=function(a){return Object.keys(b.filters).every(function(c){return b.filters[c].compare(a[c])})};this.getFilteredData=function(){return b.filtered};this.filterWOSort=function(){return b.filtered};this.filterWSort=function(){return b.SortEngine.setData(b.filtered)};this.getFilter=function(a){return b.filters[a]?
b.filters[a]:null}};c=(k=Object.freeze({default:c}))&&c||k;var q=c["default"]?c["default"]:c,C=function(){function b(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(a,c,d){c&&b(a.prototype,c);d&&b(a,d);return a}}();c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=a.data,d=a.primaryKey,f=a.sortFunction;a=a.direction;if(!(this instanceof
b))throw new TypeError("Cannot call a class as a function");D.call(this);this.filterEngine=new q({data:c,sortEngine:new n({data:c,primaryKey:d,sortFunction:f,direction:a})})}C(b,[{key:"FilterEngine",get:function(){return this.filterEngine}},{key:"SortEngine",get:function(){return this.filterEngine.SortEngine}},{key:"Data",set:function(a){this.setData(a)},get:function(){return this.getData()}}]);return b}();c.Filter=q;c.Sort=n;c.FilterValue=m;var D=function(){var b=this;this.setData=function(a){return b.FilterEngine.setData(a)};
this.updateFilters=function(){var a;return(a=b.FilterEngine).update.apply(a,arguments)};this.removeFilters=function(){var a;return(a=b.FilterEngine).removeFilters.apply(a,arguments)};this.createFilter=function(a,c,d){return b.FilterEngine.createFilter(a,c,d)};this.clearFilters=function(){return b.FilterEngine.clearFilters()};this.setSortFunction=function(a){return b.SortEngine.setSortFunction(a)};this.setPrimaryKey=function(a){return b.SortEngine.setPrimaryKey(a)};this.removePrimaryKey=function(){return b.SortEngine.removePrimaryKey()};
this.setDefaultSort=function(){return b.SortEngine.setDefaultSort()};this.sortBy=function(a){return b.SortEngine.sortBy(a)};this.getData=function(){return b.FilterEngine.FilteredData}};c=(k=Object.freeze({default:c}))&&c||k;return c["default"]?c["default"]:c});
c){return b.compare(a,c)};this.sortData=function(){b.currentName&&(b.data=b.data.sort(b.sortFunc));return b.data};this.reverseData=function(){b.data=b.data.reverse();return b.data};this.getData=function(){return b.Data}};c=(k=Object.freeze({default:c}))&&c||k;var n=c["default"]?c["default"]:c,A=function(){function b(a,b){for(var c=0;c<b.length;c++){var e=b[c];e.enumerable=e.enumerable||!1;e.configurable=!0;"value"in e&&(e.writable=!0);Object.defineProperty(a,e.key,e)}}return function(a,c,d){c&&b(a.prototype,
c);d&&b(a,d);return a}}();c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=a.data;a=a.sortEngine;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");B.call(this);this.filters={};this.SortEngine=a;this.Data=c;this.filtered=this.getData()}A(b,[{key:"Data",set:function(a){a&&Array.isArray(a)&&(this.data=a,this.updateFilter());this.data=[];this.filtered=[]},get:function(){return this.getData()}},{key:"FilteredData",get:function(){return this.getFilteredData()}},
{key:"SortEngine",set:function(a){a instanceof n?(this.sortEngine=a,this.updateFce=this.filterWSort):(this.sortEngine=null,this.updateFce=this.filterWOSort)},get:function(){return this.sortEngine}}]);return b}();c.FilterValue=m;c.Sort=n;var B=function(){var b=this;this.updateFce=this.filterWOSort;this.data=[];this.filtered=[];this.sortEngine=null;this.setData=function(a){b.Data=a};this.getData=function(){return b.data};this.createFilter=function(a,b,c){return new m(a,b,c)};this.addFilter=function(a,
c,d){return b.update(b.createFilter(a,c,d))};this.update=function(){for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];var f=b.getFilteredData;c.forEach(function(a){if(!(a instanceof m))throw new TypeError(a+" has to have filterValue instance");b.filters[a.Name]=a;f=b.updateFilter});return f()};this.removeFilters=function(){for(var a=arguments.length,c=Array(a),d=0;d<a;d++)c[d]=arguments[d];var f=b.getFilteredData;c.forEach(function(a){a="string"===typeof a?a:a.Name;b.filters[a]&&
(delete b.filters[a],f=b.updateFilter)});return f()};this.clearFilters=function(){b.filters={};b.updateFilter();return b.FilteredData};this.updateFilter=function(){b.filtered=b.updateFce(b.data.filter(b.filterAll));return b.FilteredData};this.filterAll=function(a){return Object.keys(b.filters).every(function(c){return b.filters[c].compare(a[c])})};this.getFilteredData=function(){return b.filtered};this.filterWOSort=function(a){return a};this.filterWSort=function(a){return b.SortEngine.setData(a)};
this.getFilter=function(a){return b.filters[a]?b.filters[a]:null}};c=(k=Object.freeze({default:c}))&&c||k;var q=c["default"]?c["default"]:c,C=function(){function b(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(a,c,d){c&&b(a.prototype,c);d&&b(a,d);return a}}();c=function(){function b(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=a.data,d=a.primaryKey,f=
a.sortFunction;a=a.direction;if(!(this instanceof b))throw new TypeError("Cannot call a class as a function");D.call(this);this.filterEngine=new q({data:c,sortEngine:new n({data:c,primaryKey:d,sortFunction:f,direction:a})})}C(b,[{key:"FilterEngine",get:function(){return this.filterEngine}},{key:"SortEngine",get:function(){return this.filterEngine.SortEngine}},{key:"Data",set:function(a){this.setData(a)},get:function(){return this.FilterEngine.FilteredData}}]);return b}();c.Filter=q;c.Sort=n;c.FilterValue=
m;var D=function(){var b=this;this.setData=function(a){b.filterEngine.Data=a};this.updateFilters=function(){var a;return(a=b.FilterEngine).update.apply(a,arguments)};this.removeFilters=function(){var a;return(a=b.FilterEngine).removeFilters.apply(a,arguments)};this.addFilter=function(a,c,d){return b.FilterEngine.addFilter(a,c,d)};this.clearFilters=function(){return b.FilterEngine.clearFilters()};this.setSortFunction=function(a){return b.SortEngine.setSortFunction(a)};this.setPrimaryKey=function(a){return b.SortEngine.setPrimaryKey(a)};
this.removePrimaryKey=function(){return b.SortEngine.removePrimaryKey()};this.setDefaultSort=function(){return b.SortEngine.setDefaultSort()};this.sortBy=function(a){return b.SortEngine.sortBy(a)};this.getData=function(){return b.Data}};c=(k=Object.freeze({default:c}))&&c||k;return c["default"]?c["default"]:c});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc