New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@cardsgame/utils

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cardsgame/utils - npm Package Compare versions

Comparing version 0.12.6 to 0.12.9

16

lib/arrays.js

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

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -63,3 +67,3 @@ Object.defineProperty(exports, "__esModule", { value: true });

var shuffle = function (array) {
var res = __spreadArray([], __read(array));
var res = __spreadArray([], __read(array), false);
for (var i = res.length - 1; i > 0; i--) {

@@ -79,3 +83,3 @@ var j = Math.floor(Math.random() * (i + 1));

*/
var arrayWith = function (count) { return __spreadArray([], __read(Array(count).keys())); };
var arrayWith = function (count) { return __spreadArray([], __read(Array(count).keys()), false); };
exports.arrayWith = arrayWith;

@@ -82,0 +86,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runAll = exports.times = exports.noop = void 0;
var noop = function () { };
var noop = function () {
// It's a noop, leave it be
};
exports.noop = noop;

@@ -6,0 +8,0 @@ /**

@@ -7,5 +7,5 @@ "use strict";

var type = _a.type, name = _a.name;
return type + ":" + name;
return "".concat(type, ":").concat(name);
};
exports.minifyEntity = minifyEntity;
//# sourceMappingURL=utils.js.map

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

};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};

@@ -86,3 +90,3 @@ var __importDefault = (this && this.__importDefault) || function (mod) {

if (arg && arg._state) {
return exports.chalk.yellow(utils_1.minifyEntity(arg));
return exports.chalk.yellow((0, utils_1.minifyEntity)(arg));
}

@@ -120,3 +124,3 @@ return arg;

"\t"
], __read(args.map(function (arg) { return exports.chalk.gray(arg); }))));
], __read(args.map(function (arg) { return exports.chalk.gray(arg); })), false));
},

@@ -131,3 +135,3 @@ debug: function () {

"\t"
], __read(args.map(function (arg) { return exports.chalk.gray(arg); }))));
], __read(args.map(function (arg) { return exports.chalk.gray(arg); })), false));
},

@@ -142,4 +146,4 @@ notice: function (first) {

_getIndent(),
first + ":"
], __read(args.map(syntaxHighlight))));
"".concat(first, ":")
], __read(args.map(syntaxHighlight)), false));
}

@@ -158,4 +162,4 @@ else {

_getIndent(),
first + ":"
], __read(args.map(syntaxHighlight))));
"".concat(first, ":")
], __read(args.map(syntaxHighlight)), false));
}

@@ -172,4 +176,4 @@ else {

console.info.apply(console, __spreadArray([
_getIndent() + exports.chalk.bgBlue.black(" " + first + " ")
], __read(args.map(syntaxHighlight))));
_getIndent() + exports.chalk.bgBlue.black(" ".concat(first, " "))
], __read(args.map(syntaxHighlight)), false));
},

@@ -182,4 +186,4 @@ warn: function (first) {

console.warn.apply(console, __spreadArray([
_getIndent() + exports.chalk.bgYellow.black(" " + first + " ")
], __read(args.map(syntaxHighlight))));
_getIndent() + exports.chalk.bgYellow.black(" ".concat(first, " "))
], __read(args.map(syntaxHighlight)), false));
},

@@ -192,4 +196,4 @@ error: function (first) {

console.error.apply(console, __spreadArray([
_getIndent() + exports.chalk.bgRed(" " + first + " ")
], __read(args.map(syntaxHighlight))));
_getIndent() + exports.chalk.bgRed.white(" ".concat(first, " "))
], __read(args.map(syntaxHighlight)), false));
},

@@ -201,3 +205,3 @@ group: function (first) {

}
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u250D\u2501" + first], __read(args)));
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u250D\u2501".concat(first)], __read(args), false));
_indentLevel++;

@@ -210,3 +214,3 @@ },

}
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u250D\u2501" + first], __read(args)));
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u250D\u2501".concat(first)], __read(args), false));
_indentLevel++;

@@ -221,3 +225,3 @@ },

_indentLevel = Math.max(_indentLevel - 1, 0);
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u2515\u2501" + first], __read(args)));
logsPreExport.log.apply(logsPreExport, __spreadArray(["\u2515\u2501".concat(first)], __read(args), false));
},

@@ -280,4 +284,4 @@ };

console.error.apply(console, __spreadArray([
style(getIndent() + exports.chalk.bgRed(" " + first + " "))
], __read(args.map(syntaxHighlight))));
style(getIndent() + exports.chalk.bgRed.white(" ".concat(first, " ")))
], __read(args.map(syntaxHighlight)), false));
}

@@ -293,4 +297,4 @@ : functions_1.noop;

console.warn.apply(console, __spreadArray([
style(getIndent() + exports.chalk.bgYellow.black(" " + first + " "))
], __read(args.map(syntaxHighlight))));
style(getIndent() + exports.chalk.bgYellow.black(" ".concat(first, " ")))
], __read(args.map(syntaxHighlight)), false));
}

@@ -306,4 +310,4 @@ : functions_1.noop;

console.info.apply(console, __spreadArray([
style(getIndent() + exports.chalk.bgBlue.black(" " + first + " "))
], __read(args.map(syntaxHighlight))));
style(getIndent() + exports.chalk.bgBlue.black(" ".concat(first, " ")))
], __read(args.map(syntaxHighlight)), false));
}

@@ -320,4 +324,4 @@ : functions_1.noop;

console.log.apply(console, __spreadArray([
style(getIndent(), first + ":")
], __read(args.map(syntaxHighlight))));
style(getIndent(), "".concat(first, ":"))
], __read(args.map(syntaxHighlight)), false));
}

@@ -338,4 +342,4 @@ else {

console.debug.apply(console, __spreadArray([
style(getIndent() + "\t")
], __read(args.map(function (arg) { return exports.chalk.gray(arg); }))));
style("".concat(getIndent(), "\t"))
], __read(args.map(function (arg) { return exports.chalk.gray(arg); })), false));
}

@@ -349,3 +353,3 @@ : functions_1.noop;

}
_log.apply(void 0, __spreadArray(["\u250D\u2501" + first], __read(args)));
_log.apply(void 0, __spreadArray(["\u250D\u2501".concat(first)], __read(args), false));
indentLevel++;

@@ -360,3 +364,3 @@ }

}
_log.apply(void 0, __spreadArray(["\u250D\u2501" + first], __read(args)));
_log.apply(void 0, __spreadArray(["\u250D\u2501".concat(first)], __read(args), false));
indentLevel++;

@@ -373,3 +377,3 @@ }

indentLevel = Math.max(indentLevel - 1, 0);
_log.apply(void 0, __spreadArray(["\u2515\u2501" + first], __read(args)));
_log.apply(void 0, __spreadArray(["\u2515\u2501".concat(first)], __read(args), false));
}

@@ -382,3 +386,3 @@ : functions_1.noop;

? (function () {
return Function.prototype.bind.call(console.error, console, "%c " + name + " ", style);
return Function.prototype.bind.call(console.error, console, "%c ".concat(name, " "), style);
})()

@@ -389,3 +393,3 @@ : functions_1.noop;

? (function () {
return Function.prototype.bind.call(console.warn, console, "%c " + name + " ", style);
return Function.prototype.bind.call(console.warn, console, "%c ".concat(name, " "), style);
})()

@@ -396,3 +400,3 @@ : functions_1.noop;

? (function () {
return Function.prototype.bind.call(console.info, console, "%c " + name + " ", style);
return Function.prototype.bind.call(console.info, console, "%c ".concat(name, " "), style);
})()

@@ -403,3 +407,3 @@ : functions_1.noop;

? (function () {
return Function.prototype.bind.call(console.log, console, "%c " + name + " ", style);
return Function.prototype.bind.call(console.log, console, "%c ".concat(name, " "), style);
})()

@@ -410,10 +414,10 @@ : functions_1.noop;

? (function () {
return Function.prototype.bind.call(console.debug, console, "%c " + name + " ", style + BROWSER_DEBUG_STYLE);
return Function.prototype.bind.call(console.debug, console, "%c ".concat(name, " "), style + BROWSER_DEBUG_STYLE);
})()
: functions_1.noop;
this["group"] = this.enabled
? console.group.bind(console, "%c " + name + " ", style)
? console.group.bind(console, "%c ".concat(name, " "), style)
: functions_1.noop;
this["groupCollapsed"] = this.enabled
? console.groupCollapsed.bind(console, "%c " + name + " ", style)
? console.groupCollapsed.bind(console, "%c ".concat(name, " "), style)
: functions_1.noop;

@@ -420,0 +424,0 @@ this["groupEnd"] = this.enabled

@@ -7,3 +7,11 @@ "use strict";

if (max === void 0) { max = 1; }
return val < min ? min : val > max ? max : val;
if (val < min) {
return min;
}
else if (val > max) {
return max;
}
else {
return val;
}
};

@@ -14,5 +22,8 @@ exports.limit = limit;

if (max === void 0) { max = 1; }
if (max === 0)
if (max === 0) {
return val;
return ((val % max) + max) % max;
}
else {
return ((val % max) + max) % max;
}
};

@@ -35,3 +46,3 @@ exports.wrap = wrap;

// returns 1: 0.7853981633974483
return angle * 0.017453292519943295; // (angle / 180) * Math.PI;
return angle * 0.017453292519943295; // (angle / 180) * Math.PI
};

@@ -38,0 +49,0 @@ exports.deg2rad = deg2rad;

@@ -10,3 +10,3 @@ "use strict";

var arrResult_1 = [];
value.forEach(function (v) { return arrResult_1.push(exports.deepClone(v)); });
value.forEach(function (v) { return arrResult_1.push((0, exports.deepClone)(v)); });
return arrResult_1;

@@ -16,3 +16,3 @@ }

var objResult_1 = {};
Object.keys(value).forEach(function (key) { return (objResult_1[key] = exports.deepClone(value[key])); });
Object.keys(value).forEach(function (key) { return (objResult_1[key] = (0, exports.deepClone)(value[key])); });
return objResult_1;

@@ -19,0 +19,0 @@ }

@@ -10,7 +10,10 @@ "use strict";

if (maxLength === void 0) { maxLength = 7; }
if (typeof string !== "string")
if (typeof string !== "string") {
return;
return string.length <= maxLength
? string
: string.substr(0, maxLength - 1) + "…";
}
else {
return string.length <= maxLength
? string
: string.substr(0, maxLength - 1) + "…";
}
};

@@ -17,0 +20,0 @@ exports.trim = trim;

@@ -18,2 +18,6 @@ /// <reference types="@cardsgame/types" />

export declare const isMap: (thing: unknown) => thing is Map<any, any>;
/**
* Has somewhat same interface to native Map
*/
export declare const isMapLike: (thing: unknown) => boolean;
export declare const isSet: (thing: unknown) => thing is Set<any>;

@@ -20,0 +24,0 @@ /**

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyMixins = exports.isObject = exports.isSet = exports.isMap = exports.timeout = exports.compose = exports.def = void 0;
exports.applyMixins = exports.isObject = exports.isSet = exports.isMapLike = exports.isMap = exports.timeout = exports.compose = exports.def = void 0;
/**

@@ -33,3 +33,3 @@ * Returns first, *defined* value

else {
throw new Error("utils/compose, I expected a function here, got \"" + typeof fn + "\" instead...");
throw new Error("utils/compose, I expected a function here, got \"".concat(typeof fn, "\" instead..."));
}

@@ -58,2 +58,20 @@ }, value);

exports.isMap = isMap;
/**
* Has somewhat same interface to native Map
*/
var isMapLike = function (thing) {
if ((0, exports.isMap)(thing)) {
return true;
}
else {
return (typeof thing === "object" &&
"size" in thing &&
typeof thing["size"] === "number" &&
"get" in thing &&
typeof thing["get"] === "function" &&
"set" in thing &&
typeof thing["set"] === "function");
}
};
exports.isMapLike = isMapLike;
var isSet = function (thing) {

@@ -79,3 +97,3 @@ try {

}
if (Array.isArray(thing) || exports.isMap(thing) || exports.isSet(thing)) {
if (Array.isArray(thing) || (0, exports.isMap)(thing) || (0, exports.isSet)(thing)) {
return false;

@@ -82,0 +100,0 @@ }

{
"name": "@cardsgame/utils",
"version": "0.12.6",
"version": "0.12.9",
"description": "",

@@ -26,3 +26,3 @@ "author": "Darek Greenly (https://darekgreenly.com)",

"dependencies": {
"@cardsgame/types": "^0.12.1",
"@cardsgame/types": "file:../types",
"chalk": "^4.1.0"

@@ -32,4 +32,3 @@ },

"@types/node": "^14.14.6"
},
"gitHead": "ac78c7c585b4e0e76d18f62e76ebad628020a11e"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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