Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-extract-string

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-extract-string - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

2

package.json
{
"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 () {

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