Skip to content

Instantly share code, notes, and snippets.

@jfkhoury
jfkhoury / disallow-new.js
Created September 1, 2016 13:03 — forked from mattdesl/disallow-new.js
avoiding new in classes
// Allows:
// funkyParser()
module.exports = function createFunkyParser(opt) {
return new FunkyParser(opt)
}
function FunkyParser(opt) {
// make params optional
opt = opt || {}