react-event-listener
Advanced tools
Comparing version 0.6.0 to 0.6.1
@@ -143,8 +143,8 @@ (function (global, factory) { | ||
/** | ||
* Copyright 2014-2015, Facebook, Inc. | ||
* All rights reserved. | ||
* Copyright (c) 2014-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. An additional grant | ||
* of patent rights can be found in the PATENTS file in the same directory. | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @providesModule warning | ||
*/ | ||
@@ -155,2 +155,24 @@ | ||
{ | ||
var printWarning = function printWarning(format, args) { | ||
var len = arguments.length; | ||
args = new Array(len > 2 ? len - 2 : 0); | ||
for (var key = 2; key < len; key++) { | ||
args[key - 2] = arguments[key]; | ||
} | ||
var argIndex = 0; | ||
var message = 'Warning: ' + | ||
format.replace(/%s/g, function() { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// --- Welcome to debugging React --- | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch (x) {} | ||
}; | ||
warning = function(condition, format, args) { | ||
@@ -164,28 +186,8 @@ var len = arguments.length; | ||
throw new Error( | ||
'`warning(condition, format, ...args)` requires a warning ' + | ||
'message argument' | ||
'`warning(condition, format, ...args)` requires a warning ' + | ||
'message argument' | ||
); | ||
} | ||
if (format.length < 10 || (/^[s\W]*$/).test(format)) { | ||
throw new Error( | ||
'The warning format should be able to uniquely identify this ' + | ||
'warning. Please, use a more descriptive format than: ' + format | ||
); | ||
} | ||
if (!condition) { | ||
var argIndex = 0; | ||
var message = 'Warning: ' + | ||
format.replace(/%s/g, function() { | ||
return args[argIndex++]; | ||
}); | ||
if (typeof console !== 'undefined') { | ||
console.error(message); | ||
} | ||
try { | ||
// This error was thrown as a convenience so that you can use this stack | ||
// to find the callsite that caused this warning to fire. | ||
throw new Error(message); | ||
} catch(x) {} | ||
printWarning.apply(null, [format].concat(args)); | ||
} | ||
@@ -192,0 +194,0 @@ }; |
{ | ||
"name": "react-event-listener", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "A React component that allow to bind events on the global scope", | ||
@@ -75,3 +75,3 @@ "main": "dist/react-event-listener.cjs.js", | ||
"prop-types": "^15.6.0", | ||
"warning": "^3.0.0" | ||
"warning": "^4.0.1" | ||
}, | ||
@@ -78,0 +78,0 @@ "peerDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34063
9
776
+ Addedwarning@4.0.3(transitive)
- Removedwarning@3.0.0(transitive)
Updatedwarning@^4.0.1