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

babel-import-util

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-import-util - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

package.json
{
"name": "babel-import-util",
"version": "0.1.0",
"version": "0.2.0",
"description": "Utility for manipulating imports within babel plugins",

@@ -5,0 +5,0 @@ "repository": "https://github.com/ef4/babel-import-util",

@@ -54,3 +54,3 @@ "use strict";

if (specifier && ((_a = target.scope.getBinding(specifier.node.local.name)) === null || _a === void 0 ? void 0 : _a.kind) === 'module') {
return specifier.node.local;
return this.t.identifier(specifier.node.local.name);
}

@@ -109,2 +109,2 @@ else {

}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFLQSxNQUFhLFVBQVU7SUFDckIsWUFBb0IsQ0FBYSxFQUFVLE9BQTRCO1FBQW5ELE1BQUMsR0FBRCxDQUFDLENBQVk7UUFBVSxZQUFPLEdBQVAsT0FBTyxDQUFxQjtJQUFHLENBQUM7SUFFM0UsWUFBWSxDQUFDLGVBQXVCLEVBQUUsWUFBb0I7UUFDeEQsS0FBSyxJQUFJLFlBQVksSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxNQUFNLENBQUMsRUFBRTtZQUNqRCxJQUNFLENBQUMsWUFBWSxDQUFDLG1CQUFtQixFQUFFO2dCQUNuQyxZQUFZLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxDQUFDLElBQUksQ0FBQyxLQUFLLEtBQUssZUFBZSxFQUN6RDtnQkFDQSxTQUFTO2FBQ1Y7WUFFRCxJQUFJLG1CQUFtQixHQUFHLFlB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9kZTogdC5TdHJpbmdMaXRlcmFsIHwgdC5JZGVudGlmaWVyKTogc3RyaW5nIHtcbiAgaWYgKG5vZGUudHlwZSA9PT0gJ1N0cmluZ0xpdGVyYWwnKSB7XG4gICAgcmV0dXJuIG5vZGUudmFsdWU7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIG5vZGUubmFtZTtcbiAgfVxufVxuXG5mdW5jdGlvbiBkZXNpcmVkTmFtZShuYW1lSGludDogc3RyaW5nIHwgdW5kZWZpbmVkLCBleHBvcnRlZE5hbWU6IHN0cmluZywgdGFyZ2V0OiBOb2RlUGF0aDx0Lk5vZGU+KSB7XG4gIGlmIChuYW1lSGludCkge1xuICAgIHJldHVybiBuYW1lSGludDtcbiAgfVxuICBpZiAoZXhwb3J0ZWROYW1lID09PSAnZGVmYXVsdCcpIHtcbiAgICBpZiAodGFyZ2V0LmlzSWRlbnRpZmllcigpKSB7XG4gICAgICByZXR1cm4gdGFyZ2V0Lm5vZGUubmFtZTtcbiAgICB9IGVsc2Uge1xuICAgICAgcmV0dXJuIHRhcmdldC5zY29wZS5nZW5lcmF0ZVVpZElkZW50aWZpZXJCYXNlZE9uTm9kZSh0YXJnZXQubm9kZSkubmFtZTtcbiAgICB9XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIGV4cG9ydGVkTmFtZTtcbiAgfVxufVxuIl19
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