New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cjstoes

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cjstoes - npm Package Compare versions

Comparing version 0.0.8 to 0.0.9

0

.eslintrc.json

@@ -0,0 +0,0 @@ {

@@ -0,0 +0,0 @@ const { parseModule } = require('esprima')

2

package.json
{
"name": "cjstoes",
"version": "0.0.8",
"version": "0.0.9",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -0,0 +0,0 @@ # CommonJS to ES6 module

const estraverse = require('estraverse')
let nameIndex = 10000
exports.transform = function(tree) {
let nameIndex = 10000
let exportsNames = []

@@ -30,3 +30,3 @@

let nameArr = Object.entries(getAllProperties(tree, name))
let nameArr = Object.entries(getAllProperties(tree, name, nameIndex))
if (nameArr.length) {

@@ -134,3 +134,3 @@ return {

const getAllProperties = (tree, name) => {
const getAllProperties = (tree, name, nameIndex) => {
let r = {}

@@ -145,4 +145,4 @@ estraverse.replace(tree, {

let newName,
propertyName = node.property.name || node.property.value
propertyName = validateStr(node.property.name || node.property.value)
if (r[propertyName]) {

@@ -163,1 +163,8 @@ newName = r[propertyName]

}
const validateStr = str => {
str.trim()
str = str.replace(/`$/, '$prime')
str = str.replace(/^null$/, '$$null')
return str
}

@@ -13,2 +13,9 @@ const { parseModule } = require('esprima')

})
it('require with keyword', () => {
const input = parseModule(`var a = require('a');a["b\`"]();`),
output = parseModule(`import {b$prime as b$prime10000} from 'a';b$prime10000();`)
transform(input)
expect(input).to.deep.equal(output)
})
it('require not use', () => {

@@ -15,0 +22,0 @@ const input = parseModule(`var a = require('a');b()`),

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