rc-notification
Advanced tools
Comparing version 5.0.0-alpha.6 to 5.0.0-alpha.7
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray"; | ||
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2"; | ||
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
@@ -13,2 +12,23 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
function mergeConfig() { | ||
var clone = {}; | ||
for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) { | ||
objList[_key] = arguments[_key]; | ||
} | ||
objList.forEach(function (obj) { | ||
if (obj) { | ||
Object.keys(obj).forEach(function (key) { | ||
var val = obj[key]; | ||
if (val !== undefined) { | ||
clone[key] = val; | ||
} | ||
}); | ||
} | ||
}); | ||
return clone; | ||
} | ||
export default function useNotification() { | ||
@@ -55,6 +75,5 @@ var rootConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var mergedConfig = _objectSpread(_objectSpread(_objectSpread({}, shareConfig), config), {}, { | ||
var mergedConfig = mergeConfig(shareConfig, config, { | ||
key: (_config$key = config.key) !== null && _config$key !== void 0 ? _config$key : Date.now() | ||
}); | ||
setTaskQueue(function (queue) { | ||
@@ -61,0 +80,0 @@ return [].concat(_toConsumableArray(queue), [{ |
@@ -14,4 +14,2 @@ "use strict"; | ||
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2")); | ||
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray")); | ||
@@ -31,2 +29,23 @@ | ||
function mergeConfig() { | ||
var clone = {}; | ||
for (var _len = arguments.length, objList = new Array(_len), _key = 0; _key < _len; _key++) { | ||
objList[_key] = arguments[_key]; | ||
} | ||
objList.forEach(function (obj) { | ||
if (obj) { | ||
Object.keys(obj).forEach(function (key) { | ||
var val = obj[key]; | ||
if (val !== undefined) { | ||
clone[key] = val; | ||
} | ||
}); | ||
} | ||
}); | ||
return clone; | ||
} | ||
function useNotification() { | ||
@@ -72,3 +91,3 @@ var rootConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var mergedConfig = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, shareConfig), config), {}, { | ||
var mergedConfig = mergeConfig(shareConfig, config, { | ||
key: (_config$key = config.key) !== null && _config$key !== void 0 ? _config$key : Date.now() | ||
@@ -75,0 +94,0 @@ }); |
{ | ||
"name": "rc-notification", | ||
"version": "5.0.0-alpha.6", | ||
"version": "5.0.0-alpha.7", | ||
"description": "notification ui component for react", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
48086
906