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

babel-transform-roll20

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-transform-roll20 - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

test/fixtures/json.js

2

package.json
{
"name": "babel-transform-roll20",
"version": "0.3.1",
"version": "0.4.0",
"description": "A babel transform tool for transpiling scripts for the Roll20 sandbox.",

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

@@ -38,6 +38,17 @@ const babelParser = require('@babel/parser')

const filePath = `/${path.join(currentRoot, basePath.node.source.value)}`
const moduleName = `'${path.relative(process.cwd(), filePath)}'`
const file = path.parse(filePath)
const moduleName = `'${path.relative(process.cwd(), `${file.dir}/${file.ext && file.base.endsWith(file.ext) ? file.base.slice(0, -file.ext.length) : file.base}`)}'`
if (!program.__visited_files[filePath]) {
const fileContents = getFileContents(`${filePath}.js`, program.__roots)
let fileContents = getFileContents(`${file.dir}/${file.base}${file.ext && file.base.endsWith(file.ext) ? '' : '.js'}`, program.__roots)
switch (file.ext) {
case '.json':
fileContents = `export default ${fileContents.replace(/\u2028/g, '\\u2028').replace(/\u2029/g, '\\u2029')}`
break
default:
break
}
const module = t.blockStatement(

@@ -44,0 +55,0 @@ babelParser.parse(fileContents, {

@@ -88,1 +88,8 @@ import * as babel from '@babel/core'

})
test('transforms json imports', async (t) => {
const result = await loadFile('./test/transforms/json.js')
const { code } = await transform('./test/fixtures/json.js')
t.is(code, result)
})
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