fuck-comma

1.0.1 • Public • Published

fuck-comma

A safe way to remove redundant commas for IE6/7.

Keep the last comma within an Array or Object cause errors on IE6/7, for example:

var arr = [1,2,]
var obj = {foo: 'bar',}

Find out these errors very hard, But now you may just run fuck-comma to fixes it, have fun!

Based on AST engine

npm version npm version Issue Stats Issue Stats

INSTALL

$ npm i fuck-comma -g

USAGE

Commandline

  • Fix all .js in current directory.
$ fuck-comma
  • Fix all .js for spec directory.
$ fuck-comma /some/path
  • Fix spec file.
 
$ fuck-comma /some/file

As module

var fuckComma = require('fuckComma')
 
console.log(fuckComma('[1, 2, 3,]')) // [1, 2, 3]

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.10latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.10
1.0.00

Package Sidebar

Install

npm i fuck-comma

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • leecade