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

fast-sort

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-sort - npm Package Compare versions

Comparing version 3.2.0 to 3.2.1

1

dist/sort.d.ts

@@ -58,4 +58,5 @@ declare type IOrder = 1 | -1;

export declare function createNewSortInstance(opts: ISortInstanceOptions): <T>(_ctx: T[]) => IFastSort<T>;
export declare const defaultComparer: (a: any, b: any, order: any) => number;
export declare const sort: <T>(_ctx: readonly T[]) => IFastSort<T>;
export declare const inPlaceSort: <T>(_ctx: T[]) => IFastSort<T>;
export {};

2

dist/sort.es.js

@@ -115,2 +115,2 @@ // >>> INTERFACES <<<

export { createNewSortInstance, inPlaceSort, sort };
export { createNewSortInstance, defaultComparer, inPlaceSort, sort };

@@ -122,2 +122,3 @@ (function (global, factory) {

exports.createNewSortInstance = createNewSortInstance;
exports.defaultComparer = defaultComparer;
exports.inPlaceSort = inPlaceSort;

@@ -124,0 +125,0 @@ exports.sort = sort;

@@ -58,4 +58,5 @@ declare type IOrder = 1 | -1;

export declare function createNewSortInstance(opts: ISortInstanceOptions): <T>(_ctx: T[]) => IFastSort<T>;
export declare const defaultComparer: (a: any, b: any, order: any) => number;
export declare const sort: <T>(_ctx: readonly T[]) => IFastSort<T>;
export declare const inPlaceSort: <T>(_ctx: T[]) => IFastSort<T>;
export {};

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

!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r="undefined"!=typeof globalThis?globalThis:r||self)["fast-sort"]={})}(this,function(r){"use strict";function u(t){return function(r,n,e){return t(r,n,e)*e}}var c=function(r,n){if(r)throw Error("Invalid sort config: "+n)},d=function(r){var n=r||{},e=n.asc,t=n.desc,o=e?1:-1,i=e||t;return c(!i,"Expected `asc` or `desc` property"),c(e&&t,"Ambiguous object with `asc` and `desc` config properties"),{order:o,sortBy:i,comparer:r.comparer&&u(r.comparer)}},f=function(p){return function r(n,e,t,o,i,u,c){var f,a;if("string"==typeof n)f=u[n],a=c[n];else{if("function"!=typeof n){var s=d(n);return r(s.sortBy,e,t,s.order,s.comparer||p,u,c)}f=n(u),a=n(c)}var l=i(f,a,o);return(0===l||null==f&&null==a)&&e.length>t?r(e[t],e,t+1,o,i,u,c):l}};function o(r,n,e,t){return Array.isArray(n)?(Array.isArray(e)&&e.length<2&&(e=e[0]),n.sort(function r(e,t,o){if(void 0===e||!0===e)return function(r,n){return t(r,n,o)};if("string"==typeof e)return c(e.includes("."),"String syntax not allowed for nested properties."),function(r,n){return t(r[e],n[e],o)};if("function"==typeof e)return function(r,n){return t(e(r),e(n),o)};if(Array.isArray(e)){var i=f(t);return function(r,n){return i(e[0],e,1,o,t,r,n)}}var n=d(e);return r(n.sortBy,n.comparer||t,n.order)}(e,t,r))):n}function n(e){var t=u(e.comparer);return function(r){var n=Array.isArray(r)&&!e.inPlaceSorting?r.slice():r;return{asc:function(r){return o(1,n,r,t)},desc:function(r){return o(-1,n,r,t)},by:function(r){return o(1,n,r,t)}}}}function e(r,n,e){return null==r?e:null==n?-e:r<n?-1:n<r?1:0}var t=n({comparer:e}),i=n({comparer:e,inPlaceSorting:!0});r.createNewSortInstance=n,r.inPlaceSort=i,r.sort=t,Object.defineProperty(r,"__esModule",{value:!0})});
!function(r,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((r="undefined"!=typeof globalThis?globalThis:r||self)["fast-sort"]={})}(this,function(r){"use strict";function u(t){return function(r,n,e){return t(r,n,e)*e}}var c=function(r,n){if(r)throw Error("Invalid sort config: "+n)},d=function(r){var n=r||{},e=n.asc,t=n.desc,o=e?1:-1,i=e||t;return c(!i,"Expected `asc` or `desc` property"),c(e&&t,"Ambiguous object with `asc` and `desc` config properties"),{order:o,sortBy:i,comparer:r.comparer&&u(r.comparer)}},f=function(p){return function r(n,e,t,o,i,u,c){var f,a;if("string"==typeof n)f=u[n],a=c[n];else{if("function"!=typeof n){var s=d(n);return r(s.sortBy,e,t,s.order,s.comparer||p,u,c)}f=n(u),a=n(c)}var l=i(f,a,o);return(0===l||null==f&&null==a)&&e.length>t?r(e[t],e,t+1,o,i,u,c):l}};function o(r,n,e,t){return Array.isArray(n)?(Array.isArray(e)&&e.length<2&&(e=e[0]),n.sort(function r(e,t,o){if(void 0===e||!0===e)return function(r,n){return t(r,n,o)};if("string"==typeof e)return c(e.includes("."),"String syntax not allowed for nested properties."),function(r,n){return t(r[e],n[e],o)};if("function"==typeof e)return function(r,n){return t(e(r),e(n),o)};if(Array.isArray(e)){var i=f(t);return function(r,n){return i(e[0],e,1,o,t,r,n)}}var n=d(e);return r(n.sortBy,n.comparer||t,n.order)}(e,t,r))):n}function n(e){var t=u(e.comparer);return function(r){var n=Array.isArray(r)&&!e.inPlaceSorting?r.slice():r;return{asc:function(r){return o(1,n,r,t)},desc:function(r){return o(-1,n,r,t)},by:function(r){return o(1,n,r,t)}}}}function e(r,n,e){return null==r?e:null==n?-e:r<n?-1:n<r?1:0}var t=n({comparer:e}),i=n({comparer:e,inPlaceSorting:!0});r.createNewSortInstance=n,r.defaultComparer=e,r.inPlaceSort=i,r.sort=t,Object.defineProperty(r,"__esModule",{value:!0})});
{
"name": "fast-sort",
"version": "3.2.0",
"version": "3.2.1",
"description": "Fast easy to use and flexible sorting with TypeScript support",

@@ -21,3 +21,3 @@ "main": "dist/sort.min.js",

"build": "npm run test && rm -rf dist && rollup -c",
"prepublish": "npm run build && npm run test:integration:dist",
"prepublishOnly": "npm run build && npm run test:integration:dist",
"postpublish": "npm run test:integration:npm"

@@ -51,3 +51,3 @@ },

"eslint-plugin-import": "^2.22.1",
"mocha": "^8.3.1",
"mocha": "^10.2.0",
"rollup": "^2.41.1",

@@ -54,0 +54,0 @@ "rollup-plugin-copy": "^3.4.0",

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