@agoric/transform-bang
Advanced tools
Comparing version 0.3.1 to 0.3.2
'use strict'; | ||
function makeBangTransformer(parse, generate) { | ||
function makeBangTransformer(parser, generate) { | ||
const transform = { | ||
rewrite(rs) { | ||
rewrite(ss) { | ||
// Parse with infixBang enabled, rewriting to | ||
// Promise.resolve(...).get/put/post/delete | ||
const ast = parse(rs.src, { | ||
const parseFunc = | ||
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse; | ||
const ast = (parseFunc || parser)(ss.src, { | ||
plugins: ['infixBang'], | ||
}); | ||
// Create the source from the ast. | ||
const output = generate(ast, {}, rs.src); | ||
const output = generate(ast, {}, ss.src); | ||
// console.log(`have src`, output.code); | ||
return { | ||
...rs, | ||
...ss, | ||
ast, | ||
@@ -17,0 +19,0 @@ src: output.code, |
@@ -1,14 +0,16 @@ | ||
function makeBangTransformer(parse, generate) { | ||
function makeBangTransformer(parser, generate) { | ||
const transform = { | ||
rewrite(rs) { | ||
rewrite(ss) { | ||
// Parse with infixBang enabled, rewriting to | ||
// Promise.resolve(...).get/put/post/delete | ||
const ast = parse(rs.src, { | ||
const parseFunc = | ||
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse; | ||
const ast = (parseFunc || parser)(ss.src, { | ||
plugins: ['infixBang'], | ||
}); | ||
// Create the source from the ast. | ||
const output = generate(ast, {}, rs.src); | ||
const output = generate(ast, {}, ss.src); | ||
// console.log(`have src`, output.code); | ||
return { | ||
...rs, | ||
...ss, | ||
ast, | ||
@@ -15,0 +17,0 @@ src: output.code, |
@@ -7,15 +7,17 @@ (function (global, factory) { | ||
function makeBangTransformer(parse, generate) { | ||
function makeBangTransformer(parser, generate) { | ||
const transform = { | ||
rewrite(rs) { | ||
rewrite(ss) { | ||
// Parse with infixBang enabled, rewriting to | ||
// Promise.resolve(...).get/put/post/delete | ||
const ast = parse(rs.src, { | ||
const parseFunc = | ||
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse; | ||
const ast = (parseFunc || parser)(ss.src, { | ||
plugins: ['infixBang'], | ||
}); | ||
// Create the source from the ast. | ||
const output = generate(ast, {}, rs.src); | ||
const output = generate(ast, {}, ss.src); | ||
// console.log(`have src`, output.code); | ||
return { | ||
...rs, | ||
...ss, | ||
ast, | ||
@@ -22,0 +24,0 @@ src: output.code, |
{ | ||
"name": "@agoric/transform-bang", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "transform-bang", | ||
@@ -31,3 +31,3 @@ "main": "dist/transform-bang.cjs.js", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"ses": "^0.5.1", | ||
"ses": "^0.5.3", | ||
"tap-spec": "^5.0.0", | ||
@@ -34,0 +34,0 @@ "tape": "^4.9.2", |
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
15547
76
0