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

duckfactory

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duckfactory - npm Package Compare versions

Comparing version 1.2.2 to 1.2.3

8

lib/check.js

@@ -25,3 +25,9 @@ 'use strict';

var takenActionNames = new _set2.default();
if (window) {
if (!window.__takenActionNames__) {
window.__takenActionNames__ = new _set2.default();
}
}
var takenActionNames = window ? window.__takenActionNames__ : new _set2.default();
var checkActionName = function checkActionName(actionName) {

@@ -28,0 +34,0 @@ if (typeof actionName !== 'string' && typeof actionName !== 'number') {

34

lib/index.js

@@ -38,8 +38,26 @@ 'use strict';

var canLog = window && window.console;
// -------------------------------------------------------------------- General helpers
var buildPrefix = function buildPrefix(prefix) {
if (prefix != null && typeof prefix !== 'string') {
throw Error("Prefix must be null/undefined, or a string");
}
if (prefix == null || prefix === "" || prefix === "/") {
return "";
}
if (prefix.slice(-1) === '/') {
return prefix;
}
return prefix + "/";
};
var actionNum = 0;
var getActionType = function getActionType(prefix, actionName) {
return (prefix != null ? prefix : "") + (actionName == null || actionName === "" ? "" + actionNum++ : actionName);
return buildPrefix(prefix) + (actionName == null || actionName === "" ? "" + actionNum++ : actionName);
};

@@ -49,2 +67,3 @@

var actionArgumentNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
var logBuilt = arguments[2];
return function () {

@@ -59,3 +78,5 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {

});
console.log("New reducer action:", action);
if (logBuilt) {
console.log("New reducer action:", action);
}
return action;

@@ -80,9 +101,8 @@ };

actionCreatorMap[actionName] = makeActionCreator(actionType, actionArgumentNames);
actionCreatorMap[actionName] = makeActionCreator(actionType, actionArgumentNames, logBuilt);
reducerMap[actionType] = reducerFunction;
typeMap[actionName] = actionType;
if (logBuilt && window.console) {
console.log("\nActionCreator: getActionCreators()." + actionName + "(" + actionArgumentNames.join(", ") + ")");
console.log("\tType: getTypes()." + actionName + " = '" + actionType + "'");
if (logBuilt) {
console.log("Reducer actionCreator: " + actionName + "(" + actionArgumentNames.join(", ") + ") " + "---> type: '" + actionType + "'");
}

@@ -139,3 +159,3 @@ });

var _buildMaps = buildMaps(actionTypePrefix, actionAndReducerMap, checkAndWarn, logBuilt),
var _buildMaps = buildMaps(actionTypePrefix, actionAndReducerMap, checkAndWarn, logBuilt && canLog),
_buildMaps2 = (0, _slicedToArray3.default)(_buildMaps, 3),

@@ -142,0 +162,0 @@ actionCreatorMap = _buildMaps2[0],

{
"name": "duckfactory",
"version": "1.2.2",
"version": "1.2.3",
"description": "Factory for creating redux ducks",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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