Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@agoric/transform-bang

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@agoric/transform-bang - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

12

dist/transform-bang.cjs.js
'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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc