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

expect-more

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expect-more - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

6

dist/ends-with.js

@@ -16,6 +16,6 @@ "use strict";

*/
exports.endsWith = curry2_1.curry2(function (otherString, value) {
return is_non_empty_string_1.isNonEmptyString(value) &&
is_non_empty_string_1.isNonEmptyString(otherString) &&
exports.endsWith = (0, curry2_1.curry2)(function (otherString, value) {
return (0, is_non_empty_string_1.isNonEmptyString)(value) &&
(0, is_non_empty_string_1.isNonEmptyString)(otherString) &&
value.slice(value.length - otherString.length, value.length) === otherString;
});
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -21,4 +21,4 @@ export interface RootNode {

}
declare type TreeNode = RootNode | DeepNode;
export declare type DeepNodeVisitor = (node: DeepNode, requestMutation: (applyMutation: (key: DeepNode['key'], clonedParent: any) => void) => void) => void;
type TreeNode = RootNode | DeepNode;
export type DeepNodeVisitor = (node: DeepNode, requestMutation: (applyMutation: (key: DeepNode['key'], clonedParent: any) => void) => void) => void;
export declare const createTreePermuter: (visitor: DeepNodeVisitor, initialValues?: any[]) => (rootNode: any) => Generator<any, void, undefined>;

@@ -25,0 +25,0 @@ export declare const removeNode: DeepNodeVisitor;

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

if (f) throw new TypeError("Generator is already executing.");
while (_) try {
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;

@@ -50,11 +50,11 @@ if (y = 0, t) op = [op[0] & 2, t.value];

function visit(node) {
var i, len, _a, _b, _i, key;
return __generator(this, function (_c) {
switch (_c.label) {
var i, len, _a, _b, _c, _i, key;
return __generator(this, function (_d) {
switch (_d.label) {
case 0: return [4 /*yield*/, node];
case 1:
_c.sent();
if (!is_array_1.isArray(node.value)) return [3 /*break*/, 6];
_d.sent();
if (!(0, is_array_1.isArray)(node.value)) return [3 /*break*/, 6];
i = 0, len = node.value.length;
_c.label = 2;
_d.label = 2;
case 2:

@@ -69,4 +69,4 @@ if (!(i < len)) return [3 /*break*/, 5];

case 3:
_c.sent();
_c.label = 4;
_d.sent();
_d.label = 4;
case 4:

@@ -77,11 +77,14 @@ i++;

case 6:
if (!is_object_1.isObject(node.value)) return [3 /*break*/, 10];
_a = [];
for (_b in node.value)
_a.push(_b);
if (!(0, is_object_1.isObject)(node.value)) return [3 /*break*/, 10];
_a = node.value;
_b = [];
for (_c in _a)
_b.push(_c);
_i = 0;
_c.label = 7;
_d.label = 7;
case 7:
if (!(_i < _a.length)) return [3 /*break*/, 10];
key = _a[_i];
if (!(_i < _b.length)) return [3 /*break*/, 10];
_c = _b[_i];
if (!(_c in _a)) return [3 /*break*/, 9];
key = _c;
if (!node.value.hasOwnProperty(key)) return [3 /*break*/, 9];

@@ -95,4 +98,4 @@ return [5 /*yield**/, __values(visit({

case 8:
_c.sent();
_c.label = 9;
_d.sent();
_d.label = 9;
case 9:

@@ -129,7 +132,7 @@ _i++;

node = traverser_1_1.value;
if (is_array_1.isArray(node.value)) {
if ((0, is_array_1.isArray)(node.value)) {
node.isArray = true;
node.isBranch = true;
}
else if (is_object_1.isObject(node.value)) {
else if ((0, is_object_1.isObject)(node.value)) {
node.isBranch = true;

@@ -136,0 +139,0 @@ node.isObject = true;

@@ -9,6 +9,6 @@ "use strict";

*/
exports.withMissingBranches = lib_1.createTreePermuter(function (node, mutateNode) {
exports.withMissingBranches = (0, lib_1.createTreePermuter)(function (node, mutateNode) {
if (node.isBranch) {
lib_1.removeNode(node, mutateNode);
(0, lib_1.removeNode)(node, mutateNode);
}
}, [undefined]);

@@ -9,6 +9,6 @@ "use strict";

*/
exports.withMissingLeaves = lib_1.createTreePermuter(function (node, mutateNode) {
exports.withMissingLeaves = (0, lib_1.createTreePermuter)(function (node, mutateNode) {
if (node.isLeaf) {
lib_1.removeNode(node, mutateNode);
(0, lib_1.removeNode)(node, mutateNode);
}
}, [undefined]);

@@ -9,2 +9,2 @@ "use strict";

*/
exports.withMissingNodes = lib_1.createTreePermuter(lib_1.removeNode, [undefined]);
exports.withMissingNodes = (0, lib_1.createTreePermuter)(lib_1.removeNode, [undefined]);

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

*/
exports.withNullBranches = lib_1.createTreePermuter(function (node, mutateNode) {
exports.withNullBranches = (0, lib_1.createTreePermuter)(function (node, mutateNode) {
if (node.isBranch) {
lib_1.nullifyNode(node, mutateNode);
(0, lib_1.nullifyNode)(node, mutateNode);
}
}, [null]);

@@ -9,6 +9,6 @@ "use strict";

*/
exports.withNullLeaves = lib_1.createTreePermuter(function (node, mutateNode) {
exports.withNullLeaves = (0, lib_1.createTreePermuter)(function (node, mutateNode) {
if (node.isLeaf) {
lib_1.nullifyNode(node, mutateNode);
(0, lib_1.nullifyNode)(node, mutateNode);
}
}, [null]);

@@ -9,2 +9,2 @@ "use strict";

*/
exports.withNullNodes = lib_1.createTreePermuter(lib_1.nullifyNode, [null]);
exports.withNullNodes = (0, lib_1.createTreePermuter)(lib_1.nullifyNode, [null]);

@@ -19,4 +19,4 @@ "use strict";

*/
exports.hasMember = curry2_1.curry2(function (ownKeyName, value) {
return is_string_1.isString(ownKeyName) && is_walkable_1.isWalkable(value) && ownKeyName in value;
exports.hasMember = (0, curry2_1.curry2)(function (ownKeyName, value) {
return (0, is_string_1.isString)(ownKeyName) && (0, is_walkable_1.isWalkable)(value) && ownKeyName in value;
});
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isAfter = curry2_1.curry2(function (otherDate, value) {
return is_date_1.isDate(value) && is_date_1.isDate(otherDate) && value.getTime() > otherDate.getTime();
exports.isAfter = (0, curry2_1.curry2)(function (otherDate, value) {
return (0, is_date_1.isDate)(value) && (0, is_date_1.isDate)(otherDate) && value.getTime() > otherDate.getTime();
});

@@ -22,6 +22,6 @@ "use strict";

*/
exports.isArrayIncludingAllOf = curry2_1.curry2(function (requiredValues, value) {
return is_array_1.isArray(requiredValues) &&
is_array_1.isArray(value) &&
every_1.every(function (requiredValue) { return includes_1.includes(requiredValue, value); }, requiredValues);
exports.isArrayIncludingAllOf = (0, curry2_1.curry2)(function (requiredValues, value) {
return (0, is_array_1.isArray)(requiredValues) &&
(0, is_array_1.isArray)(value) &&
(0, every_1.every)(function (requiredValue) { return (0, includes_1.includes)(requiredValue, value); }, requiredValues);
});

@@ -20,4 +20,4 @@ "use strict";

*/
exports.isArrayIncludingAnyOf = curry2_1.curry2(function (values, value) {
return is_array_1.isArray(values) && some_1.some(function (other) { return includes_1.includes(other, value); }, values);
exports.isArrayIncludingAnyOf = (0, curry2_1.curry2)(function (values, value) {
return (0, is_array_1.isArray)(values) && (0, some_1.some)(function (other) { return (0, includes_1.includes)(other, value); }, values);
});

@@ -22,6 +22,6 @@ "use strict";

*/
exports.isArrayIncludingOnly = curry2_1.curry2(function (allowedValues, value) {
return is_array_1.isArray(allowedValues) &&
is_array_1.isArray(value) &&
every_1.every(function (member) { return includes_1.includes(member, allowedValues); }, value);
exports.isArrayIncludingOnly = (0, curry2_1.curry2)(function (allowedValues, value) {
return (0, is_array_1.isArray)(allowedValues) &&
(0, is_array_1.isArray)(value) &&
(0, every_1.every)(function (member) { return (0, includes_1.includes)(member, allowedValues); }, value);
});

@@ -18,4 +18,4 @@ "use strict";

var isArrayOfBooleans = function (value) {
return is_array_1.isArray(value) && every_1.every(is_boolean_1.isBoolean, value);
return (0, is_array_1.isArray)(value) && (0, every_1.every)(is_boolean_1.isBoolean, value);
};
exports.isArrayOfBooleans = isArrayOfBooleans;

@@ -18,4 +18,4 @@ "use strict";

var isArrayOfNumbers = function (value) {
return is_array_1.isArray(value) && every_1.every(is_number_1.isNumber, value);
return (0, is_array_1.isArray)(value) && (0, every_1.every)(is_number_1.isNumber, value);
};
exports.isArrayOfNumbers = isArrayOfNumbers;

@@ -18,4 +18,4 @@ "use strict";

var isArrayOfObjects = function (value) {
return is_array_1.isArray(value) && every_1.every(is_object_1.isObject, value);
return (0, is_array_1.isArray)(value) && (0, every_1.every)(is_object_1.isObject, value);
};
exports.isArrayOfObjects = isArrayOfObjects;

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isArrayOfSize = curry2_1.curry2(function (size, value) {
return is_array_1.isArray(value) && is_number_1.isNumber(size) && value.length === size;
exports.isArrayOfSize = (0, curry2_1.curry2)(function (size, value) {
return (0, is_array_1.isArray)(value) && (0, is_number_1.isNumber)(size) && value.length === size;
});

@@ -18,4 +18,4 @@ "use strict";

var isArrayOfStrings = function (value) {
return is_array_1.isArray(value) && every_1.every(is_string_1.isString, value);
return (0, is_array_1.isArray)(value) && (0, every_1.every)(is_string_1.isString, value);
};
exports.isArrayOfStrings = isArrayOfStrings;

@@ -14,2 +14,2 @@ "use strict";

*/
exports.isArray = has_type_1.hasType('Array');
exports.isArray = (0, has_type_1.hasType)('Array');

@@ -14,2 +14,2 @@ "use strict";

*/
exports.isAsyncFunction = has_type_1.hasType('AsyncFunction');
exports.isAsyncFunction = (0, has_type_1.hasType)('AsyncFunction');

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isBefore = curry2_1.curry2(function (other, value) {
return is_after_1.isAfter(value, other);
exports.isBefore = (0, curry2_1.curry2)(function (other, value) {
return (0, is_after_1.isAfter)(value, other);
});

@@ -16,2 +16,2 @@ "use strict";

*/
exports.isBoolean = has_type_1.hasType('Boolean');
exports.isBoolean = (0, has_type_1.hasType)('Boolean');

@@ -21,8 +21,8 @@ "use strict";

*/
exports.isDateBetween = curry3_1.curry3(function (floor, ceiling, value) {
return is_date_1.isDate(value) &&
is_date_1.isDate(floor) &&
is_date_1.isDate(ceiling) &&
is_less_than_or_equal_to_1.isLessThanOrEqualTo(ceiling.getTime(), value.getTime()) &&
is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo(floor.getTime(), value.getTime());
exports.isDateBetween = (0, curry3_1.curry3)(function (floor, ceiling, value) {
return (0, is_date_1.isDate)(value) &&
(0, is_date_1.isDate)(floor) &&
(0, is_date_1.isDate)(ceiling) &&
(0, is_less_than_or_equal_to_1.isLessThanOrEqualTo)(ceiling.getTime(), value.getTime()) &&
(0, is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo)(floor.getTime(), value.getTime());
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isDateInMonth = curry2_1.curry2(function (index, value) {
return is_date_1.isDate(value) && is_number_1.isNumber(index) && value.getMonth() === index;
exports.isDateInMonth = (0, curry2_1.curry2)(function (index, value) {
return (0, is_date_1.isDate)(value) && (0, is_number_1.isNumber)(index) && value.getMonth() === index;
});

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isDateInYear = curry2_1.curry2(function (year, value) {
return is_date_1.isDate(value) && is_number_1.isNumber(year) && value.getFullYear() === year;
exports.isDateInYear = (0, curry2_1.curry2)(function (year, value) {
return (0, is_date_1.isDate)(value) && (0, is_number_1.isNumber)(year) && value.getFullYear() === year;
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isDateOnDayOfMonth = curry2_1.curry2(function (dayOfMonth, value) {
return is_date_1.isDate(value) && is_number_1.isNumber(dayOfMonth) && value.getDate() === dayOfMonth;
exports.isDateOnDayOfMonth = (0, curry2_1.curry2)(function (dayOfMonth, value) {
return (0, is_date_1.isDate)(value) && (0, is_number_1.isNumber)(dayOfMonth) && value.getDate() === dayOfMonth;
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isDateOnDayOfWeek = curry2_1.curry2(function (index, value) {
return is_date_1.isDate(value) && is_number_1.isNumber(index) && value.getDay() === index;
exports.isDateOnDayOfWeek = (0, curry2_1.curry2)(function (index, value) {
return (0, is_date_1.isDate)(value) && (0, is_number_1.isNumber)(index) && value.getDay() === index;
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isDateOnOrAfter = curry2_1.curry2(function (other, value) {
return is_date_1.isDate(value) && is_date_1.isDate(other) && is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo(other.getTime(), value.getTime());
exports.isDateOnOrAfter = (0, curry2_1.curry2)(function (other, value) {
return (0, is_date_1.isDate)(value) && (0, is_date_1.isDate)(other) && (0, is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo)(other.getTime(), value.getTime());
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isDateOnOrBefore = curry2_1.curry2(function (other, value) {
return is_date_1.isDate(value) && is_date_1.isDate(other) && is_less_than_or_equal_to_1.isLessThanOrEqualTo(other.getTime(), value.getTime());
exports.isDateOnOrBefore = (0, curry2_1.curry2)(function (other, value) {
return (0, is_date_1.isDate)(value) && (0, is_date_1.isDate)(other) && (0, is_less_than_or_equal_to_1.isLessThanOrEqualTo)(other.getTime(), value.getTime());
});

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isDate = has_type_1.hasType('Date');
exports.isDate = (0, has_type_1.hasType)('Date');

@@ -15,4 +15,4 @@ "use strict";

var isDecimalNumber = function (value) {
return is_number_1.isNumber(value) && String(value).indexOf('.') !== -1;
return (0, is_number_1.isNumber)(value) && String(value).indexOf('.') !== -1;
};
exports.isDecimalNumber = isDecimalNumber;

@@ -16,4 +16,4 @@ "use strict";

*/
exports.isDivisibleBy = curry2_1.curry2(function (other, value) {
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value % other === 0;
exports.isDivisibleBy = (0, curry2_1.curry2)(function (other, value) {
return (0, is_number_1.isNumber)(value) && (0, is_number_1.isNumber)(other) && value % other === 0;
});

@@ -14,4 +14,4 @@ "use strict";

var isEmptyArray = function (value) {
return is_array_of_size_1.isArrayOfSize(0, value);
return (0, is_array_of_size_1.isArrayOfSize)(0, value);
};
exports.isEmptyArray = isEmptyArray;

@@ -9,2 +9,2 @@ /**

*/
export declare const isEmptyObject: <T extends unknown = any>(value: unknown) => value is T;
export declare const isEmptyObject: <T extends Record<string, unknown>>(value: unknown) => value is T;

@@ -15,4 +15,4 @@ "use strict";

var isEmptyObject = function (value) {
return is_object_1.isObject(value) && keys_1.keys(value).length === 0;
return (0, is_object_1.isObject)(value) && (0, keys_1.keys)(value).length === 0;
};
exports.isEmptyObject = isEmptyObject;

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

*/
var isEmptyString = function (value) { return is_string_1.isString(value) && value.length === 0; };
var isEmptyString = function (value) { return (0, is_string_1.isString)(value) && value.length === 0; };
exports.isEmptyString = isEmptyString;

@@ -15,4 +15,4 @@ "use strict";

var isEvenNumber = function (value) {
return is_number_1.isNumber(value) && is_divisible_by_1.isDivisibleBy(2, value);
return (0, is_number_1.isNumber)(value) && (0, is_divisible_by_1.isDivisibleBy)(2, value);
};
exports.isEvenNumber = isEvenNumber;

@@ -14,4 +14,4 @@ "use strict";

var isFalse = function (value) {
return value === false || (is_boolean_1.isBoolean(value) && value.valueOf() === false);
return value === false || ((0, is_boolean_1.isBoolean)(value) && value.valueOf() === false);
};
exports.isFalse = isFalse;

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isGeneratorFunction = has_type_1.hasType('GeneratorFunction');
exports.isGeneratorFunction = (0, has_type_1.hasType)('GeneratorFunction');

@@ -16,4 +16,4 @@ "use strict";

*/
exports.isGreaterThanOrEqualTo = curry2_1.curry2(function (other, value) {
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value >= other;
exports.isGreaterThanOrEqualTo = (0, curry2_1.curry2)(function (other, value) {
return (0, is_number_1.isNumber)(value) && (0, is_number_1.isNumber)(other) && value >= other;
});

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

// '1999-12-31T23:59:59.000Z'
return (is_string_1.isString(value) &&
return ((0, is_string_1.isString)(value) &&
(/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/.test(value) ||

@@ -28,4 +28,4 @@ /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})$/.test(value) ||

/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})\.([0-9]{3})Z$/.test(value)) &&
is_valid_date_1.isValidDate(new Date(value)));
(0, is_valid_date_1.isValidDate)(new Date(value)));
};
exports.isIso8601 = isIso8601;

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

try {
return is_string_1.isString(value) && JSON.parse(value) !== null;
return (0, is_string_1.isString)(value) && JSON.parse(value) !== null;
}

@@ -18,0 +18,0 @@ catch (err) {

@@ -15,4 +15,4 @@ "use strict";

*/
exports.isLessThanOrEqualTo = curry2_1.curry2(function (other, value) {
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value <= other;
exports.isLessThanOrEqualTo = (0, curry2_1.curry2)(function (other, value) {
return (0, is_number_1.isNumber)(value) && (0, is_number_1.isNumber)(other) && value <= other;
});

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isLongerThan = curry2_1.curry2(function (other, value) {
return is_indexed_list_1.isIndexedList(value) && is_indexed_list_1.isIndexedList(other) && value.length > other.length;
exports.isLongerThan = (0, curry2_1.curry2)(function (other, value) {
return (0, is_indexed_list_1.isIndexedList)(value) && (0, is_indexed_list_1.isIndexedList)(other) && value.length > other.length;
});

@@ -19,4 +19,4 @@ "use strict";

*/
exports.isNear = curry3_1.curry3(function (otherNumber, epsilon, value) {
return is_within_range_1.isWithinRange(otherNumber - epsilon, otherNumber + epsilon, value);
exports.isNear = (0, curry3_1.curry3)(function (otherNumber, epsilon, value) {
return (0, is_within_range_1.isWithinRange)(otherNumber - epsilon, otherNumber + epsilon, value);
});

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

*/
var isNegativeNumber = function (value) { return is_number_1.isNumber(value) && value < 0; };
var isNegativeNumber = function (value) { return (0, is_number_1.isNumber)(value) && value < 0; };
exports.isNegativeNumber = isNegativeNumber;

@@ -15,4 +15,4 @@ "use strict";

var isNil = function (value) {
return is_null_1.isNull(value) || is_undefined_1.isUndefined(value);
return (0, is_null_1.isNull)(value) || (0, is_undefined_1.isUndefined)(value);
};
exports.isNil = isNil;

@@ -15,4 +15,4 @@ "use strict";

var isNonEmptyArray = function (value) {
return is_array_1.isArray(value) && value.length > 0;
return (0, is_array_1.isArray)(value) && value.length > 0;
};
exports.isNonEmptyArray = isNonEmptyArray;

@@ -17,4 +17,4 @@ "use strict";

var isNonEmptyObject = function (value) {
return is_object_1.isObject(value) && keys_1.keys(value).length > 0;
return (0, is_object_1.isObject)(value) && (0, keys_1.keys)(value).length > 0;
};
exports.isNonEmptyObject = isNonEmptyObject;

@@ -15,4 +15,4 @@ "use strict";

var isNonEmptyString = function (value) {
return is_string_1.isString(value) && value.length > 0;
return (0, is_string_1.isString)(value) && value.length > 0;
};
exports.isNonEmptyString = isNonEmptyString;

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isNull = has_type_1.hasType('Null');
exports.isNull = (0, has_type_1.hasType)('Null');

@@ -14,4 +14,4 @@ "use strict";

var isNumber = function (value) {
return has_type_1.hasType('Number')(value) && !isNaN(parseFloat(String(value)));
return (0, has_type_1.hasType)('Number')(value) && !isNaN(parseFloat(String(value)));
};
exports.isNumber = isNumber;

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isObject = has_type_1.hasType('Object');
exports.isObject = (0, has_type_1.hasType)('Object');

@@ -15,4 +15,4 @@ "use strict";

var isOddNumber = function (value) {
return is_number_1.isNumber(value) && !is_divisible_by_1.isDivisibleBy(2, value);
return (0, is_number_1.isNumber)(value) && !(0, is_divisible_by_1.isDivisibleBy)(2, value);
};
exports.isOddNumber = isOddNumber;

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

*/
var isPositiveNumber = function (value) { return is_number_1.isNumber(value) && value > 0; };
var isPositiveNumber = function (value) { return (0, is_number_1.isNumber)(value) && value > 0; };
exports.isPositiveNumber = isPositiveNumber;

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isRegExp = has_type_1.hasType('RegExp');
exports.isRegExp = (0, has_type_1.hasType)('RegExp');

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isSameLengthAs = curry2_1.curry2(function (other, value) {
return is_indexed_list_1.isIndexedList(value) && is_indexed_list_1.isIndexedList(other) && value.length === other.length;
exports.isSameLengthAs = (0, curry2_1.curry2)(function (other, value) {
return (0, is_indexed_list_1.isIndexedList)(value) && (0, is_indexed_list_1.isIndexedList)(other) && value.length === other.length;
});

@@ -18,4 +18,4 @@ "use strict";

*/
exports.isShorterThan = curry2_1.curry2(function (other, value) {
return is_indexed_list_1.isIndexedList(value) && is_indexed_list_1.isIndexedList(other) && value.length < other.length;
exports.isShorterThan = (0, curry2_1.curry2)(function (other, value) {
return (0, is_indexed_list_1.isIndexedList)(value) && (0, is_indexed_list_1.isIndexedList)(other) && value.length < other.length;
});

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isString = has_type_1.hasType('String');
exports.isString = (0, has_type_1.hasType)('String');

@@ -14,4 +14,4 @@ "use strict";

var isTrue = function (value) {
return value === true || (is_boolean_1.isBoolean(value) && value.valueOf() === true);
return value === true || ((0, is_boolean_1.isBoolean)(value) && value.valueOf() === true);
};
exports.isTrue = isTrue;

@@ -13,2 +13,2 @@ "use strict";

*/
exports.isUndefined = has_type_1.hasType('Undefined');
exports.isUndefined = (0, has_type_1.hasType)('Undefined');

@@ -19,4 +19,4 @@ "use strict";

var isValidDate = function (value) {
return is_date_1.isDate(value) && !isNaN(value.getTime());
return (0, is_date_1.isDate)(value) && !isNaN(value.getTime());
};
exports.isValidDate = isValidDate;

@@ -17,4 +17,4 @@ "use strict";

var isVisibleString = function (value) {
return is_string_1.isString(value) && value.length > 0 && value.search(/\S/) !== -1;
return (0, is_string_1.isString)(value) && value.length > 0 && value.search(/\S/) !== -1;
};
exports.isVisibleString = isVisibleString;

@@ -15,4 +15,4 @@ "use strict";

var isWalkable = function (value) {
return !is_null_1.isNull(value) && !is_undefined_1.isUndefined(value);
return !(0, is_null_1.isNull)(value) && !(0, is_undefined_1.isUndefined)(value);
};
exports.isWalkable = isWalkable;

@@ -16,4 +16,4 @@ "use strict";

var isWhitespace = function (value) {
return is_string_1.isString(value) && value.search(/\S/) === -1;
return (0, is_string_1.isString)(value) && value.search(/\S/) === -1;
};
exports.isWhitespace = isWhitespace;

@@ -15,4 +15,4 @@ "use strict";

var isWholeNumber = function (value) {
return is_number_1.isNumber(value) && (value === 0 || is_divisible_by_1.isDivisibleBy(1, value));
return (0, is_number_1.isNumber)(value) && (value === 0 || (0, is_divisible_by_1.isDivisibleBy)(1, value));
};
exports.isWholeNumber = isWholeNumber;

@@ -20,4 +20,4 @@ "use strict";

*/
exports.isWithinRange = curry3_1.curry3(function (floor, ceiling, value) {
return is_less_than_or_equal_to_1.isLessThanOrEqualTo(ceiling, value) && is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo(floor, value);
exports.isWithinRange = (0, curry3_1.curry3)(function (floor, ceiling, value) {
return (0, is_less_than_or_equal_to_1.isLessThanOrEqualTo)(ceiling, value) && (0, is_greater_than_or_equal_to_1.isGreaterThanOrEqualTo)(floor, value);
});

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

declare type Fn1<R = any> = (a: unknown) => a is R;
export declare type CurriedFn1<R = any> = {
type Fn1<R = any> = (a: unknown) => a is R;
export type CurriedFn1<R = any> = {
(a: unknown): a is R;

@@ -4,0 +4,0 @@ };

import { CurriedFn1 } from './curry1';
declare type Fn2<R = any> = (b: unknown, a: unknown) => a is R;
export declare type CurriedFn2<R = any> = {
type Fn2<R = any> = (b: unknown, a: unknown) => a is R;
export type CurriedFn2<R = any> = {
(b: unknown, a: unknown): a is R;

@@ -5,0 +5,0 @@ (b: unknown): CurriedFn1<R>;

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

if (len >= 1)
return curry1_1.curry1(fn.bind(null, b));
return (0, curry1_1.curry1)(fn.bind(null, b));
};
}
exports.curry2 = curry2;
import { CurriedFn2 } from './curry2';
import { CurriedFn1 } from './curry1';
declare type Fn3<R = any> = (c: unknown, b: unknown, a: unknown) => a is R;
export declare type CurriedFn3<R = any> = {
type Fn3<R = any> = (c: unknown, b: unknown, a: unknown) => a is R;
export type CurriedFn3<R = any> = {
(c: unknown, b: unknown, a: unknown): a is R;

@@ -6,0 +6,0 @@ (c: unknown, b: unknown): CurriedFn1<R>;

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

if (len >= 2)
return curry1_1.curry1(fn.bind(null, c, b));
return (0, curry1_1.curry1)(fn.bind(null, c, b));
if (len >= 1)
return curry2_1.curry2(fn.bind(null, c));
return (0, curry2_1.curry2)(fn.bind(null, c));
};
}
exports.curry3 = curry3;

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

var curry2_1 = require("./curry2");
exports.every = curry2_1.curry2(function (fn, array) {
exports.every = (0, curry2_1.curry2)(function (fn, array) {
for (var i = 0, len = array.length; i < len; i++) {

@@ -8,0 +8,0 @@ if (fn(array[i]) === false) {

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

return function (value) {
return get_type_1.getType(value) === "[object " + type + "]";
return (0, get_type_1.getType)(value) === "[object ".concat(type, "]");
};
};
exports.hasType = hasType;

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

var curry2_1 = require("./curry2");
exports.includes = curry2_1.curry2(function (value, array) {
exports.includes = (0, curry2_1.curry2)(function (value, array) {
for (var i = 0, len = array.length; i < len; i++) {

@@ -8,0 +8,0 @@ if (array[i] === value) {

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

var isIndexedList = function (value) {
return is_string_1.isString(value) || is_array_1.isArray(value);
return (0, is_string_1.isString)(value) || (0, is_array_1.isArray)(value);
};
exports.isIndexedList = isIndexedList;

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

var curry2_1 = require("./curry2");
exports.some = curry2_1.curry2(function (fn, array) {
exports.some = (0, curry2_1.curry2)(function (fn, array) {
for (var i = 0, len = array.length; i < len; i++) {

@@ -8,0 +8,0 @@ if (fn(array[i]) === true) {

@@ -16,6 +16,6 @@ "use strict";

*/
exports.startsWith = curry2_1.curry2(function (otherString, value) {
return is_non_empty_string_1.isNonEmptyString(value) &&
is_non_empty_string_1.isNonEmptyString(otherString) &&
exports.startsWith = (0, curry2_1.curry2)(function (otherString, value) {
return (0, is_non_empty_string_1.isNonEmptyString)(value) &&
(0, is_non_empty_string_1.isNonEmptyString)(otherString) &&
value.slice(0, otherString.length) === otherString;
});

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

*/
exports.throwsErrorOfType = curry2_1.curry2(function (typeName, value) {
exports.throwsErrorOfType = (0, curry2_1.curry2)(function (typeName, value) {
try {

@@ -19,0 +19,0 @@ value();

@@ -1,5 +0,5 @@

export declare type AnyFn = (...args: any[]) => any;
export declare type Collection = any[] | Record<any, any>;
export declare type Reducer = (memo: any, value: any, key: number | string, collection: Collection) => any;
export declare type UnaryBoolFn = (value: any) => boolean;
export declare type VoidFn = () => void;
export type AnyFn = (...args: any[]) => any;
export type Collection = any[] | Record<any, any>;
export type Reducer = (memo: any, value: any, key: number | string, collection: Collection) => any;
export type UnaryBoolFn = (value: any) => boolean;
export type VoidFn = () => void;
{
"name": "expect-more",
"description": "Curried JavaScript Type Testing Library with Zero Dependencies",
"version": "1.2.0",
"version": "1.2.1",
"author": "Jamie Mason <jamie@foldleft.io> (https://github.com/JamieMason)",

@@ -20,3 +20,3 @@ "bugs": "https://github.com/JamieMason/expect-more/issues",

"typings": "./dist/index.d.ts",
"gitHead": "545dc7d868c7d9e8298681dc525b162fe02b8f08"
"gitHead": "ce89d4df67ac3e252b404636e571d6fa1b4dd0a1"
}
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