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

rc-util

Package Overview
Dependencies
Maintainers
6
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-util - npm Package Compare versions

Comparing version 4.10.0 to 4.11.0

8

es/warning.d.ts

@@ -0,3 +1,7 @@

export declare function warning(valid: boolean, message: string): void;
export declare function note(valid: boolean, message: string): void;
export declare function resetWarned(): void;
declare const _default: (valid: boolean, message: string) => void;
export default _default;
export declare function call(method: (valid: boolean, message: string) => void, valid: boolean, message: string): void;
export declare function warningOnce(valid: boolean, message: string): void;
export declare function noteOnce(valid: boolean, message: string): void;
export default warningOnce;

@@ -1,11 +0,31 @@

import warning from 'warning';
/* eslint-disable no-console */
var warned = {};
export function warning(valid, message) {
// Support uglify
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
console.error("Warning: ".concat(message));
}
}
export function note(valid, message) {
// Support uglify
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
console.warn("Note: ".concat(message));
}
}
export function resetWarned() {
warned = {};
}
export default (function (valid, message) {
export function call(method, valid, message) {
if (!valid && !warned[message]) {
warning(false, message);
method(false, message);
warned[message] = true;
}
});
}
export function warningOnce(valid, message) {
call(warning, valid, message);
}
export function noteOnce(valid, message) {
call(note, valid, message);
}
export default warningOnce;
/* eslint-enable */
# History
----
## 4.11.0 / 2019-08-23
- warning support `noteOnce`
## 4.8.0 / 2019-07-09

@@ -5,0 +9,0 @@

@@ -0,3 +1,7 @@

export declare function warning(valid: boolean, message: string): void;
export declare function note(valid: boolean, message: string): void;
export declare function resetWarned(): void;
declare const _default: (valid: boolean, message: string) => void;
export default _default;
export declare function call(method: (valid: boolean, message: string) => void, valid: boolean, message: string): void;
export declare function warningOnce(valid: boolean, message: string): void;
export declare function noteOnce(valid: boolean, message: string): void;
export default warningOnce;

@@ -6,10 +6,26 @@ "use strict";

});
exports.warning = warning;
exports.note = note;
exports.resetWarned = resetWarned;
exports.call = call;
exports.warningOnce = warningOnce;
exports.noteOnce = noteOnce;
exports.default = void 0;
var _warning = _interopRequireDefault(require("warning"));
/* eslint-disable no-console */
var warned = {};
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function warning(valid, message) {
// Support uglify
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
console.error("Warning: ".concat(message));
}
}
var warned = {};
function note(valid, message) {
// Support uglify
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
console.warn("Note: ".concat(message));
}
}

@@ -20,9 +36,20 @@ function resetWarned() {

var _default = function _default(valid, message) {
function call(method, valid, message) {
if (!valid && !warned[message]) {
(0, _warning.default)(false, message);
method(false, message);
warned[message] = true;
}
};
}
function warningOnce(valid, message) {
call(warning, valid, message);
}
function noteOnce(valid, message) {
call(note, valid, message);
}
var _default = warningOnce;
/* eslint-enable */
exports.default = _default;
{
"name": "rc-util",
"version": "4.10.0",
"version": "4.11.0",
"description": "Common Utils For React Component",

@@ -26,3 +26,3 @@ "keywords": [

"scripts": {
"lint": "eslint src/ --ext .tsx,.ts",
"lint": "eslint src/ --ext .tsx,.ts & eslint tests/ --ext .js",
"compile": "father build",

@@ -48,5 +48,4 @@ "prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",

"react-lifecycles-compat": "^3.0.4",
"shallowequal": "^0.2.2",
"warning": "^4.0.3"
"shallowequal": "^0.2.2"
}
}

@@ -133,5 +133,8 @@ # rc-util

```jsx
import warning from 'rc-util/lib/warning';
import warning, { noteOnce } from 'rc-util/lib/warning';
warning(false, '[antd Component] test hello world');
// Low level note
noteOnce(false, '[antd Component] test hello world');
```

@@ -138,0 +141,0 @@

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