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

Data engine is small data management lib for some sort and filter.

  • 1.0.2-rc.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

SORT

Creating new Sort

    const sort = new Sort(data);
    const sort2 = new Sort(data, 'Primary key');
    const sort3 = new Sort(data, 'Primary key', CustomSortFunction);
    // Data = Array of some json objects, primary key = fallback name for sort when data of same key have same value, CustomSortFunction = Custom function which will be called when you call sortBy

Updating data

    // this line will return data as is.
    const data = sort.updateData(newData);
    // This line will resort data.
    const data2 = sort.updateData(newData, true);

Updating criteria

    sort.setSortFunction(CustomFunction);
    sort.setPrimaryKey('new key');

Removing criteria

    sort.removePrimaryKey();
    sort.setDefaultSort();

Sorting data

    const data = sort.sortBy('name');

Getting data

    const data = sort.getData();

Resorting data

    const data = sort.justSort();

WHAT NEXT

Add promise like for big data!

Test all usecases

Set filter-value manually

Keywords

FAQs

Package last updated on 05 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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