0.3.0 • Published 8 years ago

to-object-path v0.3.0

Weekly downloads
16,121,349
License
MIT
Repository
github
Last release
8 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-bridgeond@maricode1111/date-lib@marinaga/bananize@massivepixel/use-query@simstudio/htmldiff@brucearmstrong/sass-librarylayui-custom@ko-developerhong/react-native-multiple-image-picker@kodinghandle/bullswap-lib@kristoffertonning/vue-laravel-errors@lanz1/v-money3@lehuyaa/my-assets@lego-js/tests@levlevin/react-portal-tooltip@lofcz/sweetalert2-neutral@litedexdev/litedex-core-swap@lordbeanbag/vite-plugin-svg-icons-monorepo@moezx/metinggrid-component-react-ex-1@oiti/rn-liveness2dgrids-over-polygon@olympfin/olymp-swap-libgriffin-ui-librarygoogle-remake@nyaxk/react-one-tab-enforcer@openpolitica/matomo-next@materia-dex/materia-contracts-proxy@meklitc7/date-library@meklitc7/string-library@meerasolution/react-native-ms-upi-paymentfrdrk-js-semaphore@meysam213/react-leafletforminput-ui-lib@maujzs/branch-release@min98/layui-custom@nandhakumarb/npm_samplegaurav-react-native-loopgenerator-bootstrap-boilerplate-templategenerator-liuhuijun-vue@navabi/react-native-ssl-pinning@ndjoe/react-native-bluetooth-escpos-printer@ngxvoice/ngx-voicelistnergenz-native-elements@neuraiproject/chainsgix-npm-server@krwhitley/neataptic@icetee/react-recaptcha-v3@kirrosh/pts@refactorpro/pixi-virtual-joystick@resystem/ida-js-sdk@sackmanson/quill-image-uploader@safely-project/safely-ts
0.3.0

8 years ago

0.2.0

9 years ago

0.1.0

9 years ago