Comparing version 0.0.2 to 0.0.3
@@ -18,8 +18,25 @@ 'use strict'; | ||
_classCallCheck(this, Parser); | ||
this._strictModeEnabled = true; | ||
} | ||
_createClass(Parser, [{ | ||
key: 'isStrictModeEnabled', | ||
value: function isStrictModeEnabled() { | ||
return this._strictModeEnabled; | ||
} | ||
}, { | ||
key: 'enableStrictMode', | ||
value: function enableStrictMode() { | ||
this._strictModeEnabled = true; | ||
} | ||
}, { | ||
key: 'disableStrictMode', | ||
value: function disableStrictMode() { | ||
this._strictModeEnabled = false; | ||
} | ||
}, { | ||
key: 'parse', | ||
value: function parse(code, mode) { | ||
var ast = this._parseAst(code, mode); | ||
value: function parse(code) { | ||
var ast = this._parseAst(code); | ||
var tokens = this._processTokens(ast, code); | ||
@@ -30,3 +47,3 @@ return (0, _elementTree.buildElementTree)(ast, tokens); | ||
key: '_parseAst', | ||
value: function _parseAst(code, mode) { | ||
value: function _parseAst(code) { | ||
var comments = []; | ||
@@ -37,3 +54,3 @@ var tokens = []; | ||
onComment: comments, | ||
strictMode: !mode || mode === 'strict' | ||
strictMode: this._strictModeEnabled | ||
}; | ||
@@ -40,0 +57,0 @@ var ast = (0, _babelCore.parse)(code, opts); |
{ | ||
"name": "cst", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "JavaScript CST Implementation", | ||
@@ -24,3 +24,3 @@ "author": "Marat Dulin", | ||
"precommit": "npm test", | ||
"release": "npm run build", | ||
"release": "npm run build && npm publish", | ||
"postpublish": "rm -Rf lib" | ||
@@ -27,0 +27,0 @@ }, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4956
0
299653