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

data-sort

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-sort - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2-rc.1

18

cjs/data-sort.development.js

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

/** @license Data-Engine v2.0.1
/** @license Data-Engine v2.0.2-rc.1
* data-sort.development.js

@@ -227,5 +227,3 @@ *

_this.primaryKey = '';
if (!_this.isCustomFunction) {
_this.setSortFunction();
}
_this.setSortFunction();
};

@@ -259,9 +257,13 @@

this.setSortFunction = function () {
if (_this.isCustomFunction) {
var isCustomFunction = _this.isCustomFunction,
primaryKey = _this.primaryKey,
currentName = _this.currentName;
if (isCustomFunction) {
return;
}
if (_this.currentName === _this.primaryKey) {
if (primaryKey && primaryKey !== currentName) {
_this.sortFunc = _this.defaultSortWithKey;
} else {
_this.sortFunc = _this.defaultSort;
} else {
_this.sortFunc = _this.defaultSortWithKey;
}

@@ -268,0 +270,0 @@ };

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

/** @license Data-Engine v2.0.1
/** @license Data-Engine v2.0.2-rc.1
* data-sort.production.min.js

@@ -11,4 +11,4 @@ *

g.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setSortFunction(e);this.setPrimaryKey(c);this.setData(b)}f(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)}}]);return a}();
function g(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=b;return c?a.sortData():a.data};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){!a.isCustomFunction&&"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b),a.setSortFunction())};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||a.setSortFunction()};this.setDefaultSort=
function(){a.isCustomFunction=!1;a.setSortFunction()};this.comparePrimaryKey=function(b,c){b=b[a.primaryKey];c=c[a.primaryKey];return b===c?0:b>c?1:-1};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]?1:-1};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.setSortFunction();a.currentName=b;return a.sortData()};this.setSortFunction=function(){a.isCustomFunction||(a.sortFunc=a.currentName===a.primaryKey?a.defaultSort:a.defaultSortWithKey)};this.defaultSortWithKey=
function(b,c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)};this.defaultSort=function(b,c){return a.compare(b,c)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}}var k=Object.freeze({default:h}),l=k&&h||k;module.exports=l.default?l.default:l;
function g(){var a=this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=b;return c?a.sortData():a.data};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){!a.isCustomFunction&&"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b),a.setSortFunction())};this.removePrimaryKey=function(){a.primaryKey="";a.setSortFunction()};this.setDefaultSort=function(){a.isCustomFunction=
!1;a.setSortFunction()};this.comparePrimaryKey=function(b,c){b=b[a.primaryKey];c=c[a.primaryKey];return b===c?0:b>c?1:-1};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]?1:-1};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.setSortFunction();a.currentName=b;return a.sortData()};this.setSortFunction=function(){var b=a.primaryKey,c=a.currentName;a.isCustomFunction||(a.sortFunc=b&&b!==c?a.defaultSortWithKey:a.defaultSort)};this.defaultSortWithKey=function(b,
c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)};this.defaultSort=function(b,c){return a.compare(b,c)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}}var k=Object.freeze({default:h}),l=k&&h||k;module.exports=l.default?l.default:l;
{
"name": "data-sort",
"description": "Data engine is small data management lib for some sort and filter.",
"version": "2.0.1",
"version": "2.0.2-rc.1",
"keywords": [

@@ -6,0 +6,0 @@ "Data",

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

/** @license Engine v2.0.1
/** @license Engine v2.0.2-rc.1
* data-sort.development.js

@@ -229,5 +229,3 @@ *

_this.primaryKey = '';
if (!_this.isCustomFunction) {
_this.setSortFunction();
}
_this.setSortFunction();
};

@@ -261,9 +259,13 @@

this.setSortFunction = function () {
if (_this.isCustomFunction) {
var isCustomFunction = _this.isCustomFunction,
primaryKey = _this.primaryKey,
currentName = _this.currentName;
if (isCustomFunction) {
return;
}
if (_this.currentName === _this.primaryKey) {
if (primaryKey && primaryKey !== currentName) {
_this.sortFunc = _this.defaultSortWithKey;
} else {
_this.sortFunc = _this.defaultSort;
} else {
_this.sortFunc = _this.defaultSortWithKey;
}

@@ -270,0 +272,0 @@ };

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

/** @license Data-Engine v2.0.1
/** @license Data-Engine v2.0.2-rc.1
* data-sort.production.min.js

@@ -9,6 +9,6 @@ *

*/
'use strict';(function(e,b){"object"===typeof exports&&"undefined"!==typeof module?module.exports=b():"function"===typeof define&&define.amd?define(b):e.Sort=b()})(this,function(){var e=function(){function a(a,d){for(var c=0;c<d.length;c++){var b=d[c];b.enumerable=b.enumerable||!1;b.configurable=!0;"value"in b&&(b.writable=!0);Object.defineProperty(a,b.key,b)}}return function(c,d,b){d&&a(c.prototype,d);b&&a(c,b);return c}}(),b=function(){function a(){var c=0<arguments.length&&void 0!==arguments[0]?
arguments[0]:[],d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,b=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");g.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setSortFunction(b);this.setPrimaryKey(d);this.setData(c)}e(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)}}]);return a}(),g=function(){var a=
this;this.setData=function(c){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=c;return b?a.sortData():a.data};this.setSortFunction=function(c){"function"===typeof c&&(a.sortFunc=c,a.isCustomFunction=!0)};this.setPrimaryKey=function(c){!a.isCustomFunction&&"string"===typeof c&&0<c.length&&(a.primaryKey=c,null===a.currentName&&(a.currentName=c),a.setSortFunction())};this.removePrimaryKey=function(){a.primaryKey="";a.isCustomFunction||a.setSortFunction()};this.setDefaultSort=function(){a.isCustomFunction=
!1;a.setSortFunction()};this.comparePrimaryKey=function(c,b){c=c[a.primaryKey];b=b[a.primaryKey];return c===b?0:c>b?1:-1};this.compare=function(c,b){return c[a.currentName]>b[a.currentName]?1:-1};this.sortBy=function(c){if(a.currentName===c)return a.reverseData();a.setSortFunction();a.currentName=c;return a.sortData()};this.setSortFunction=function(){a.isCustomFunction||(a.sortFunc=a.currentName===a.primaryKey?a.defaultSort:a.defaultSortWithKey)};this.defaultSortWithKey=function(c,b){return c[a.currentName]===
b[a.currentName]?a.comparePrimaryKey(c,b):a.compare(c,b)};this.defaultSort=function(b,d){return a.compare(b,d)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}},f=Object.freeze({default:b});b=f&&b||f;return b.default?b.default:b});
'use strict';(function(e,d){"object"===typeof exports&&"undefined"!==typeof module?module.exports=d():"function"===typeof define&&define.amd?define(d):e.Sort=d()})(this,function(){var e=function(){function a(a,c){for(var b=0;b<c.length;b++){var d=c[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(a,d.key,d)}}return function(b,c,d){c&&a(b.prototype,c);d&&a(b,d);return b}}(),d=function(){function a(){var b=0<arguments.length&&void 0!==arguments[0]?
arguments[0]:[],c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!(this instanceof a))throw new TypeError("Cannot call a class as a function");g.call(this);this.currentName=null;this.sortFunc=this.defaultSort;this.setSortFunction(d);this.setPrimaryKey(c);this.setData(b)}e(a,[{key:"SortFunction",set:function(a){this.setSortFunction(a)}},{key:"PrimaryKey",set:function(a){this.setPrimaryKey(a)}}]);return a}(),g=function(){var a=
this;this.setData=function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;a.data=b;return c?a.sortData():a.data};this.setSortFunction=function(b){"function"===typeof b&&(a.sortFunc=b,a.isCustomFunction=!0)};this.setPrimaryKey=function(b){!a.isCustomFunction&&"string"===typeof b&&0<b.length&&(a.primaryKey=b,null===a.currentName&&(a.currentName=b),a.setSortFunction())};this.removePrimaryKey=function(){a.primaryKey="";a.setSortFunction()};this.setDefaultSort=function(){a.isCustomFunction=
!1;a.setSortFunction()};this.comparePrimaryKey=function(b,c){b=b[a.primaryKey];c=c[a.primaryKey];return b===c?0:b>c?1:-1};this.compare=function(b,c){return b[a.currentName]>c[a.currentName]?1:-1};this.sortBy=function(b){if(a.currentName===b)return a.reverseData();a.setSortFunction();a.currentName=b;return a.sortData()};this.setSortFunction=function(){var b=a.primaryKey,c=a.currentName;a.isCustomFunction||(a.sortFunc=b&&b!==c?a.defaultSortWithKey:a.defaultSort)};this.defaultSortWithKey=function(b,
c){return b[a.currentName]===c[a.currentName]?a.comparePrimaryKey(b,c):a.compare(b,c)};this.defaultSort=function(b,c){return a.compare(b,c)};this.sortData=function(){a.currentName&&(a.data=a.data.sort(a.sortFunc));return a.data};this.reverseData=function(){a.data=a.data.reverse();return a.data};this.getData=function(){return a.data}},f=Object.freeze({default:d});d=f&&d||f;return d.default?d.default:d});
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