Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

telperiontech/maslak

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maslak

alt text

Travis Coverage Status npm

The Maslak library converts your flat object to key and value objects, and then sort it by the given array. It's simple & basic.

Documentation

Installation

npm i maslak

Usage

Basic Usage

const DataTransform = require("maslak");
const testCase1 = {
  data2: "value2",
  data1: "value1",
  data3: 3
};

const transform = new DataTransform(testCase1).result;
console.log(transform); // [ { key: 'data2', value: 'value2' },{ key: 'data1', value:'value1'},{ key: 'data3', value: 3 } ] //

Sorted Usage

const DataTransform = require("maslak");
const testCase1 = {
  data2: "value2",
  data1: "value1",
  data3: 3
};

const sortRule = ["data1", "data2", "data3"];

const transform = new DataTransform(testCase1).dataSort(sortRule).result;
console.log(transform); // [ { key: 'data1', value:'value1'},{ key: 'data2', value: 'value2' },{ key: 'data3', value: 3 } ] //

About

The Maslak library converts your flat object to key and value objects, and then sort it by the given array.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.