@thndr/babel-plugin-captains-log
Advanced tools
Comparing version 1.2.0 to 1.2.3
@@ -38,3 +38,2 @@ "use strict"; | ||
} = state; | ||
const loggerName = getLoggerName(opts); | ||
const filename = getFilename(state); | ||
@@ -47,3 +46,3 @@ | ||
if (!looksLike(path.node, { | ||
name: loggerName | ||
name: 'console' | ||
})) { | ||
@@ -97,6 +96,2 @@ return; | ||
function getLoggerName(opts) { | ||
return opts.loggerName || 'console'; | ||
} | ||
function matchesIgnorePattern(ignorePatterns = ['node_modules'], filename) { | ||
@@ -103,0 +98,0 @@ return ignorePatterns.some(pattern => filename.includes(pattern)); |
@@ -28,27 +28,19 @@ "use strict"; | ||
let cachedUserOptions = null; | ||
let cachedBuildOptions = null; | ||
const buildOptions = userOptions => { | ||
if (cachedUserOptions !== userOptions) { | ||
cachedUserOptions = userOptions; // remove ignore patterns from settings since it has been consumed already | ||
// eslint-disable-next-line no-unused-vars | ||
// remove ignore patterns from settings since it has been consumed already | ||
// eslint-disable-next-line no-unused-vars | ||
const _ref = userOptions || {}, | ||
{ | ||
methods, | ||
ignorePatterns | ||
} = _ref, | ||
options = (0, _objectWithoutProperties2.default)(_ref, ["methods", "ignorePatterns"]); // output spreads the flags over each method | ||
// in the future this could be expanded to allow method level config | ||
const _ref = userOptions || {}, | ||
{ | ||
methods, | ||
ignorePatterns | ||
} = _ref, | ||
options = (0, _objectWithoutProperties2.default)(_ref, ["methods", "ignorePatterns"]); // output spreads the flags over each method | ||
// in the future this could be expanded to allow method level config | ||
cachedBuildOptions = (methods || defaultMethods).reduce((acc, method) => { | ||
return (0, _objectSpread2.default)({}, acc, { | ||
[method]: mergeOptions(options) | ||
}); | ||
}, {}); | ||
} | ||
return cachedBuildOptions; | ||
return (methods || defaultMethods).reduce((acc, method) => { | ||
return (0, _objectSpread2.default)({}, acc, { | ||
[method]: mergeOptions(options) | ||
}); | ||
}, {}); | ||
}; | ||
@@ -55,0 +47,0 @@ |
{ | ||
"name": "@thndr/babel-plugin-captains-log", | ||
"version": "1.2.0", | ||
"version": "1.2.3", | ||
"files": [ | ||
@@ -23,3 +23,3 @@ "dist" | ||
], | ||
"author": "Amr Draz <draz@thndr.app> (http://thndr.app/)", | ||
"author": "Amr Draz <drz@thndr.app> (http:/thndr.app/)", | ||
"license": "MIT", | ||
@@ -74,6 +74,3 @@ "repository": { | ||
}, | ||
"dependencies": {}, | ||
"engines": { | ||
"node": ">=14.5.0" | ||
} | ||
"dependencies": {} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
27662
165