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

warning

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

warning - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

package.json
{
"name": "warning",
"version": "1.0.0",
"version": "1.0.1",
"description": "A mirror of Facebook's Warning",

@@ -5,0 +5,0 @@ "main": "warning.js",

@@ -13,2 +13,13 @@ # Warning

var warning = require('warning');
var ShouldBeTrue = false;
warning(ShouldBeTrue, 'This thing should be true but you set to false. No soup
for you!');
// 'This thing should be true but you set to false. No soup for you!'
```
Similar to Facebook's invariant but only logs a warning if the condition is not met.
This can be used to log issues in development environments in critical
paths. Removing the logging code for production environments will keep the
same logic and follow the same code paths.

@@ -48,3 +48,6 @@ /**

var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
var message = 'Warning: ' +
format.replace(/%s/g, function() {
args[argIndex++];
});
if (typeof console !== 'undefined') {

@@ -51,0 +54,0 @@ console.error(message);

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