0.3.0 • Published 9 years ago

to-object-path v0.3.0

Weekly downloads
16,121,349
License
MIT
Repository
github
Last release
9 years ago

to-object-path NPM version

Create an object path from a list or array of strings.

Install

Install with npm

$ npm i to-object-path --save

Usage

var toPath = require('to-object-path');

toPath('foo', 'bar', 'baz');
toPath('foo', ['bar', 'baz']);
//=> 'foo.bar.baz'

Also supports passing an arguments object (without having to slice args):

function foo()
  return toPath(arguments);
}

foo('foo', 'bar', 'baz');
foo('foo', ['bar', 'baz']);
//=> 'foo.bar.baz'

Visit the example to see how this could be used in an application.

Related projects

  • get-value: Use property paths (a.b.c) to get a nested value from an object. | homepage
  • has-value: Returns true if a value exists, false if empty. Works with deeply nested values using… more | homepage
  • omit-value: Omit properties from an object or deeply nested property of an object using object path… more | homepage
  • set-value: Create nested values and any intermediaries using dot notation ('a.b.c') paths. | homepage
  • unset-value: Delete nested properties from an object using dot notation. | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on October 28, 2015.

archetype-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-to-@saaspe/componentsplginexpand-react-bridgeondgriffin-ui-librarytailwind-vector-effectsyncbackbasestest-carosello-campustest-library-123test-haptik-libteadanteatest-npm-jjmessivue-button-test1webchewoven-challenge-deployxdms3wifi_configuration_packagern-tm-notifyrn-use-modal-hookrn-counter-demorn-session-multiplier-demorn_unique_device_idrnttlocksharingcomponent2set-gettersamc2samc3samc4samc5sam-carouselresponsive-react-appreikamoon-string-library-aarn-adyen-dropinrn-my-libraryrn-pay-sdksuperset-plugin-chart-hello-world2supercluster-googlemaps-adapter-clonestechfox-icontechfox-react-featherspotify-ds-sesticky-scroll-catchstp-cdksequelcomponentreact-native-wtfreact-native-version-appreyhan-projecttestapateste_cegidtestnpm_lmnsvelte-component-libtextfield-samplevue-compmentvision-camera-plugin-scan-facesvision-camera-base64-resizedvcloudcam-playkit-js-hls
0.3.0

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago