1.0.1 • Published 7 years ago

object-visit v1.0.1

Weekly downloads
16,117,826
License
MIT
Repository
github
Last release
7 years ago

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

Call a specified method on each value in the given object.

Install

Install with npm:

$ npm install --save object-visit

Usage

var visit = require('object-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.

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.6.0, on May 30, 2017.

collection-visitmap-visitarchetype-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-object-@saaspe/componentsplginexpand-react-bridge@everything-registry/sub-chunk-2365ond@arielapaula/components@arielapaula/testant-design-draggable-modal-4ant-design-draggable-modal-fixant-design-draggable-modal-fix-2@apardellass/react-native-audio-stream@anonybit-modules/videoreconstruction@ansonhkg/utils@_nomtek/react-native-shimmer-animation@afria/afria-libraries@affinidi/affinidi-auth-sdk-kernel@adembacaj/react-native-google-pay@amirdiafi/react-native-ios-haptics@wecraftapps/react-native-use-keyboard@alexshmyrkov/react-ranger@beldore/react-otp-input@benovshe/sasslibraryawesome-module-kdawesome-react-starsappcharge-checkoutappcharge-checkout-reactjs-sdk@asiz33/smartblok-vendure-pluginap-vue-captchaarifbudixz@aysea/react-native-ui-library@behzadebrhm/utilsbackend-testing-core@bonsaiswap-lib/lib@bonsaiswapv3/core@bonsaiswapv3/deploybain@brantalikp/rn-resize@baloochat/react-native-svg-uriasync-computed-vue3async-bus@borealisswap/borealis-swap-lib@bezael-challenge/innoit-date-formataxios-yet-another-proxy-fixaxonv2sdk@buganto/clientbase-editor@chakra-swap/corebinary-booking-calendarbirken-react-native-community-image-editor@cdevine49/react-numeric-inputbiometric-st@cryptocode99/token-lists@cs6/react-native-test-native-view-library
1.0.1

7 years ago

1.0.0

7 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

9 years ago

0.3.0

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago