babel-plugin-inline-json-import
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -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) { |
16278
213