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

babel-plugin-captains-log

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-captains-log - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

dist/__fixtures__/method-check/code.js

73

dist/index.js

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

"use strict";
'use strict';

@@ -7,31 +7,15 @@ Object.defineProperty(exports, "__esModule", {

var _typeof2 = require("babel-runtime/helpers/typeof");
var _typeof2 = require('babel-runtime/helpers/typeof');
var _typeof3 = _interopRequireDefault(_typeof2);
var _defineProperty2 = require("babel-runtime/helpers/defineProperty");
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
var _defineProperty3 = _interopRequireDefault(_defineProperty2);
var _values = require("babel-runtime/core-js/object/values");
var _values2 = _interopRequireDefault(_values);
var _extends3 = require("babel-runtime/helpers/extends");
var _extends4 = _interopRequireDefault(_extends3);
var _objectWithoutProperties2 = require("babel-runtime/helpers/objectWithoutProperties");
var _objectWithoutProperties3 = _interopRequireDefault(_objectWithoutProperties2);
var _toConsumableArray2 = require("babel-runtime/helpers/toConsumableArray");
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _keys = require("babel-runtime/core-js/object/keys");
var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
var _set = require("babel-runtime/core-js/set");
var _set = require('babel-runtime/core-js/set');

@@ -43,3 +27,3 @@ var _set2 = _interopRequireDefault(_set);

var name = "babel-plugin-captains-log";
var name = 'babel-plugin-captains-log';
var callExpressions = new _set2.default();

@@ -58,6 +42,7 @@ var evaluatedExpressions = new _set2.default();

}
if (!looksLike(path.node, { name: "console" })) {
if (!looksLike(path.node, { name: 'console' })) {
return;
}
var settings = buildSettings(opts || {});
// find somewhere we can move this so that it only needs to be called once.
var settings = (0, _pluginOptions.buildOptions)(opts || {});
var parentCallExp = path.findParent(t.isCallExpression);

@@ -74,3 +59,3 @@ if (isTrackingConsoleCallStatement(path, parentCallExp, settings)) {

var settings = buildSettings(opts || {});
var settings = (0, _pluginOptions.buildOptions)(opts || {});
callExpressions.forEach(function (callExp) {

@@ -98,4 +83,4 @@ if (!callExp || evaluatedExpressions.has(callExp)) {

var start = callExp.node.loc.start;
var lineCol = "(" + start.line + ":" + start.column + ")";
args = prependArguments(args, "" + filename + lineCol);
var lineCol = '(' + start.line + ':' + start.column + ')';
args = prependArguments(args, '' + filename + lineCol);
}

@@ -109,3 +94,3 @@ callExp.node.arguments = args;

function matchesIgnorePattern() {
var ignorePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ["node_modules"];
var ignorePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['node_modules'];
var file = arguments[1];

@@ -119,3 +104,3 @@

function getConsoleCallMethodName(callExpression) {
return callExpression.get("callee.property").node.name;
return callExpression.get('callee.property').node.name;
}

@@ -138,16 +123,2 @@

function buildSettings(opts) {
// remove ignore patterns from settings since it has been consumed already
// eslint-disable-next-line no-unused-vars
var methods = opts.methods,
ignorePatterns = opts.ignorePatterns,
flags = (0, _objectWithoutProperties3.default)(opts, ["methods", "ignorePatterns"]);
// output spreads the flags over each method
// in the future this could be expanded to allow method level config
return (methods || defaultMethods).reduce(function (acc, curr) {
return (0, _extends4.default)({}, acc, (0, _defineProperty3.default)({}, curr, (0, _values2.default)(flags).length ? flags : defaultSettings));
}, {});
}
function findCallScope(path) {

@@ -162,3 +133,3 @@ var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];

}
return scope.length ? scope.join(".") + ":" : "";
return scope.length ? scope.join('.') + ':' : '';
}

@@ -177,12 +148,6 @@

var _pluginOptions = require('./utils/pluginOptions');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultSettings = {
injectScope: true,
injectVariableName: true,
injectFileName: true
};
var defaultMethods = ["debug", "error", "exception", "info", "log", "warn"];
var idNameSelector = function idNameSelector(path) {

@@ -213,3 +178,3 @@ return path.node.id.name;

var aVal = a[bKey];
if (typeof bVal === "function") {
if (typeof bVal === 'function') {
return bVal(aVal);

@@ -222,3 +187,3 @@ }

function isPrimitive(val) {
return val == null || /^[sbn]/.test(typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val));
return val == null || /^[sbn]/.test(typeof val === 'undefined' ? 'undefined' : (0, _typeof3.default)(val));
}
{
"name": "babel-plugin-captains-log",
"version": "0.6.0",
"version": "0.6.1",
"files": [

@@ -11,3 +11,3 @@ "dist"

"prebuild": "rimraf dist",
"build": "babel --copy-files --out-dir dist --ignore __test__ src",
"build": "babel --copy-files --out-dir dist --ignore *.spec.js,__snapshots__,__test__ src",
"report-coverage": "codecov",

@@ -40,2 +40,3 @@ "contribute": "all-contributors",

"babel-jest": "^19.0.0",
"babel-plugin-tester": "^3.1.0",
"babel-plugin-transform-runtime": "^6.23.0",

@@ -56,5 +57,6 @@ "babel-preset-env": "^1.3.3",

"/node_modules",
"__test__"
"__fixtures__",
"__snapshots__"
]
}
}
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