babel-plugin-extract-string
Advanced tools
Comparing version 1.1.1 to 1.1.2
{ | ||
"name": "babel-plugin-extract-string", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "Babel plugin to extract string from js source file then save into array", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -15,3 +15,5 @@ var fs = require('fs') | ||
// filename : state.file.opts.filename | ||
if(/ObjectProperty/i.test(path.parent.type)) return | ||
if ((path.parentKey || path.key)=='key') { | ||
return | ||
} | ||
// console.log(Object.keys(path), path.scope.path.node.type) | ||
@@ -18,0 +20,0 @@ var arr = state._store |
@@ -31,5 +31,5 @@ import { transform } from 'babel-core' | ||
// don't touch ObjectProperty | ||
var a = transform(`var d = {'aaa': 123};`, babelTranslationOptions({name: 'abc'})) | ||
assert.equal(a.code, `var d = { 'aaa': 123 };`) | ||
assert.deepEqual(a.metadata._store, []) | ||
var a = transform(`var d = {'aaa': '123'};`, babelTranslationOptions({name: 'abc'})) | ||
assert.equal(a.code, `var d = { 'aaa': abc[0] };`) | ||
assert.deepEqual(a.metadata._store, ['123']) | ||
}) | ||
@@ -36,0 +36,0 @@ it('test string saved to file', function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4701
77
7