New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@simbathesailor/babel-plugin-use-what-changed

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simbathesailor/babel-plugin-use-what-changed - npm Package Compare versions

Comparing version 2.0.3 to 2.1.0

8

dist/babel-plugin-use-what-changed.cjs.development.js

@@ -7,3 +7,3 @@ 'use strict';

var generate = _interopDefault(require('@babel/generator'));
var babylon = require('babylon');
var babelParser = require('@babel/parser');
var path = _interopDefault(require('path'));

@@ -25,5 +25,3 @@

var buildRequire =
/*#__PURE__*/
template("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n");
var buildRequire = /*#__PURE__*/template("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n");
var SetToSupport = ['useEffect', 'useCallback', 'useMemo', 'useLayoutEffect'];

@@ -67,3 +65,3 @@

var templateuseWhatChangedFUnctionCall = "\n ____useWhatChanged(" + collectedNames + ",\"" + collectedNames.slice(1, -1) + "\", \"" + path.node.name + "::" + splittedPath.slice(-2).join('/') + "\")\n ";
var useWhatChangedAst = babylon.parse(templateuseWhatChangedFUnctionCall);
var useWhatChangedAst = babelParser.parse(templateuseWhatChangedFUnctionCall);

@@ -70,0 +68,0 @@ if (state.lineNoWhereCallNeedToBeAdded && state.lineNoWhereCallNeedToBeAdded[lineNo]) {

@@ -1,2 +0,2 @@

"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=e(require("babel-template")),r=e(require("@babel/generator")),n=require("babylon"),i=e(require("path"));process.env.BABEL_DISABLE_CACHE="1";var t=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=o("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n"),l=["useEffect","useCallback","useMemo","useLayoutEffect"];function a(e){var o=e.lineNo,t=e.state,d=e.path,l=d.findParent((function(e){return e.isCallExpression()}));if(l){var a=d.findParent((function(e){return"BlockStatement"===e.parent.type})),s=l.node.arguments[1];if(s&&"ArrayExpression"===s.type){var u=r(s,{shouldPrintComment:function(){return!1}}).code,c=t.file.opts.filename.split(i.sep),h="\n ____useWhatChanged("+u+',"'+u.slice(1,-1)+'", "'+d.node.name+"::"+c.slice(-2).join("/")+'")\n ',N=n.parse(h);t.lineNoWhereCallNeedToBeAdded&&t.lineNoWhereCallNeedToBeAdded[o]&&(t.lineNoWhereCallNeedToBeAdded[o].collectionNames=u);try{a.insertBefore(N)}catch(e){console.error("@simbathesailor-uwc-debug error",e)}t.lineNoWhereCallNeedToBeAdded&&t.lineNoWhereCallNeedToBeAdded[o]&&(t.lineNoWhereCallNeedToBeAdded[o].done=!0)}}}module.exports=function(e){var o=e.types;return{visitor:{Identifier:function(e,o){if(o.opts.active&&-1!==l.indexOf(e.node.name)){var r,n,i;if(void 0!==o.lowerlimituwcdebug&&parseInt(null==e?void 0:null===(r=e.node)||void 0===r?void 0:null===(n=r.loc)||void 0===n?void 0:null===(i=n.start)||void 0===i?void 0:i.line,10)>o.lowerlimituwcdebug){var d,s=parseInt(e.node.loc.start.line,10)-1;a({lineNo:s,path:e,state:o}),o.lineNoWhereCallNeedToBeAdded||(o.lineNoWhereCallNeedToBeAdded={}),o.lineNoWhereCallNeedToBeAdded[s]||(o.lineNoWhereCallNeedToBeAdded=((d={})[s]={done:!1},d)),o.lineNoWhereCallNeedToBeAdded[s].done=!0}t(o.lineNoWhereCallNeedToBeAdded)&&Object.keys(o.lineNoWhereCallNeedToBeAdded).forEach((function(r){var n,i,t;o.lineNoWhereCallNeedToBeAdded[r].done||parseInt(null==e?void 0:null===(n=e.node)||void 0===n?void 0:null===(i=n.loc)||void 0===i?void 0:null===(t=i.start)||void 0===t?void 0:t.line,10)===parseInt(r)+1&&a({lineNo:r,state:o,path:e})}))}},Program:{exit:function(){},enter:function(e,r){var n=!1;if(r.opts.active)try{e.container.comments.forEach((function(i){if("uwc-debug"===i.value.trim()){if(!r.isDoneAddingImport){var l=d({IMPORT_NAME:o.identifier("simbathesailor_useWhatChangedImport"),SOURCE:o.stringLiteral("@simbathesailor/use-what-changed")});try{e.unshiftContainer("body",l)}catch(e){console.error("@simbathesailor-uwc-debug error adding import",e)}r.isDoneAddingImport=!0}var a,s;r.lineNoWhereCallNeedToBeAdded=t(r)&&t(r.lineNoWhereCallNeedToBeAdded)?Object.assign({},r.lineNoWhereCallNeedToBeAdded,((a={})[i.loc.start.line]={done:!1},a)):((s={})[i.loc.start.line]={done:!1},s)}if("uwc-debug-below"===i.value.trim()&&!n){if(!r.isDoneAddingImport){var u=d({IMPORT_NAME:o.identifier("simbathesailor_useWhatChangedImport"),SOURCE:o.stringLiteral("@simbathesailor/use-what-changed")});try{e.unshiftContainer("body",u)}catch(e){console.error("@simbathesailor-uwc-debug error adding import",e)}r.isDoneAddingImport=!0}r.lowerlimituwcdebug=i.loc.start.line,n=!0}}))}catch(e){console.error("@simbathesailor-uwc-debug error",e)}}}}}};
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var o=e(require("babel-template")),r=e(require("@babel/generator")),n=require("@babel/parser"),i=e(require("path"));process.env.BABEL_DISABLE_CACHE="1";var t=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=o("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n"),l=["useEffect","useCallback","useMemo","useLayoutEffect"];function a(e){var o=e.lineNo,t=e.state,d=e.path,l=d.findParent((function(e){return e.isCallExpression()}));if(l){var a=d.findParent((function(e){return"BlockStatement"===e.parent.type})),s=l.node.arguments[1];if(s&&"ArrayExpression"===s.type){var u=r(s,{shouldPrintComment:function(){return!1}}).code,c=t.file.opts.filename.split(i.sep),h="\n ____useWhatChanged("+u+',"'+u.slice(1,-1)+'", "'+d.node.name+"::"+c.slice(-2).join("/")+'")\n ',N=n.parse(h);t.lineNoWhereCallNeedToBeAdded&&t.lineNoWhereCallNeedToBeAdded[o]&&(t.lineNoWhereCallNeedToBeAdded[o].collectionNames=u);try{a.insertBefore(N)}catch(e){console.error("@simbathesailor-uwc-debug error",e)}t.lineNoWhereCallNeedToBeAdded&&t.lineNoWhereCallNeedToBeAdded[o]&&(t.lineNoWhereCallNeedToBeAdded[o].done=!0)}}}module.exports=function(e){var o=e.types;return{visitor:{Identifier:function(e,o){if(o.opts.active&&-1!==l.indexOf(e.node.name)){var r,n,i;if(void 0!==o.lowerlimituwcdebug&&parseInt(null==e||null===(r=e.node)||void 0===r||null===(n=r.loc)||void 0===n||null===(i=n.start)||void 0===i?void 0:i.line,10)>o.lowerlimituwcdebug){var d,s=parseInt(e.node.loc.start.line,10)-1;a({lineNo:s,path:e,state:o}),o.lineNoWhereCallNeedToBeAdded||(o.lineNoWhereCallNeedToBeAdded={}),o.lineNoWhereCallNeedToBeAdded[s]||(o.lineNoWhereCallNeedToBeAdded=((d={})[s]={done:!1},d)),o.lineNoWhereCallNeedToBeAdded[s].done=!0}t(o.lineNoWhereCallNeedToBeAdded)&&Object.keys(o.lineNoWhereCallNeedToBeAdded).forEach((function(r){var n,i,t;o.lineNoWhereCallNeedToBeAdded[r].done||parseInt(null==e||null===(n=e.node)||void 0===n||null===(i=n.loc)||void 0===i||null===(t=i.start)||void 0===t?void 0:t.line,10)===parseInt(r)+1&&a({lineNo:r,state:o,path:e})}))}},Program:{exit:function(){},enter:function(e,r){var n=!1;if(r.opts.active)try{e.container.comments.forEach((function(i){if("uwc-debug"===i.value.trim()){if(!r.isDoneAddingImport){var l=d({IMPORT_NAME:o.identifier("simbathesailor_useWhatChangedImport"),SOURCE:o.stringLiteral("@simbathesailor/use-what-changed")});try{e.unshiftContainer("body",l)}catch(e){console.error("@simbathesailor-uwc-debug error adding import",e)}r.isDoneAddingImport=!0}var a,s;r.lineNoWhereCallNeedToBeAdded=t(r)&&t(r.lineNoWhereCallNeedToBeAdded)?Object.assign({},r.lineNoWhereCallNeedToBeAdded,((a={})[i.loc.start.line]={done:!1},a)):((s={})[i.loc.start.line]={done:!1},s)}if("uwc-debug-below"===i.value.trim()&&!n){if(!r.isDoneAddingImport){var u=d({IMPORT_NAME:o.identifier("simbathesailor_useWhatChangedImport"),SOURCE:o.stringLiteral("@simbathesailor/use-what-changed")});try{e.unshiftContainer("body",u)}catch(e){console.error("@simbathesailor-uwc-debug error adding import",e)}r.isDoneAddingImport=!0}r.lowerlimituwcdebug=i.loc.start.line,n=!0}}))}catch(e){console.error("@simbathesailor-uwc-debug error",e)}}}}}};
//# sourceMappingURL=babel-plugin-use-what-changed.cjs.production.min.js.map
import template from 'babel-template';
import generate from '@babel/generator';
import { parse } from 'babylon';
import { parse } from '@babel/parser';
import path from 'path';

@@ -20,5 +20,3 @@

var buildRequire =
/*#__PURE__*/
template("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n");
var buildRequire = /*#__PURE__*/template("\n var IMPORT_NAME = require(SOURCE);\n var ____useWhatChanged = IMPORT_NAME.useWhatChanged\n");
var SetToSupport = ['useEffect', 'useCallback', 'useMemo', 'useLayoutEffect'];

@@ -25,0 +23,0 @@

{
"name": "@simbathesailor/babel-plugin-use-what-changed",
"version": "2.0.3",
"version": "2.1.0",
"license": "MIT",

@@ -19,4 +19,4 @@ "author": "simbathesailor",

"peerDependencies": {
"react": ">=16",
"@simbathesailor/use-what-changed": "1.x"
"@simbathesailor/use-what-changed": "2.x",
"react": ">=16"
},

@@ -41,8 +41,9 @@ "husky": {

"react-dom": "^16.12.0",
"tsdx": "^0.13.2",
"tslib": "^1.10.0",
"typescript": "^3.7.3",
"tsdx": "^0.13.2"
"typescript": "^3.7.3"
},
"dependencies": {
"@babel/generator": "^7.7.7",
"@babel/parser": "^7.14.4",
"@babel/types": "^7.7.4",

@@ -49,0 +50,0 @@ "@types/babel-template": "^6.25.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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