Socket
Book a DemoInstallSign in
Socket

mh-populate

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mh-populate

populate between two array with out loop

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

MH Populate

mhPopulate A JavaScript Libary which will populate data between arrays with n looping and high performance

Buy Me A Coffee

Installation

npm install mh-populate

Usage

import * as mhPopulate from 'mh-populate';

let countryArray = [  
  {'name': 'Afghanistan', 'code': 'AF'},  
  {'name': 'land Islands', 'code': 'AX'},  
  {'name': 'Albania', 'code': 'AL'},  
  {'name': 'Algeria', 'code': 'DZ'},  
  {'name': 'American Samoa', 'code': 'AS'},  
  {'name': 'AndorrA', 'code': 'AD'},  
 .....
];

let codeArray = [  
  {'lat': '555.555','lng':'555.555','code': 'AF',...},  
  {'lat': '555.555','lng':'555.555','code': 'AX',...},  
  {'lat': '555.555','lng':'555.555','code': 'AL'},  
  {'lat': '555.555','lng':'555.555','code': 'DZ'},  
  {'lat': '555.555','lng':'555.555','code': 'AS'},  
  {'lat': '555.555','lng':'555.555','code': 'AD'},  
 .....
];


mhPopulate(countryArray, codeArray, 'code')

AttributeTypeDescripton
originalArrayArraydata that include foreign key
populateArrayArraypopulate data
keyStringforeign key
populateKeyStringpopulate key
isNumberBooleanis populate value number, by default false

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Keywords

populate

FAQs

Package last updated on 02 Apr 2021

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.