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

code-red

Package Overview
Dependencies
Maintainers
1
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.0.11 to 0.0.12

4

CHANGELOG.md
# code-red changelog
## 0.0.12
* Flatten object properties
## 0.0.11

@@ -4,0 +8,0 @@

@@ -184,2 +184,19 @@ (function (global, factory) {

const flatten_properties = (array, target) => {
for (let i = 0; i < array.length; i += 1) {
const property = array[i];
if (!property.value) continue;
if (property.key === property.value && Array.isArray(property.key)) {
flatten_properties(property.key, target);
continue;
}
target.push(property);
}
return target;
};
const flatten = (nodes, target) => {

@@ -208,2 +225,4 @@ for (let i = 0; i < nodes.length; i += 1) {

if (node.type === 'Property' && Array.isArray(node.key)) ;
if (node.type === 'Identifier') {

@@ -224,2 +243,6 @@ re.lastIndex = 0;

if (value && value.type === 'Identifier' && value.name.startsWith(`letters =`)) {
throw new Error(`wut ${match[1]}`);
}
if (index === null) {

@@ -254,3 +277,3 @@ (parent )[key] = value;

if (node.type === 'ObjectExpression') {
node.properties = node.properties.filter((prop) => prop.value);
node.properties = flatten_properties(node.properties, []);
}

@@ -332,4 +355,8 @@

str = str.replace(re, (m, i, s, n) => {
if (s) return sigils[s] + n;
re.lastIndex = 0;
str = str.replace(re, (m, i, at, hash, name) => {
if (at) return `@${name}`;
if (hash) return `#${name}`;
return '${...}';

@@ -336,0 +363,0 @@ });

2

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

@@ -6,0 +6,0 @@ "main": "dist/code-red.js",

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