esformatter-dot-notation
esformatter plugin for transforming object bracket usage to dot notation
esformatter-dot-notation is a plugin for esformatter meant to convert accessing object properties with brackets into dot notation where valid.
This module uses unquoted-property-validator which uses Mathias Bynens implementation in order to validate if a property name is a valid identifier name and can be used with dot notation.
That means invalid identifiers will not be converted and your code is safe for transformations (see tests).
Turn this:
someObject'property' = true;
into:
someObjectproperty = true;
Installation
$ npm install esformatter-dot-notation --save-dev
Config
Newest esformatter versions autoload plugins from your node_modules
See this
Add to your esformatter config file:
Or you can manually register your plugin:
var dotNotation = ;// register pluginesformatter;
Usage
var fs = ;var esformatter = ;//register plugin manuallyesformatter; var str = fs;var output = esformatter;//-> output will now contain the formatted string
See esformatter for more options and further usage.
License
MIT @Gilad Peleg