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

code-red

Package Overview
Dependencies
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

code-red - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

5

CHANGELOG.md
# code-red changelog
## 0.1.3
* Support nullish coalescing operator ([#42](https://github.com/Rich-Harris/code-red/issues/42))
* Support optional chaining ([#43](https://github.com/Rich-Harris/code-red/issues/43))
## 0.1.2

@@ -4,0 +9,0 @@

20

dist/code-red.js

@@ -95,4 +95,5 @@ (function (global, factory) {

const OPERATOR_PRECEDENCE = {
'||': 3,
'&&': 4,
'||': 2,
'&&': 3,
'??': 4,
'|': 5,

@@ -1247,2 +1248,6 @@ '^': 6,

ChainExpression(node, state) {
return handle(node.expression, state);
},
CallExpression(node, state) {

@@ -1264,2 +1269,6 @@ const chunks = [];

if ((node ).optional) {
chunks.push(c('?.'));
}
const args = node.arguments.map(arg => handle(arg, state));

@@ -1306,2 +1315,5 @@

if (node.computed) {
if (node.optional) {
chunks.push(c('?.'));
}
chunks.push(

@@ -1314,3 +1326,3 @@ c('['),

chunks.push(
c('.'),
c(node.optional ? '?.' : '.'),
...handle(node.property, state)

@@ -1591,3 +1603,3 @@ );

return {
ecmaVersion: 11,
ecmaVersion: 2020,
sourceType: 'module',

@@ -1594,0 +1606,0 @@ allowAwaitOutsideFunction: true,

6

package.json
{
"name": "code-red",
"description": "code-red",
"version": "0.1.2",
"version": "0.1.3",
"repository": "Rich-Harris/code-red",

@@ -15,3 +15,3 @@ "main": "dist/code-red.js",

"@types/astring": "^1.3.0",
"@types/estree": "0.0.39",
"@types/estree": "0.0.45",
"@types/mocha": "^5.2.7",

@@ -39,3 +39,3 @@ "@types/node": "^12.12.7",

"dependencies": {
"acorn": "^7.1.0",
"acorn": "^7.3.1",
"is-reference": "^1.1.4",

@@ -42,0 +42,0 @@ "periscopic": "^2.0.1",

@@ -1,7 +0,7 @@

import { Property, Node, Expression } from 'estree';
import { Property, Node, Expression, SpreadElement } from 'estree';
export declare function b(strings: TemplateStringsArray, ...values: any[]): Node[];
export declare function x(strings: TemplateStringsArray, ...values: any[]): Expression;
export declare function p(strings: TemplateStringsArray, ...values: any[]): Property;
export declare function p(strings: TemplateStringsArray, ...values: any[]): Property | SpreadElement;
export { print } from './print/index';
export declare const parse: (source: string, opts: any) => any;
export declare const parseExpressionAt: (source: string, index: number, opts: any) => any;

Sorry, the diff of this file is not supported yet

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