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

arraytrans

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arraytrans

Do complex array transformation based on substrings to change order of array

  • 0.0.3
  • Source
  • npm
  • Socket score

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

Array Transform

Description: This module is used to do complex array transformations based on substrings to change the order of an array.

npm install arraytrans --save


var arrayTrans = require('arraytrans')

Method requires

1.The array to transform.
2.Array of substrings in proper order.
3.Base string the substrings will be pulled from.
4.Location you want values that do not include base string(start or end or null). If null will try best to reconstruct close to original array.

###example:

var testArr = 
['basestring.arrayone.one',
'nobase1',
'basestring.arrayone.two',
'nobase2',
'basestring.arrayone.three',
'basestring.arraytwo.one',
'basestring.arraytwo.two',
'basestring.arraytwo.three',
'basestring.arraythree.one',
'basestring.arraythree.two',
'basestring.araythree.three'];


console.log(ArrayTrans(testArr,['arraytwo','arrayone','arraythree'],'basestring','start'));	

//OUTPUT=========================

[ 'nobase1',
'nobase2',
'basestring.arraytwo.three',
'basestring.arraytwo.two',
'basestring.arraytwo.one',
'basestring.arrayone.three',
'basestring.arrayone.two',
'basestring.arrayone.one',
'basestring.arraythree.two',
'basestring.arraythree.one',
'basestring.araythree.three' ]	

Keywords

FAQs

Package last updated on 29 Dec 2015

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