@putout/engine-parser
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -15,3 +15,3 @@ 'use strict'; | ||
return result; | ||
return result.expression || result; | ||
}); | ||
@@ -34,4 +34,4 @@ | ||
return result; | ||
return result.expression || result; | ||
}; | ||
@@ -5,4 +5,22 @@ 'use strict'; | ||
const template = require('./template'); | ||
const { | ||
Identifier, | ||
StringLiteral, | ||
} = require('@babel/types'); | ||
test('parser: template: ast: fresh', (t) => { | ||
const buildRequire = template(` | ||
var %%importName%% = require(%%source%%); | ||
`); | ||
const ast = buildRequire({ | ||
importName: Identifier('myModule'), | ||
source: StringLiteral('my-module'), | ||
}); | ||
t.notOk(ast.expression); | ||
t.end(); | ||
}); | ||
test('parser: template: ast: fresh', (t) => { | ||
const one = template.ast.fresh('const hello = "world"'); | ||
@@ -9,0 +27,0 @@ one.x = 'zzz'; |
{ | ||
"name": "@putout/engine-parser", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)", | ||
@@ -15,2 +15,8 @@ "description": "putout parser", | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"**/*.spec.js", | ||
"test" | ||
] | ||
}, | ||
"scripts": { | ||
@@ -17,0 +23,0 @@ "test": "madrun test", |
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
11430
250