babel-plugin-pkg
Advanced tools
Comparing version 1.2.1 to 1.2.2
/*! | ||
*** babel-plugin-pkg 1.2.1 | ||
*** babel-plugin-pkg 1.2.2 | ||
*** Copyright © 2019, Jaid <jaid.jsx@gmail.com> (https://github.com/Jaid) | ||
@@ -7,2 +7,2 @@ *** @license MIT | ||
!*/ | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(global,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t){e.exports=require("path")},function(e,t){e.exports=require("read-pkg-up")},function(e,t,o){o.r(t);var n=o(0),i=o.n(n),a=o(1);const r=o(3)("babel-plugin-pkg");t.default=({types:e})=>({pre(){this.init=e=>{this.options||(this.options={cwd:e.cwd,prefix:"_PKG_",nameFallback:!0,...e.opts},this.options.packageJson=Object(a.sync)(this.options.cwd),this.options.packageJson.path&&r("Got package data from %s",this.options.packageJson.path),this.options.packageJson.package&&r("Data: %o",this.options.packageJson.package))}},visitor:{ReferencedIdentifier(t,o){if(this.init(o),t.node.name.startsWith(this.options.prefix)){var n,a,r,p,s,l,u;let o=t.node.name.slice(this.options.prefix.length);"PATH"===o&&(null===(n=this.options.packageJson)||null==n?void 0:n.path)&&t.replaceWith(e.valueToNode(this.options.packageJson.path)),"TITLE"!==o||(null===(a=this.options.packageJson)||null==a||null===(r=a.package)||null==r?void 0:r.title)||(o="NAME"),!this.options.nameFallback||"NAME"!==o||null!==(p=this.options.packageJson)&&null!=p&&null!==(s=p.package)&&null!=s&&s.name||t.replaceWith(e.valueToNode(i.a.basename(this.options.cwd))),(null===(l=this.options.packageJson)||null==l||null===(u=l.package)||null==u?void 0:u[o.toLowerCase()])&&t.replaceWith(e.valueToNode(this.options.packageJson.package[o.toLowerCase()]))}}}})},function(e,t){e.exports=require("debug")}])}); | ||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var o=t();for(var n in o)("object"==typeof exports?exports:e)[n]=o[n]}}(global,(function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,o),i.l=!0,i.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)o.d(n,i,function(t){return e[t]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=2)}([function(e,t){e.exports=require("path")},function(e,t){e.exports=require("read-pkg-up")},function(e,t,o){o.r(t);var n=o(0),i=o.n(n),a=o(1);const r=o(3)("babel-plugin-pkg");t.default=({types:e})=>({pre(){this.init=e=>{this.options||(this.options={cwd:e.cwd,prefix:"_PKG_",nameFallback:!0,...e.opts},this.options.packageJson=Object(a.sync)(this.options.cwd),this.options.packageJson.path&&r("Got package data from %s",this.options.packageJson.path),this.options.packageJson.package&&r("Data: %o",this.options.packageJson.package))}},visitor:{ReferencedIdentifier(t,o){if(this.init(o),t.node.name.startsWith(this.options.prefix)){var n,a,r,p,s,c,u;let o=t.node.name.slice(this.options.prefix.length);"PATH"===o&&(null===(n=this.options.packageJson)||void 0===n?void 0:n.path)&&t.replaceWith(e.valueToNode(this.options.packageJson.path)),"TITLE"!==o||(null===(a=this.options.packageJson)||void 0===a||null===(r=a.package)||void 0===r?void 0:r.title)||(o="NAME"),!this.options.nameFallback||"NAME"!==o||null!==(p=this.options.packageJson)&&void 0!==p&&null!==(s=p.package)&&void 0!==s&&s.name||t.replaceWith(e.valueToNode(i.a.basename(this.options.cwd))),(null===(c=this.options.packageJson)||void 0===c||null===(u=c.package)||void 0===u?void 0:u[o.toLowerCase()])&&t.replaceWith(e.valueToNode(this.options.packageJson.package[o.toLowerCase()]))}}}})},function(e,t){e.exports=require("debug")}])})); |
@@ -1,1 +0,1 @@ | ||
{"author":{"name":"Jaid","email":"jaid.jsx@gmail.com","url":"https://github.com/Jaid"},"bugs":"https://github.com/Jaid/babel-plugin-pkg/issues","dependencies":{"@babel/runtime":"^7.4.5","debug":"^4.1.1","read-pkg-up":"^6.0.0"},"description":"Resolves _PKG_VERSION to version from package.json - also works with any other field!","homepage":"https://github.com/Jaid/babel-plugin-pkg","keywords":["babel","babel-plugin","convert","name","package","package-json","pkg","resolve","resolver","transform","transformation","transpile","transpiler","version"],"license":"MIT","name":"babel-plugin-pkg","repository":"github:Jaid/babel-plugin-pkg","version":"1.2.1"} | ||
{"author":{"name":"Jaid","email":"jaid.jsx@gmail.com","url":"https://github.com/Jaid"},"bugs":"https://github.com/Jaid/babel-plugin-pkg/issues","dependencies":{"@babel/runtime":"^7.6.0","debug":"^4.1.1","read-pkg-up":"^6.0.0"},"description":"Resolves _PKG_VERSION to version from package.json - also works with any other field!","homepage":"https://github.com/Jaid/babel-plugin-pkg","keywords":["babel","babel-plugin","convert","name","package","package-json","pkg","resolve","resolver","transform","transformation","transpile","transpiler","version"],"license":"MIT","name":"babel-plugin-pkg","repository":"github:Jaid/babel-plugin-pkg","version":"1.2.2"} |
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
4588
Updated@babel/runtime@^7.6.0