githubEdit

to-object-path

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

Install

Install with npmarrow-up-right

$ 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 examplearrow-up-right to see how this could be used in an application.

Running tests

Install dev dependencies:

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issuearrow-up-right.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cliarrow-up-right on October 28, 2015.

Last updated