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

takin

Package Overview
Dependencies
Maintainers
1
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

takin - npm Package Compare versions

Comparing version 1.0.4 to 1.0.19

20

lib/logger/index.js

@@ -123,2 +123,8 @@ "use strict";

const FILTER_PARAMETERS_REPLACER = '********';
/**
* 过滤日志参数,替换为 ********,避免敏感信息泄露,仅支持 对象和 Map
* @param obj - 需要过滤的对象
* @param depth - 对象层级
* @returns 过滤后的对象
*/
function filterParameters(obj, depth = 10) {

@@ -131,22 +137,24 @@ if (exports.FILTER_LOGGER_PARAMETERS.size === 0)

if (lodash_1.default.isMap(obj)) {
const map = new Map();
obj.forEach(function (value, key) {
if (exports.FILTER_LOGGER_PARAMETERS.has(key)) {
obj.set(key, FILTER_PARAMETERS_REPLACER);
map.set(key, FILTER_PARAMETERS_REPLACER);
}
else {
obj.set(key, filterParameters(value, restDepth));
map.set(key, filterParameters(value, restDepth));
}
});
return obj;
return map;
}
if (lodash_1.default.isPlainObject(obj)) {
const newObj = {};
for (const key in obj) {
if (exports.FILTER_LOGGER_PARAMETERS.has(key)) {
obj[key] = FILTER_PARAMETERS_REPLACER;
newObj[key] = FILTER_PARAMETERS_REPLACER;
}
else {
obj[key] = filterParameters(obj[key], restDepth);
newObj[key] = filterParameters(obj[key], restDepth);
}
}
return obj;
return newObj;
}

@@ -153,0 +161,0 @@ return obj;

{
"name": "takin",
"version": "1.0.4",
"version": "1.0.19",
"description": "Front end engineering base toolchain and scaffold",

@@ -70,3 +70,3 @@ "main": "lib/index.js",

},
"gitHead": "660989eb25464172cebd90a5ac077d0097c07365"
"gitHead": "8c63c604fe1562b099e193929444ad30316e4da6"
}

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