sort-cost-center
v1.0.3
Published
Generate the unique list of cost centers ordered alphabetically from a given array of cost center.
Downloads
23
Readme
Sort Cost Center Module
Generate the unique list of cost centers ordered alphabetically from a given array of cost center.
Example:
Input: [ [“100”, “Cost Center B”], [“200”, “Cost Center A”], [“100”, “Cost Center B”], …]
Output: [
{
“id”: “200”,
“name”: “Cost Center A”
},
{
“id”: “100”,
“name”: “Cost Center B”
},
…
]
Usage
const sortCostCenter = require('sort-cost-center');
const input = [["100", "Cost Center B"], ["200", "Cost Center A"], ["100", "Cost Center B"]];
console.log(sortCostCenter(input));