🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

babel-plugin-inline-json-import

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-json-import - npm Package Compare versions

Comparing version

to
0.3.1

2

build/index.js

@@ -50,3 +50,3 @@ 'use strict';

if (init.type === 'CallExpression' && init.callee.type === 'Identifier' && init.callee.name === 'require' && init.arguments.length === 1 && init.arguments[0].type === 'StringLiteral') {
if (init != null && init.type === 'CallExpression' && init.callee.type === 'Identifier' && init.callee.name === 'require' && init.arguments.length === 1 && init.arguments[0].type === 'StringLiteral') {
changed = true;

@@ -53,0 +53,0 @@

{
"name": "babel-plugin-inline-json-import",
"version": "0.3.0",
"version": "0.3.1",
"description": "Inlines JSON file imports straight into JS code",

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

@@ -129,2 +129,15 @@ import fs from 'fs'

it('supports opt variable declaration', () => {
const t = configureTransform()
const result = t(`
var a;
let c;
`)
expect(normalize(result.code)).to.equal(normalize(`
var a;
let c;
`))
})
function configureTransform(options = {}, isFile) {

@@ -131,0 +144,0 @@ return function configuredTransform(string) {