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

febs

Package Overview
Dependencies
Maintainers
1
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

febs - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

HISTORY.md

@@ -20,1 +20,5 @@

0.2.2
==================
- [feature] 添加global.__debug

2

package.json

@@ -41,3 +41,3 @@ {

"name": "febs",
"version": "0.2.1"
"version": "0.2.2"
}

@@ -48,2 +48,3 @@ febs 库是一些常用的工具的合集;

| __line | 当前所在行, 可以配合 __filename 定位错误日志 |
| __debug | 判断当前的环境process.env.NODE_ENV是否为development, 如对此值设置后, 使用设置后的值. |
| console.debug | development 环境下输出日志 |

@@ -50,0 +51,0 @@

@@ -33,6 +33,22 @@

//
// define the __debug.
if (!global.hasOwnProperty('__debug')) {
Object.defineProperty(global, '__debug', {
get: function() {
if (global.hasOwnProperty('__debugValue'))
return global.__debugValue;
else
return ((process.env.NODE_ENV || 'development') == 'development');
},
set: function(isDebug) {
global.__debugValue = isDebug;
}
});
}
//
// debug.
//
if (!console.debug) {
if ((process.env.NODE_ENV || 'development') == 'development') {
if (global.__debug) {
console.debug = console.warn;

@@ -39,0 +55,0 @@ } else {

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