contractual
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var OBLIGATIONS = require('obligations'); | ||
@@ -45,5 +46,9 @@ var estraverse = require('estraverse'); | ||
if (total && !options.global) { | ||
ast.body.unshift(createRequireStatement(options)); | ||
if (ast.body[0].type === 'ExpressionStatement' && ast.body[0].expression.value === 'use strict') { | ||
ast.body.splice(1, 0, createRequireStatement(options)); | ||
} else { | ||
ast.body.unshift(createRequireStatement(options)); | ||
} | ||
} | ||
// regular expression haves are being hammered in some cases, this fixes that. | ||
// regular expression are being hammered in some cases, this fixes that. | ||
// but it's a bandage. The root cause is not clear, it seems to be an issue with esprima. | ||
@@ -50,0 +55,0 @@ estraverse.traverse(ast, { |
{ | ||
"name": "contractual", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Syntactic sugar for Design by contract in JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -0,1 +1,2 @@ | ||
'use strict'; | ||
var estraverse = require('estraverse'); | ||
@@ -48,5 +49,10 @@ | ||
if (total && !options.global) { | ||
ast.body.unshift(createRequireStatement(options)); | ||
if (ast.body[0].type === 'ExpressionStatement' && ast.body[0].expression.value === 'use strict') { | ||
ast.body.splice(1, 0, createRequireStatement(options)); | ||
} | ||
else { | ||
ast.body.unshift(createRequireStatement(options)); | ||
} | ||
} | ||
// regular expression haves are being hammered in some cases, this fixes that. | ||
// regular expression are being hammered in some cases, this fixes that. | ||
// but it's a bandage. The root cause is not clear, it seems to be an issue with esprima. | ||
@@ -53,0 +59,0 @@ estraverse.traverse(ast, { |
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
104945
2809