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.2 to 0.3.3

21

dist/transform-bang.cjs.js

@@ -8,14 +8,23 @@ 'use strict';

// Promise.resolve(...).get/put/post/delete
const parseFunc =
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse;
const ast = (parseFunc || parser)(ss.src, {
const source = ss.src;
const parseFunc = parser.parse;
const ast = (parseFunc || parser)(source, {
plugins: ['infixBang'],
});
// Create the source from the ast.
const output = generate(ast, {}, ss.src);
// console.log(`have src`, output.code);
const output = generate(ast, {}, source);
// Work around Babel appending semicolons.
const maybeSource = output.code;
const actualSource =
ss.sourceType === 'expression' &&
maybeSource.endsWith(';') &&
!source.endsWith(';')
? maybeSource.slice(0, -1)
: maybeSource;
return {
...ss,
ast,
src: output.code,
src: actualSource,
};

@@ -22,0 +31,0 @@ },

@@ -6,14 +6,23 @@ function makeBangTransformer(parser, generate) {

// Promise.resolve(...).get/put/post/delete
const parseFunc =
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse;
const ast = (parseFunc || parser)(ss.src, {
const source = ss.src;
const parseFunc = parser.parse;
const ast = (parseFunc || parser)(source, {
plugins: ['infixBang'],
});
// Create the source from the ast.
const output = generate(ast, {}, ss.src);
// console.log(`have src`, output.code);
const output = generate(ast, {}, source);
// Work around Babel appending semicolons.
const maybeSource = output.code;
const actualSource =
ss.sourceType === 'expression' &&
maybeSource.endsWith(';') &&
!source.endsWith(';')
? maybeSource.slice(0, -1)
: maybeSource;
return {
...ss,
ast,
src: output.code,
src: actualSource,
};

@@ -20,0 +29,0 @@ },

@@ -12,14 +12,23 @@ (function (global, factory) {

// Promise.resolve(...).get/put/post/delete
const parseFunc =
(ss.sourceType === 'expression' && parser.parseExpression) || parser.parse;
const ast = (parseFunc || parser)(ss.src, {
const source = ss.src;
const parseFunc = parser.parse;
const ast = (parseFunc || parser)(source, {
plugins: ['infixBang'],
});
// Create the source from the ast.
const output = generate(ast, {}, ss.src);
// console.log(`have src`, output.code);
const output = generate(ast, {}, source);
// Work around Babel appending semicolons.
const maybeSource = output.code;
const actualSource =
ss.sourceType === 'expression' &&
maybeSource.endsWith(';') &&
!source.endsWith(';')
? maybeSource.slice(0, -1)
: maybeSource;
return {
...ss,
ast,
src: output.code,
src: actualSource,
};

@@ -26,0 +35,0 @@ },

{
"name": "@agoric/transform-bang",
"version": "0.3.2",
"version": "0.3.3",
"description": "transform-bang",

@@ -5,0 +5,0 @@ "main": "dist/transform-bang.cjs.js",

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