1.0.0 • Published 7 years ago

collection-visit v1.0.0

Weekly downloads
16,149,530
License
MIT
Repository
github
Last release
7 years ago

collection-visit NPM version NPM monthly downloads NPM total downloads Linux Build Status

Visit a method over the items in an object, or map visit over the objects in an array.

Install

Install with npm:

$ npm install --save collection-visit

Usage

var visit = require('collection-visit');

var ctx = {
  data: {},
  set: function (key, value) {
    if (typeof key === 'object') {
      visit(ctx, 'set', key);
    } else {
      ctx.data[key] = value;
    }
  }
};

ctx.set('a', 'a');
ctx.set('b', 'b');
ctx.set('c', 'c');
ctx.set({d: {e: 'f'}});

console.log(ctx.data);
//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }};

About

Related projects

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

CommitsContributor
13jonschlinkert
9doowb

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.5.0, on April 09, 2017.

cache-basearchetype-librarycomponennenttvuedragdropuploadimagespopsmart-common-authreact-native-bluetooth2killi8n-react-native-fast-imagern-send-smsspecify-importsbabel-specify-imports@icanpm/api-mastergew-nodejs-api-client@arisageha/react-lazyload@arisageha/react-lazyload-fix@cashremit/cr-streamline-iconsreact-native-template-rfbasecloud-archive-s3airscanairscan-examplebb-chatreact-native-esc-pos-sahaab@borisovart/atol-kkt-module@frxf/frxf@phil8795/pecuniarius-apideneme323112@texttree/demo-bsa-reference-rcl@fundefund/funde_ck@ntt_app/react-native-custom-notificationreact-native-custom-text-hwjamesreact-native-covid-sdkgql_din_modbitgetreact-native-thanh-toast-library@thanhnguyen14797/react-native-thanh-toast-library@l1nyanm1ng/react-picture-viewercthpb-plugin-socialreact-native-printer-brothersrn-pdf-reader-offlinereact-native-shekhar-bridge-testwilscanner@oiti/documentoscopy-react-nativejs4cytoscape@mink-opn/build-tokensquoc-testreact-native-slider-kf@infinitebrahmanuniverse/nolb-coll@saaspe/componentsplginexpand-react-bridge@everything-registry/sub-chunk-1354ondreact-native-animate-textreact-native-android-video-player-viewreact-native-badge-controlreact-native-basic-screenreact-native-bubble-chartreact-native-create-video-thumbnailreact-native-cplusdesign-system-fitbank-450demo-component-skyflyer86react-misc-toolboxreact-native-additionreact-native-arps-authorize-netreact-native-arun-ramya-testreact-native-arunjeyam1987react-native-arunmeena1987react-native-arunramya151react-native-bluetooth-device-detectreact-native-bleccs-componentsreact-native-biometric-authenticatereact-native-check-componentreact-native-chenaarreact-native-contact-listsequelcomponentsharingcomponent2dskcorenewsimply-uisipengine-modaleditorjs-alerticonssmtrsnippetstock-ticker-react-widgetes-react-bridgestnenopmoc-iusticky-scroll-catchstart-starwars-libstp-cdkreact-native-reanimated-sortable-listreact-native-rom-componentsreact-native-get-countriesreact-native-innity-2react-native-innity-remasterreact-native-input-libraryreact-native-plugpag-wrapperreact-native-remote-cloverreact-native-screen-idle-timerreact-native-scroll-tab-to-indexreact-native-payu-payment-testingreact-native-responsive-sizereact-native-return-usb-data
1.0.0

7 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago