JSPM

accessory

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28743
  • Score
    100M100P100Q141027F
  • License MIT

Create property accessor/caller statements for dot paths

Package Exports

  • accessory

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (accessory) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

accessory Build Status

Create property accessor/caller statements for dot paths

Install

$ npm install --save accessory

Usage

var accessory = require('accessory')

accessory('window', 'foo.bar')
//=> window['foo']['bar']

accessory('window', 'foo\\.bar')
//=> window['foo.bar']

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

API

accessory(source, path) -> string

source

Required
Type: string

The source identifier which will prepend the accessors.

path

Required
Type: string

A dot property path, including function calls.

License

MIT © Ben Drucker