expect-more
Advanced tools
Comparing version 1.1.0 to 1.2.0
/** | ||
* Asserts that ${value} is a string whose trailing characters are equal to ${otherString}. | ||
* Asserts that value is a string whose trailing characters are equal to | ||
* those of the provided string. | ||
* @param otherString 'Script' | ||
@@ -4,0 +5,0 @@ * @param value 'JavaScript' |
@@ -7,3 +7,4 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a string whose trailing characters are equal to ${otherString}. | ||
* Asserts that value is a string whose trailing characters are equal to | ||
* those of the provided string. | ||
* @param otherString 'Script' | ||
@@ -10,0 +11,0 @@ * @param value 'JavaScript' |
/** | ||
* Asserts that ${value} has a property of the given name, even if the value of | ||
* that property is undefined. This assertion describes the shape of the given | ||
* Asserts that a value has a property of the given name, even if the value of | ||
* that property is `undefined`. This assertion describes the shape of the given | ||
* value. For example, value.prop is `undefined` in both of the following | ||
@@ -5,0 +5,0 @@ * scenarios, but `{ prop: undefined }` and `{ }` do not have the same shape. |
@@ -8,4 +8,4 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} has a property of the given name, even if the value of | ||
* that property is undefined. This assertion describes the shape of the given | ||
* Asserts that a value has a property of the given name, even if the value of | ||
* that property is `undefined`. This assertion describes the shape of the given | ||
* value. For example, value.prop is `undefined` in both of the following | ||
@@ -12,0 +12,0 @@ * scenarios, but `{ prop: undefined }` and `{ }` do not have the same shape. |
@@ -5,2 +5,5 @@ export { endsWith } from './ends-with'; | ||
export { isArray } from './is-array'; | ||
export { isArrayIncludingAllOf } from './is-array-including-all-of'; | ||
export { isArrayIncludingAnyOf } from './is-array-including-any-of'; | ||
export { isArrayIncludingOnly } from './is-array-including-only'; | ||
export { isArrayOfBooleans } from './is-array-of-booleans'; | ||
@@ -16,2 +19,9 @@ export { isArrayOfNumbers } from './is-array-of-numbers'; | ||
export { isDate } from './is-date'; | ||
export { isDateBetween } from './is-date-between'; | ||
export { isDateInMonth } from './is-date-in-month'; | ||
export { isDateInYear } from './is-date-in-year'; | ||
export { isDateOnDayOfMonth } from './is-date-on-day-of-month'; | ||
export { isDateOnDayOfWeek } from './is-date-on-day-of-week'; | ||
export { isDateOnOrAfter } from './is-date-on-or-after'; | ||
export { isDateOnOrBefore } from './is-date-on-or-before'; | ||
export { isDecimalNumber } from './is-decimal-number'; | ||
@@ -32,2 +42,4 @@ export { isDivisibleBy } from './is-divisible-by'; | ||
export { isNear } from './is-near'; | ||
export { isNegativeNumber } from './is-negative-number'; | ||
export { isNil } from './is-nil'; | ||
export { isNonEmptyArray } from './is-non-empty-array'; | ||
@@ -40,2 +52,3 @@ export { isNonEmptyObject } from './is-non-empty-object'; | ||
export { isOddNumber } from './is-odd-number'; | ||
export { isPositiveNumber } from './is-positive-number'; | ||
export { isRegExp } from './is-reg-exp'; | ||
@@ -42,0 +55,0 @@ export { isSameLengthAs } from './is-same-length-as'; |
@@ -10,4 +10,4 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.throwsAnyError = exports.startsWith = exports.isWithinRange = exports.isWholeNumber = exports.isWhitespace = exports.isWalkable = exports.isVisibleString = exports.isValidDate = exports.isUndefined = exports.isTrue = exports.isString = exports.isShorterThan = exports.isSameLengthAs = exports.isRegExp = exports.isOddNumber = exports.isObject = exports.isNumber = exports.isNull = exports.isNonEmptyString = exports.isNonEmptyObject = exports.isNonEmptyArray = exports.isNear = exports.isLongerThan = exports.isLessThanOrEqualTo = exports.isJsonString = exports.isIso8601 = exports.isGreaterThanOrEqualTo = exports.isGeneratorFunction = exports.isFunction = exports.isFalse = exports.isEvenNumber = exports.isEmptyString = exports.isEmptyObject = exports.isEmptyArray = exports.isDivisibleBy = exports.isDecimalNumber = exports.isDate = exports.isCalculable = exports.isBoolean = exports.isBefore = exports.isAsyncFunction = exports.isArrayOfStrings = exports.isArrayOfSize = exports.isArrayOfObjects = exports.isArrayOfNumbers = exports.isArrayOfBooleans = exports.isArray = exports.isAfter = exports.hasMember = exports.endsWith = void 0; | ||
exports.throwsErrorOfType = void 0; | ||
exports.isRegExp = exports.isPositiveNumber = exports.isOddNumber = exports.isObject = exports.isNumber = exports.isNull = exports.isNonEmptyString = exports.isNonEmptyObject = exports.isNonEmptyArray = exports.isNil = exports.isNegativeNumber = exports.isNear = exports.isLongerThan = exports.isLessThanOrEqualTo = exports.isJsonString = exports.isIso8601 = exports.isGreaterThanOrEqualTo = exports.isGeneratorFunction = exports.isFunction = exports.isFalse = exports.isEvenNumber = exports.isEmptyString = exports.isEmptyObject = exports.isEmptyArray = exports.isDivisibleBy = exports.isDecimalNumber = exports.isDateOnOrBefore = exports.isDateOnOrAfter = exports.isDateOnDayOfWeek = exports.isDateOnDayOfMonth = exports.isDateInYear = exports.isDateInMonth = exports.isDateBetween = exports.isDate = exports.isCalculable = exports.isBoolean = exports.isBefore = exports.isAsyncFunction = exports.isArrayOfStrings = exports.isArrayOfSize = exports.isArrayOfObjects = exports.isArrayOfNumbers = exports.isArrayOfBooleans = exports.isArrayIncludingOnly = exports.isArrayIncludingAnyOf = exports.isArrayIncludingAllOf = exports.isArray = exports.isAfter = exports.hasMember = exports.endsWith = void 0; | ||
exports.throwsErrorOfType = exports.throwsAnyError = exports.startsWith = exports.isWithinRange = exports.isWholeNumber = exports.isWhitespace = exports.isWalkable = exports.isVisibleString = exports.isValidDate = exports.isUndefined = exports.isTrue = exports.isString = exports.isShorterThan = exports.isSameLengthAs = void 0; | ||
var ends_with_1 = require("./ends-with"); | ||
@@ -21,2 +21,8 @@ __createBinding(exports, ends_with_1, "endsWith"); | ||
__createBinding(exports, is_array_1, "isArray"); | ||
var is_array_including_all_of_1 = require("./is-array-including-all-of"); | ||
__createBinding(exports, is_array_including_all_of_1, "isArrayIncludingAllOf"); | ||
var is_array_including_any_of_1 = require("./is-array-including-any-of"); | ||
__createBinding(exports, is_array_including_any_of_1, "isArrayIncludingAnyOf"); | ||
var is_array_including_only_1 = require("./is-array-including-only"); | ||
__createBinding(exports, is_array_including_only_1, "isArrayIncludingOnly"); | ||
var is_array_of_booleans_1 = require("./is-array-of-booleans"); | ||
@@ -42,2 +48,16 @@ __createBinding(exports, is_array_of_booleans_1, "isArrayOfBooleans"); | ||
__createBinding(exports, is_date_1, "isDate"); | ||
var is_date_between_1 = require("./is-date-between"); | ||
__createBinding(exports, is_date_between_1, "isDateBetween"); | ||
var is_date_in_month_1 = require("./is-date-in-month"); | ||
__createBinding(exports, is_date_in_month_1, "isDateInMonth"); | ||
var is_date_in_year_1 = require("./is-date-in-year"); | ||
__createBinding(exports, is_date_in_year_1, "isDateInYear"); | ||
var is_date_on_day_of_month_1 = require("./is-date-on-day-of-month"); | ||
__createBinding(exports, is_date_on_day_of_month_1, "isDateOnDayOfMonth"); | ||
var is_date_on_day_of_week_1 = require("./is-date-on-day-of-week"); | ||
__createBinding(exports, is_date_on_day_of_week_1, "isDateOnDayOfWeek"); | ||
var is_date_on_or_after_1 = require("./is-date-on-or-after"); | ||
__createBinding(exports, is_date_on_or_after_1, "isDateOnOrAfter"); | ||
var is_date_on_or_before_1 = require("./is-date-on-or-before"); | ||
__createBinding(exports, is_date_on_or_before_1, "isDateOnOrBefore"); | ||
var is_decimal_number_1 = require("./is-decimal-number"); | ||
@@ -73,2 +93,6 @@ __createBinding(exports, is_decimal_number_1, "isDecimalNumber"); | ||
__createBinding(exports, is_near_1, "isNear"); | ||
var is_negative_number_1 = require("./is-negative-number"); | ||
__createBinding(exports, is_negative_number_1, "isNegativeNumber"); | ||
var is_nil_1 = require("./is-nil"); | ||
__createBinding(exports, is_nil_1, "isNil"); | ||
var is_non_empty_array_1 = require("./is-non-empty-array"); | ||
@@ -88,2 +112,4 @@ __createBinding(exports, is_non_empty_array_1, "isNonEmptyArray"); | ||
__createBinding(exports, is_odd_number_1, "isOddNumber"); | ||
var is_positive_number_1 = require("./is-positive-number"); | ||
__createBinding(exports, is_positive_number_1, "isPositiveNumber"); | ||
var is_reg_exp_1 = require("./is-reg-exp"); | ||
@@ -90,0 +116,0 @@ __createBinding(exports, is_reg_exp_1, "isRegExp"); |
/** | ||
* Asserts that ${value} is a valid instance of `Date` whose value occurs after | ||
* that of ${otherDate}. | ||
* Asserts that a value is a valid instance of `Date` whose value occurs after | ||
* that of another. | ||
* @param otherDate new Date('2019-12-31') | ||
@@ -5,0 +5,0 @@ * @param value new Date('2020-01-01') |
@@ -7,4 +7,4 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid instance of `Date` whose value occurs after | ||
* that of ${otherDate}. | ||
* Asserts that a value is a valid instance of `Date` whose value occurs after | ||
* that of another. | ||
* @param otherDate new Date('2019-12-31') | ||
@@ -11,0 +11,0 @@ * @param value new Date('2020-01-01') |
/** | ||
* Asserts that ${value} is an `Array` containing only `Boolean` values. | ||
* Asserts that a value is an `Array` containing only `Boolean` values. | ||
* @param value [true, false, new Boolean(true)] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeArrayOfBooleans |
@@ -8,3 +8,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing only `Boolean` values. | ||
* Asserts that a value is an `Array` containing only `Boolean` values. | ||
* @param value [true, false, new Boolean(true)] | ||
@@ -11,0 +11,0 @@ * @matcherName toBeArrayOfBooleans |
/** | ||
* Asserts that ${value} is an `Array` containing only `Number` values. | ||
* Asserts that a value is an `Array` containing only `Number` values. | ||
* @param value [12, 0, 14] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeArrayOfNumbers |
@@ -8,3 +8,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing only `Number` values. | ||
* Asserts that a value is an `Array` containing only `Number` values. | ||
* @param value [12, 0, 14] | ||
@@ -11,0 +11,0 @@ * @matcherName toBeArrayOfNumbers |
/** | ||
* Asserts that ${value} is an `Array` containing only `Object` values. | ||
* Asserts that a value is an `Array` containing only `Object` values. | ||
* @param value [{}, new Object()] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeArrayOfObjects |
@@ -8,3 +8,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing only `Object` values. | ||
* Asserts that a value is an `Array` containing only `Object` values. | ||
* @param value [{}, new Object()] | ||
@@ -11,0 +11,0 @@ * @matcherName toBeArrayOfObjects |
/** | ||
* Asserts that ${value} is an `Array` containing ${size} number of values. | ||
* Asserts that a value is an `Array` containing a specific number of values. | ||
* @param size 4 | ||
@@ -4,0 +4,0 @@ * @param value ['i', 'contain', 4, 'items'] |
@@ -8,3 +8,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing ${size} number of values. | ||
* Asserts that a value is an `Array` containing a specific number of values. | ||
* @param size 4 | ||
@@ -11,0 +11,0 @@ * @param value ['i', 'contain', 4, 'items'] |
/** | ||
* Asserts that ${value} is an `Array` containing only `String` values. | ||
* Asserts that a value is an `Array` containing only `String` values. | ||
* @param value ['we', 'are', 'all', 'strings'] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeArrayOfStrings |
@@ -8,3 +8,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing only `String` values. | ||
* Asserts that a value is an `Array` containing only `String` values. | ||
* @param value ['we', 'are', 'all', 'strings'] | ||
@@ -11,0 +11,0 @@ * @matcherName toBeArrayOfStrings |
/** | ||
* Asserts that ${value} is a valid `Array` containing none or any number of | ||
* Asserts that a value is a valid `Array` containing none or any number of | ||
* items of any type. | ||
@@ -4,0 +4,0 @@ * @param value [2, true, 'string'] |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `Array` containing none or any number of | ||
* Asserts that a value is a valid `Array` containing none or any number of | ||
* items of any type. | ||
@@ -9,0 +9,0 @@ * @param value [2, true, 'string'] |
/** | ||
* Asserts that ${value} is a function using async/await syntax. | ||
* Asserts that a value is a function using `async` and `await` syntax. | ||
* @param value async () => { await fetch('...') } | ||
@@ -4,0 +4,0 @@ * @matcherName toBeAsyncFunction |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a function using async/await syntax. | ||
* Asserts that a value is a function using `async` and `await` syntax. | ||
* @param value async () => { await fetch('...') } | ||
@@ -9,0 +9,0 @@ * @matcherName toBeAsyncFunction |
/** | ||
* Asserts that ${value} is a valid instance of `Date` whose value occurs before | ||
* that of ${otherDate}. | ||
* @param otherDate new Date('2020-01-01') | ||
* Asserts that a value is a valid instance of `Date` whose value occurs before | ||
* that of another. | ||
* @param other new Date('2020-01-01') | ||
* @param value new Date('2019-12-31') | ||
@@ -9,6 +9,6 @@ * @matcherName toBeBefore | ||
* @matcherMessage expected ${value} to be an instance of Date, occurring before | ||
* ${otherDate} | ||
* ${other} | ||
* @matcherNotMessage expected ${value} not to be an instance of Date, occurring | ||
* before ${otherDate} | ||
* before ${other} | ||
*/ | ||
export declare const isBefore: import("./lib/curry2").CurriedFn2<Date>; |
@@ -7,5 +7,5 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid instance of `Date` whose value occurs before | ||
* that of ${otherDate}. | ||
* @param otherDate new Date('2020-01-01') | ||
* Asserts that a value is a valid instance of `Date` whose value occurs before | ||
* that of another. | ||
* @param other new Date('2020-01-01') | ||
* @param value new Date('2019-12-31') | ||
@@ -15,8 +15,8 @@ * @matcherName toBeBefore | ||
* @matcherMessage expected ${value} to be an instance of Date, occurring before | ||
* ${otherDate} | ||
* ${other} | ||
* @matcherNotMessage expected ${value} not to be an instance of Date, occurring | ||
* before ${otherDate} | ||
* before ${other} | ||
*/ | ||
exports.isBefore = curry2_1.curry2(function (otherDate, value) { | ||
return is_after_1.isAfter(value, otherDate); | ||
exports.isBefore = curry2_1.curry2(function (other, value) { | ||
return is_after_1.isAfter(value, other); | ||
}); |
/** | ||
* Asserts that ${value} is `true`, `false`, `new Boolean(true)`, or `new | ||
* Asserts that a value is `true`, `false`, `new Boolean(true)`, or `new | ||
* Boolean(false)`. | ||
@@ -4,0 +4,0 @@ * @param value false |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is `true`, `false`, `new Boolean(true)`, or `new | ||
* Asserts that a value is `true`, `false`, `new Boolean(true)`, or `new | ||
* Boolean(false)`. | ||
@@ -9,0 +9,0 @@ * @param value false |
/** | ||
* Asserts that ${value} is an instance of `Date`. | ||
* Asserts that a value is an instance of `Date`. | ||
* @param value new Date('2019-12-31') | ||
@@ -4,0 +4,0 @@ * @matcherName toBeDate |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an instance of `Date`. | ||
* Asserts that a value is an instance of `Date`. | ||
* @param value new Date('2019-12-31') | ||
@@ -9,0 +9,0 @@ * @matcherName toBeDate |
/** | ||
* Asserts that ${value} is a `Number` with positive decimal places. | ||
* Asserts that a value is a `Number` with positive decimal places. | ||
* @param value 12.55 | ||
@@ -4,0 +4,0 @@ * @matcherName toBeDecimalNumber |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Number` with positive decimal places. | ||
* Asserts that a value is a `Number` with positive decimal places. | ||
* @param value 12.55 | ||
@@ -9,0 +9,0 @@ * @matcherName toBeDecimalNumber |
/** | ||
* Asserts that ${value} is a `Number` which results in a whole number when | ||
* divided by ${otherNumber}. | ||
* @param otherNumber 2 | ||
* Asserts that a value is a `Number` which results in a whole number when | ||
* divided by another. | ||
* @param other 2 | ||
* @param value 12 | ||
* @matcherName toBeDivisibleBy | ||
* @memberMatcherName toHaveDivisibleBy | ||
* @matcherMessage expected ${value} to be divisible by ${otherNumber} | ||
* @matcherNotMessage expected ${value} not to be divisible by ${otherNumber} | ||
* @matcherMessage expected ${value} to be divisible by ${other} | ||
* @matcherNotMessage expected ${value} not to be divisible by ${other} | ||
*/ | ||
export declare const isDivisibleBy: import("./lib/curry2").CurriedFn2<number>; |
@@ -7,13 +7,13 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Number` which results in a whole number when | ||
* divided by ${otherNumber}. | ||
* @param otherNumber 2 | ||
* Asserts that a value is a `Number` which results in a whole number when | ||
* divided by another. | ||
* @param other 2 | ||
* @param value 12 | ||
* @matcherName toBeDivisibleBy | ||
* @memberMatcherName toHaveDivisibleBy | ||
* @matcherMessage expected ${value} to be divisible by ${otherNumber} | ||
* @matcherNotMessage expected ${value} not to be divisible by ${otherNumber} | ||
* @matcherMessage expected ${value} to be divisible by ${other} | ||
* @matcherNotMessage expected ${value} not to be divisible by ${other} | ||
*/ | ||
exports.isDivisibleBy = curry2_1.curry2(function (otherNumber, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(otherNumber) && value % otherNumber === 0; | ||
exports.isDivisibleBy = curry2_1.curry2(function (other, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value % other === 0; | ||
}); |
/** | ||
* Asserts that ${value} is a valid `Array` containing no items. | ||
* Asserts that a value is a valid `Array` containing no items. | ||
* @param value [] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeEmptyArray |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `Array` containing no items. | ||
* Asserts that a value is a valid `Array` containing no items. | ||
* @param value [] | ||
@@ -9,0 +9,0 @@ * @matcherName toBeEmptyArray |
/** | ||
* Asserts that ${value} is a valid `Object` containing no instance members. | ||
* Asserts that a value is a valid `Object` containing no instance members. | ||
* @param value {} {} | ||
@@ -4,0 +4,0 @@ * @matcherName toBeEmptyObject |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `Object` containing no instance members. | ||
* Asserts that a value is a valid `Object` containing no instance members. | ||
* @param value {} {} | ||
@@ -10,0 +10,0 @@ * @matcherName toBeEmptyObject |
/** | ||
* Asserts that ${value} is a valid `String` containing no characters. | ||
* Asserts that a value is a valid `String` containing no characters. | ||
* @param value '' | ||
@@ -4,0 +4,0 @@ * @matcherName toBeEmptyString |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `String` containing no characters. | ||
* Asserts that a value is a valid `String` containing no characters. | ||
* @param value '' | ||
@@ -9,0 +9,0 @@ * @matcherName toBeEmptyString |
/** | ||
* Asserts that ${value} is an even `Number`. | ||
* Asserts that a value is an even `Number`. | ||
* @param value 2 | ||
@@ -4,0 +4,0 @@ * @matcherName toBeEvenNumber |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an even `Number`. | ||
* Asserts that a value is an even `Number`. | ||
* @param value 2 | ||
@@ -10,0 +10,0 @@ * @matcherName toBeEvenNumber |
/** | ||
* Asserts that ${value} is `false` or `new Boolean(false)`. | ||
* Asserts that a value is `false` or `new Boolean(false)`. | ||
* @param value false | ||
@@ -4,0 +4,0 @@ * @matcherName toBeFalse |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is `false` or `new Boolean(false)`. | ||
* Asserts that a value is `false` or `new Boolean(false)`. | ||
* @param value false | ||
@@ -9,0 +9,0 @@ * @matcherName toBeFalse |
import { AnyFn } from './typings'; | ||
/** | ||
* Asserts that ${value} is a `Function`. | ||
* Asserts that a value is a `Function`. | ||
* @param value () => 'i am a function' | ||
@@ -5,0 +5,0 @@ * @matcherName toBeFunction |
@@ -5,3 +5,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Function`. | ||
* Asserts that a value is a `Function`. | ||
* @param value () => 'i am a function' | ||
@@ -8,0 +8,0 @@ * @matcherName toBeFunction |
/** | ||
* Asserts that ${value} is a `Function` using yield syntax. | ||
* Asserts that a value is a `Function` using `yield` syntax. | ||
* @param value function* gen() { yield 'i am a generator' } | ||
@@ -4,0 +4,0 @@ * @matcherName toBeGeneratorFunction |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Function` using yield syntax. | ||
* Asserts that a value is a `Function` using `yield` syntax. | ||
* @param value function* gen() { yield 'i am a generator' } | ||
@@ -9,0 +9,0 @@ * @matcherName toBeGeneratorFunction |
/** | ||
* Asserts that ${value} is greater than or equal to ${otherNumber}. | ||
* @param otherNumber 5 | ||
* Asserts that a value is greater than or equal to ${other}. | ||
* @param other 5 | ||
* @param value 10 | ||
* @matcherName toBeGreaterThanOrEqualTo | ||
* @memberMatcherName toHaveGreaterThanOrEqualTo | ||
* @matcherMessage expected ${value} to be greater than or equal to | ||
* ${otherNumber} | ||
* @matcherMessage expected ${value} to be greater than or equal to ${other} | ||
* @matcherNotMessage expected ${value} not to be greater than or equal to | ||
* ${otherNumber} | ||
* ${other} | ||
*/ | ||
export declare const isGreaterThanOrEqualTo: import("./lib/curry2").CurriedFn2<number>; |
@@ -7,14 +7,13 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is greater than or equal to ${otherNumber}. | ||
* @param otherNumber 5 | ||
* Asserts that a value is greater than or equal to ${other}. | ||
* @param other 5 | ||
* @param value 10 | ||
* @matcherName toBeGreaterThanOrEqualTo | ||
* @memberMatcherName toHaveGreaterThanOrEqualTo | ||
* @matcherMessage expected ${value} to be greater than or equal to | ||
* ${otherNumber} | ||
* @matcherMessage expected ${value} to be greater than or equal to ${other} | ||
* @matcherNotMessage expected ${value} not to be greater than or equal to | ||
* ${otherNumber} | ||
* ${other} | ||
*/ | ||
exports.isGreaterThanOrEqualTo = curry2_1.curry2(function (otherNumber, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(otherNumber) && value >= otherNumber; | ||
exports.isGreaterThanOrEqualTo = curry2_1.curry2(function (other, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value >= other; | ||
}); |
/** | ||
* Asserts that ${value} is a String which conforms to common use-cases of the | ||
* Asserts that a value is a String which conforms to common use-cases of the | ||
* ISO 8601 standard representation of dates and times. | ||
@@ -4,0 +4,0 @@ * @param value '1999-12-31T23:59:59' |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a String which conforms to common use-cases of the | ||
* Asserts that a value is a String which conforms to common use-cases of the | ||
* ISO 8601 standard representation of dates and times. | ||
@@ -10,0 +10,0 @@ * @param value '1999-12-31T23:59:59' |
/** | ||
* Asserts that ${value} is a `String` of valid JSON. | ||
* Asserts that a value is a `String` of valid JSON. | ||
* @param value '{"i":"am valid JSON"}' | ||
@@ -4,0 +4,0 @@ * @matcherName toBeJsonString |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` of valid JSON. | ||
* Asserts that a value is a `String` of valid JSON. | ||
* @param value '{"i":"am valid JSON"}' | ||
@@ -9,0 +9,0 @@ * @matcherName toBeJsonString |
/** | ||
* Asserts that ${value} is less than or equal to ${otherNumber}. | ||
* @param otherNumber 12 | ||
* Asserts that a value is less than or equal to another. | ||
* @param other 12 | ||
* @param value 8 | ||
* @matcherName toBeLessThanOrEqualTo | ||
* @memberMatcherName toHaveLessThanOrEqualTo | ||
* @matcherMessage expected ${value} to be less than or equal to ${otherNumber} | ||
* @matcherNotMessage expected ${value} not to be less than or equal to | ||
* ${otherNumber} | ||
* @matcherMessage expected ${value} to be less than or equal to ${other} | ||
* @matcherNotMessage expected ${value} not to be less than or equal to ${other} | ||
*/ | ||
export declare const isLessThanOrEqualTo: import("./lib/curry2").CurriedFn2<number>; |
@@ -7,13 +7,12 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is less than or equal to ${otherNumber}. | ||
* @param otherNumber 12 | ||
* Asserts that a value is less than or equal to another. | ||
* @param other 12 | ||
* @param value 8 | ||
* @matcherName toBeLessThanOrEqualTo | ||
* @memberMatcherName toHaveLessThanOrEqualTo | ||
* @matcherMessage expected ${value} to be less than or equal to ${otherNumber} | ||
* @matcherNotMessage expected ${value} not to be less than or equal to | ||
* ${otherNumber} | ||
* @matcherMessage expected ${value} to be less than or equal to ${other} | ||
* @matcherNotMessage expected ${value} not to be less than or equal to ${other} | ||
*/ | ||
exports.isLessThanOrEqualTo = curry2_1.curry2(function (otherNumber, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(otherNumber) && value <= otherNumber; | ||
exports.isLessThanOrEqualTo = curry2_1.curry2(function (other, value) { | ||
return is_number_1.isNumber(value) && is_number_1.isNumber(other) && value <= other; | ||
}); |
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is greater than | ||
* that of ${otherStringOrArray}. | ||
* @param otherStringOrArray [2, 'items'] | ||
* Asserts that a value is a `String` or `Array` whose length is greater than | ||
* that of another. | ||
* @param other [2, 'items'] | ||
* @param value ['i', 'have', 3] | ||
@@ -9,6 +9,6 @@ * @matcherName toBeLongerThan | ||
* @matcherMessage expected ${value} to be a string or array whose length is | ||
* greater than that of ${otherStringOrArray} | ||
* greater than that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is greater than that of ${otherStringOrArray} | ||
* is greater than that of ${other} | ||
*/ | ||
export declare const isLongerThan: import("./lib/curry2").CurriedFn2<string | any[]>; |
@@ -7,5 +7,5 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is greater than | ||
* that of ${otherStringOrArray}. | ||
* @param otherStringOrArray [2, 'items'] | ||
* Asserts that a value is a `String` or `Array` whose length is greater than | ||
* that of another. | ||
* @param other [2, 'items'] | ||
* @param value ['i', 'have', 3] | ||
@@ -15,10 +15,8 @@ * @matcherName toBeLongerThan | ||
* @matcherMessage expected ${value} to be a string or array whose length is | ||
* greater than that of ${otherStringOrArray} | ||
* greater than that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is greater than that of ${otherStringOrArray} | ||
* is greater than that of ${other} | ||
*/ | ||
exports.isLongerThan = curry2_1.curry2(function (otherStringOrArray, value) { | ||
return is_indexed_list_1.isIndexedList(value) && | ||
is_indexed_list_1.isIndexedList(otherStringOrArray) && | ||
value.length > otherStringOrArray.length; | ||
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; | ||
}); |
/** | ||
* Asserts that ${value} is a number within the given acceptable distance from | ||
* ${otherNumber}. | ||
* Asserts that a value is a number within the given acceptable distance from | ||
* another. | ||
* @param otherNumber 5 | ||
@@ -5,0 +5,0 @@ * @param epsilon 0.5 |
@@ -7,4 +7,4 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a number within the given acceptable distance from | ||
* ${otherNumber}. | ||
* Asserts that a value is a number within the given acceptable distance from | ||
* another. | ||
* @param otherNumber 5 | ||
@@ -11,0 +11,0 @@ * @param epsilon 0.5 |
/** | ||
* Asserts that ${value} is an `Array` containing at least one value. | ||
* Asserts that a value is an `Array` containing at least one value. | ||
* @param value ['i', 'am not empty'] | ||
@@ -4,0 +4,0 @@ * @matcherName toBeNonEmptyArray |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Array` containing at least one value. | ||
* Asserts that a value is an `Array` containing at least one value. | ||
* @param value ['i', 'am not empty'] | ||
@@ -9,0 +9,0 @@ * @matcherName toBeNonEmptyArray |
/** | ||
* Asserts that ${value} is an `Object` containing at least one own member. | ||
* Asserts that a value is an `Object` containing at least one own member. | ||
* @param value {} { i: 'am not empty' } | ||
@@ -4,0 +4,0 @@ * @matcherName toBeNonEmptyObject |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Object` containing at least one own member. | ||
* Asserts that a value is an `Object` containing at least one own member. | ||
* @param value {} { i: 'am not empty' } | ||
@@ -10,0 +10,0 @@ * @matcherName toBeNonEmptyObject |
/** | ||
* Asserts that ${value} is a valid `String` containing at least one character. | ||
* Asserts that a value is a valid `String` containing at least one character. | ||
* @param value 'i am not empty' | ||
@@ -4,0 +4,0 @@ * @matcherName toBeNonEmptyString |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `String` containing at least one character. | ||
* Asserts that a value is a valid `String` containing at least one character. | ||
* @param value 'i am not empty' | ||
@@ -9,0 +9,0 @@ * @matcherName toBeNonEmptyString |
/** | ||
* Asserts that ${value} is null | ||
* Asserts that a value is `null`. | ||
* @param value null | ||
* @matcherName toBeNull | ||
* @memberMatcherName toHaveNull | ||
* @matcherMessage expected ${value} to be is null | ||
* @matcherNotMessage expected ${value} not to be is null | ||
* @matcherMessage expected ${value} to be null | ||
* @matcherNotMessage expected ${value} not to be null | ||
*/ | ||
export declare const isNull: <CallTimeType = null>(value: unknown) => value is CallTimeType; |
@@ -6,9 +6,9 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is null | ||
* Asserts that a value is `null`. | ||
* @param value null | ||
* @matcherName toBeNull | ||
* @memberMatcherName toHaveNull | ||
* @matcherMessage expected ${value} to be is null | ||
* @matcherNotMessage expected ${value} not to be is null | ||
* @matcherMessage expected ${value} to be null | ||
* @matcherNotMessage expected ${value} not to be null | ||
*/ | ||
exports.isNull = has_type_1.hasType('Null'); |
/** | ||
* Asserts that ${value} is a valid `Number` or `new Number()` and not `NaN`. | ||
* Asserts that a value is a valid `Number` or `new Number()` and not `NaN`. | ||
* @param value 8 | ||
@@ -4,0 +4,0 @@ * @matcherName toBeNumber |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `Number` or `new Number()` and not `NaN`. | ||
* Asserts that a value is a valid `Number` or `new Number()` and not `NaN`. | ||
* @param value 8 | ||
@@ -9,0 +9,0 @@ * @matcherName toBeNumber |
/** | ||
* Asserts that ${value} is an `Object`. | ||
* Asserts that a value is an `Object`. | ||
* @param value {} {} | ||
@@ -4,0 +4,0 @@ * @matcherName toBeObject |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an `Object`. | ||
* Asserts that a value is an `Object`. | ||
* @param value {} {} | ||
@@ -9,0 +9,0 @@ * @matcherName toBeObject |
/** | ||
* Asserts that ${value} is an odd `Number`. | ||
* Asserts that a value is an odd `Number`. | ||
* @param value 5 | ||
@@ -4,0 +4,0 @@ * @matcherName toBeOddNumber |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an odd `Number`. | ||
* Asserts that a value is an odd `Number`. | ||
* @param value 5 | ||
@@ -10,0 +10,0 @@ * @matcherName toBeOddNumber |
/** | ||
* Asserts that ${value} is a `RegExp`. | ||
* Asserts that a value is a `RegExp`. | ||
* @param value new RegExp('i am a regular expression') | ||
@@ -4,0 +4,0 @@ * @matcherName toBeRegExp |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `RegExp`. | ||
* Asserts that a value is a `RegExp`. | ||
* @param value new RegExp('i am a regular expression') | ||
@@ -9,0 +9,0 @@ * @matcherName toBeRegExp |
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is the same as | ||
* that of ${otherStringOrArray}. | ||
* @param otherStringOrArray ['i have', '2 items'] | ||
* Asserts that a value is a `String` or `Array` whose length is the same as | ||
* that of the other provided. | ||
* @param other ['i have', '2 items'] | ||
* @param value ['i also have', '2 items'] | ||
@@ -9,6 +9,6 @@ * @matcherName toBeSameLengthAs | ||
* @matcherMessage expected ${value} to be a string or array whose length is the | ||
* same as that of ${otherStringOrArray} | ||
* same as that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is the same as that of ${otherStringOrArray} | ||
* is the same as that of ${other} | ||
*/ | ||
export declare const isSameLengthAs: import("./lib/curry2").CurriedFn2<string | any[]>; |
@@ -7,5 +7,5 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is the same as | ||
* that of ${otherStringOrArray}. | ||
* @param otherStringOrArray ['i have', '2 items'] | ||
* Asserts that a value is a `String` or `Array` whose length is the same as | ||
* that of the other provided. | ||
* @param other ['i have', '2 items'] | ||
* @param value ['i also have', '2 items'] | ||
@@ -15,10 +15,8 @@ * @matcherName toBeSameLengthAs | ||
* @matcherMessage expected ${value} to be a string or array whose length is the | ||
* same as that of ${otherStringOrArray} | ||
* same as that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is the same as that of ${otherStringOrArray} | ||
* is the same as that of ${other} | ||
*/ | ||
exports.isSameLengthAs = curry2_1.curry2(function (otherStringOrArray, value) { | ||
return is_indexed_list_1.isIndexedList(value) && | ||
is_indexed_list_1.isIndexedList(otherStringOrArray) && | ||
value.length === otherStringOrArray.length; | ||
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; | ||
}); |
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is less than that | ||
* of ${otherStringOrArray}. | ||
* @param otherStringOrArray ['i', 'have', 4, 'items'] | ||
* Asserts that a value is a `String` or `Array` whose length is less than that | ||
* of the other provided. | ||
* @param other ['i', 'have', 4, 'items'] | ||
* @param value ['i have one item'] | ||
@@ -9,6 +9,6 @@ * @matcherName toBeShorterThan | ||
* @matcherMessage expected ${value} to be a string or array whose length is | ||
* less than that of ${otherStringOrArray} | ||
* less than that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is less than that of ${otherStringOrArray} | ||
* is less than that of ${other} | ||
*/ | ||
export declare const isShorterThan: import("./lib/curry2").CurriedFn2<string | any[]>; |
@@ -7,5 +7,5 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` or `Array` whose length is less than that | ||
* of ${otherStringOrArray}. | ||
* @param otherStringOrArray ['i', 'have', 4, 'items'] | ||
* Asserts that a value is a `String` or `Array` whose length is less than that | ||
* of the other provided. | ||
* @param other ['i', 'have', 4, 'items'] | ||
* @param value ['i have one item'] | ||
@@ -15,10 +15,8 @@ * @matcherName toBeShorterThan | ||
* @matcherMessage expected ${value} to be a string or array whose length is | ||
* less than that of ${otherStringOrArray} | ||
* less than that of ${other} | ||
* @matcherNotMessage expected ${value} not to be a string or array whose length | ||
* is less than that of ${otherStringOrArray} | ||
* is less than that of ${other} | ||
*/ | ||
exports.isShorterThan = curry2_1.curry2(function (otherStringOrArray, value) { | ||
return is_indexed_list_1.isIndexedList(value) && | ||
is_indexed_list_1.isIndexedList(otherStringOrArray) && | ||
value.length < otherStringOrArray.length; | ||
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; | ||
}); |
/** | ||
* Asserts that ${value} is a `String` or `new String()`. | ||
* Asserts that a value is a `String` or `new String()`. | ||
* @param value 'i am a string' | ||
@@ -4,0 +4,0 @@ * @matcherName toBeString |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` or `new String()`. | ||
* Asserts that a value is a `String` or `new String()`. | ||
* @param value 'i am a string' | ||
@@ -9,0 +9,0 @@ * @matcherName toBeString |
/** | ||
* Asserts that ${value} is `true` or `new Boolean(true)`. | ||
* Asserts that a value is `true` or `new Boolean(true)`. | ||
* @param value true | ||
@@ -4,0 +4,0 @@ * @matcherName toBeTrue |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is `true` or `new Boolean(true)`. | ||
* Asserts that a value is `true` or `new Boolean(true)`. | ||
* @param value true | ||
@@ -9,0 +9,0 @@ * @matcherName toBeTrue |
/** | ||
* Asserts that ${value} is undefined | ||
* Asserts that a value is `undefined` | ||
* @param value undefined | ||
@@ -4,0 +4,0 @@ * @matcherName toBeUndefined |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is undefined | ||
* Asserts that a value is `undefined` | ||
* @param value undefined | ||
@@ -9,0 +9,0 @@ * @matcherName toBeUndefined |
/** | ||
* Asserts that ${value} is an instance of `Date` whose internal value is valid. | ||
* Asserts that a value is an instance of `Date` whose internal value is valid. | ||
* `Date` is little like `Promise` in that it is a container for a value. For | ||
@@ -4,0 +4,0 @@ * example, `new Date('wut?')` is a valid `Date` which wraps a value that is not |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is an instance of `Date` whose internal value is valid. | ||
* Asserts that a value is an instance of `Date` whose internal value is valid. | ||
* `Date` is little like `Promise` in that it is a container for a value. For | ||
@@ -9,0 +9,0 @@ * example, `new Date('wut?')` is a valid `Date` which wraps a value that is not |
/** | ||
* Asserts that ${value} is a valid `String` containing at least one character | ||
* Asserts that a value is a valid `String` containing at least one character | ||
* which is not whitespace. | ||
@@ -4,0 +4,0 @@ * @param value 'i am visible' |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a valid `String` containing at least one character | ||
* Asserts that a value is a valid `String` containing at least one character | ||
* which is not whitespace. | ||
@@ -9,0 +9,0 @@ * @param value 'i am visible' |
/** | ||
* Asserts that ${value} is safe to attempt to read property values from. | ||
* Asserts that a value is safe to attempt to read property values from. | ||
* @param value {} {} | ||
@@ -4,0 +4,0 @@ * @matcherName toBeWalkable |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is safe to attempt to read property values from. | ||
* Asserts that a value is safe to attempt to read property values from. | ||
* @param value {} {} | ||
@@ -10,0 +10,0 @@ * @matcherName toBeWalkable |
/** | ||
* Asserts that ${value} is a `String` containing only whitespace characters. | ||
* Asserts that a value is a `String` containing only whitespace characters. | ||
* @param value ' ' | ||
@@ -4,0 +4,0 @@ * @matcherName toBeWhitespace |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `String` containing only whitespace characters. | ||
* Asserts that a value is a `String` containing only whitespace characters. | ||
* @param value ' ' | ||
@@ -9,0 +9,0 @@ * @matcherName toBeWhitespace |
/** | ||
* Asserts that ${value} is a `Number` with no positive decimal places. | ||
* Asserts that a value is a `Number` with no positive decimal places. | ||
* @param value 8 | ||
@@ -4,0 +4,0 @@ * @matcherName toBeWholeNumber |
@@ -7,3 +7,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Number` with no positive decimal places. | ||
* Asserts that a value is a `Number` with no positive decimal places. | ||
* @param value 8 | ||
@@ -10,0 +10,0 @@ * @matcherName toBeWholeNumber |
/** | ||
* Asserts that ${value} is a `Number` which is both greater than or equal to | ||
* ${floor} and less than or equal to ${ceiling}. | ||
* Asserts that a value is a `Number` which is both greater than or equal to | ||
* `floor` and less than or equal to `ceiling`. | ||
* @param floor 0 | ||
@@ -5,0 +5,0 @@ * @param ceiling 10 |
@@ -8,4 +8,4 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Number` which is both greater than or equal to | ||
* ${floor} and less than or equal to ${ceiling}. | ||
* Asserts that a value is a `Number` which is both greater than or equal to | ||
* `floor` and less than or equal to `ceiling`. | ||
* @param floor 0 | ||
@@ -12,0 +12,0 @@ * @param ceiling 10 |
@@ -6,8 +6,6 @@ "use strict"; | ||
return function curriedFn1(a) { | ||
switch (arguments.length) { | ||
case 1: | ||
return fn(a); | ||
} | ||
if (arguments.length >= 1) | ||
return fn(a); | ||
}; | ||
} | ||
exports.curry1 = curry1; |
@@ -7,10 +7,9 @@ "use strict"; | ||
return function curriedFn2(b, a) { | ||
switch (arguments.length) { | ||
case 2: | ||
return fn(b, a); | ||
case 1: | ||
return curry1_1.curry1(fn.bind(null, b)); | ||
} | ||
var len = arguments.length; | ||
if (len >= 2) | ||
return fn(b, a); | ||
if (len >= 1) | ||
return curry1_1.curry1(fn.bind(null, b)); | ||
}; | ||
} | ||
exports.curry2 = curry2; |
@@ -8,12 +8,11 @@ "use strict"; | ||
return function curriedFn3(c, b, a) { | ||
switch (arguments.length) { | ||
case 3: | ||
return fn(c, b, a); | ||
case 2: | ||
return curry1_1.curry1(fn.bind(null, c, b)); | ||
case 1: | ||
return curry2_1.curry2(fn.bind(null, c)); | ||
} | ||
var len = arguments.length; | ||
if (len >= 3) | ||
return fn(c, b, a); | ||
if (len >= 2) | ||
return curry1_1.curry1(fn.bind(null, c, b)); | ||
if (len >= 1) | ||
return curry2_1.curry2(fn.bind(null, c)); | ||
}; | ||
} | ||
exports.curry3 = curry3; |
/** | ||
* Assert value is a string whose leading characters are equal to `other`. | ||
* Asserts that value is a string whose trailing characters are equal to | ||
* those of the provided string. | ||
* @param otherString 'Java' | ||
@@ -4,0 +5,0 @@ * @param value 'JavaScript' |
@@ -7,3 +7,4 @@ "use strict"; | ||
/** | ||
* Assert value is a string whose leading characters are equal to `other`. | ||
* Asserts that value is a string whose trailing characters are equal to | ||
* those of the provided string. | ||
* @param otherString 'Java' | ||
@@ -10,0 +11,0 @@ * @param value 'JavaScript' |
import type { AnyFn } from './typings'; | ||
/** | ||
* Asserts that ${value} is a `Function` which throws when invoked. | ||
* Asserts that a value is a `Function` which throws when invoked. | ||
* @param value () => { throw new Error("it wasn't me!") } | ||
@@ -5,0 +5,0 @@ * @matcherName toThrowAnyError |
@@ -5,3 +5,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Function` which throws when invoked. | ||
* Asserts that a value is a `Function` which throws when invoked. | ||
* @param value () => { throw new Error("it wasn't me!") } | ||
@@ -8,0 +8,0 @@ * @matcherName toThrowAnyError |
import { AnyFn } from './typings'; | ||
/** | ||
* Asserts that ${value} is a `Function` which throws an `Error` of the given | ||
* Asserts that a value is a `Function` which throws an `Error` of the given | ||
* type. | ||
@@ -5,0 +5,0 @@ * @param typeName 'TypeError' |
@@ -6,3 +6,3 @@ "use strict"; | ||
/** | ||
* Asserts that ${value} is a `Function` which throws an `Error` of the given | ||
* Asserts that a value is a `Function` which throws an `Error` of the given | ||
* type. | ||
@@ -9,0 +9,0 @@ * @param typeName 'TypeError' |
{ | ||
"name": "expect-more", | ||
"description": "Curried JavaScript Type Testing Library with Zero Dependencies", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"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": "6063eea3c43c5596f7d89f6f1ca18f879d55ce99" | ||
"gitHead": "545dc7d868c7d9e8298681dc525b162fe02b8f08" | ||
} |
127
README.md
@@ -42,8 +42,8 @@ # expect-more | ||
```ts | ||
export declare const isBoolean: (value: unknown) => value is boolean; | ||
export declare const isFalse: (value: unknown) => value is false; | ||
export declare const isNull: (value: unknown) => value is null; | ||
export declare const isRegExp: (value: unknown) => value is RegExp; | ||
export declare const isTrue: (value: unknown) => value is true; | ||
export declare const isUndefined: (value: unknown) => value is undefined; | ||
declare const isBoolean: (value: unknown) => value is boolean; | ||
declare const isFalse: (value: unknown) => value is false; | ||
declare const isNull: (value: unknown) => value is null; | ||
declare const isRegExp: (value: unknown) => value is RegExp; | ||
declare const isTrue: (value: unknown) => value is true; | ||
declare const isUndefined: (value: unknown) => value is undefined; | ||
``` | ||
@@ -54,9 +54,9 @@ | ||
```ts | ||
export declare const isAsyncFunction: <T = (...args: any[]) => Promise<any>>( | ||
declare const isAsyncFunction: <T = (...args: any[]) => Promise<any>>( | ||
value: unknown, | ||
) => value is T; | ||
export declare const isFunction: <T = (...args: any[]) => any>(value: unknown) => value is T; | ||
export declare const isGeneratorFunction: <T = Generator>(value: unknown) => value is T; | ||
export declare const throwsAnyError: <T = (...args: any[]) => any>(value: unknown) => value is T; | ||
export declare const throwsErrorOfType: <T = (...args: any[]) => any>( | ||
declare const isFunction: <T = (...args: any[]) => any>(value: unknown) => value is T; | ||
declare const isGeneratorFunction: <T = Generator>(value: unknown) => value is T; | ||
declare const throwsAnyError: <T = (...args: any[]) => any>(value: unknown) => value is T; | ||
declare const throwsErrorOfType: <T = (...args: any[]) => any>( | ||
typeName: string, | ||
@@ -70,7 +70,8 @@ value: unknown, | ||
```ts | ||
export declare const hasMember: <T = any>(memberName: string, value: unknown) => value is T; | ||
export declare const isEmptyObject: <T = any>(value: unknown) => value is T; | ||
export declare const isNonEmptyObject: <T = any>(value: unknown) => value is T; | ||
export declare const isObject: <T = any>(value: unknown) => value is T; | ||
export declare const isWalkable: <T = any>(value: unknown) => value is T; | ||
declare const hasMember: <T = any>(memberName: string, value: unknown) => value is T; | ||
declare const isEmptyObject: <T = any>(value: unknown) => value is T; | ||
declare const isNil: (value: unknown) => value is undefined | null; | ||
declare const isNonEmptyObject: <T = any>(value: unknown) => value is T; | ||
declare const isObject: <T = any>(value: unknown) => value is T; | ||
declare const isWalkable: <T = any>(value: unknown) => value is T; | ||
``` | ||
@@ -81,13 +82,16 @@ | ||
```ts | ||
export declare const isArray: <T extends any[] = any[]>(value: unknown) => value is T; | ||
export declare const isArrayOfBooleans: (value: unknown) => value is boolean[]; | ||
export declare const isArrayOfNumbers: (value: unknown) => value is number[]; | ||
export declare const isArrayOfObjects: <T extends any[] = any[]>(value: unknown) => value is T; | ||
export declare const isArrayOfSize: <T extends any[] = any[]>( | ||
declare const isArray: <T extends any[] = any[]>(value: unknown) => value is T; | ||
declare const isArrayIncludingAllOf: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; | ||
declare const isArrayIncludingAnyOf: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; | ||
declare const isArrayIncludingOnly: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; | ||
declare const isArrayOfBooleans: (value: unknown) => value is boolean[]; | ||
declare const isArrayOfNumbers: (value: unknown) => value is number[]; | ||
declare const isArrayOfObjects: <T extends any[] = any[]>(value: unknown) => value is T; | ||
declare const isArrayOfSize: <T extends any[] = any[]>( | ||
size: number, | ||
value: unknown, | ||
) => value is T; | ||
export declare const isArrayOfStrings: (value: unknown) => value is string[]; | ||
export declare const isEmptyArray: <T extends [] = []>(any) => value is T; | ||
export declare const isNonEmptyArray: <T extends any[] = any[]>(value: unknown) => value is T; | ||
declare const isArrayOfStrings: (value: unknown) => value is string[]; | ||
declare const isEmptyArray: <T extends [] = []>(any) => value is T; | ||
declare const isNonEmptyArray: <T extends any[] = any[]>(value: unknown) => value is T; | ||
``` | ||
@@ -98,6 +102,13 @@ | ||
```ts | ||
export declare const isAfter: (other: Date, value: unknown) => value is Date; | ||
export declare const isBefore: (other: Date, value: unknown) => value is Date; | ||
export declare const isDate: (value: unknown) => value is Date; | ||
export declare const isValidDate: (value: unknown) => value is Date; | ||
declare const isAfter: (other: Date, value: unknown) => value is Date; | ||
declare const isBefore: (other: Date, value: unknown) => value is Date; | ||
declare const isDate: (value: unknown) => value is Date; | ||
declare const isDateBetween: (floor: Date, ceiling: Date, value: unknown) => value is Date; | ||
declare const isDateInMonth: (index: number, value: unknown) => value is Date; | ||
declare const isDateInYear: (year: number, value: unknown) => value is Date; | ||
declare const isDateOnDayOfMonth: (day: number, value: unknown) => value is Date; | ||
declare const isDateOnDayOfWeek: (index: number, value: unknown) => value is Date; | ||
declare const isDateOnOrAfter: (other: Date, value: unknown) => value is Date; | ||
declare const isDateOnOrBefore: (other: Date, value: unknown) => value is Date; | ||
declare const isValidDate: (value: unknown) => value is Date; | ||
``` | ||
@@ -108,13 +119,15 @@ | ||
```ts | ||
export declare const isCalculable: (value: unknown) => value is number; | ||
export declare const isDecimalNumber: (value: unknown) => value is number; | ||
export declare const isDivisibleBy: (other: number, value: unknown) => value is number; | ||
export declare const isEvenNumber: (value: unknown) => value is number; | ||
export declare const isGreaterThanOrEqualTo: (other: number, value: unknown) => value is number; | ||
export declare const isLessThanOrEqualTo: (other: number, value: unknown) => value is number; | ||
export declare const isNear: (other: number, epsilon: number, value: unknown) => value is number; | ||
export declare const isNumber: (value: unknown) => value is number; | ||
export declare const isOddNumber: (value: unknown) => value is number; | ||
export declare const isWholeNumber: (value: unknown) => value is number; | ||
export declare const isWithinRange: ( | ||
declare const isCalculable: (value: unknown) => value is number; | ||
declare const isDecimalNumber: (value: unknown) => value is number; | ||
declare const isDivisibleBy: (other: number, value: unknown) => value is number; | ||
declare const isEvenNumber: (value: unknown) => value is number; | ||
declare const isGreaterThanOrEqualTo: (other: number, value: unknown) => value is number; | ||
declare const isLessThanOrEqualTo: (other: number, value: unknown) => value is number; | ||
declare const isNear: (other: number, epsilon: number, value: unknown) => value is number; | ||
declare const isNegativeNumber: (value: unknown) => value is number; | ||
declare const isNumber: (value: unknown) => value is number; | ||
declare const isOddNumber: (value: unknown) => value is number; | ||
declare const isPositiveNumber: (value: unknown) => value is number; | ||
declare const isWholeNumber: (value: unknown) => value is number; | ||
declare const isWithinRange: ( | ||
floor: number, | ||
@@ -129,14 +142,14 @@ ceiling: number, | ||
```ts | ||
export declare const endsWith: (other: string, value: unknown) => value is number; | ||
export declare const isEmptyString: (value: unknown) => value is number; | ||
export declare const isIso8601: (value: unknown) => value is number; | ||
export declare const isJsonString: (value: unknown) => value is number; | ||
export declare const isLongerThan: (other: string, value: unknown) => value is number; | ||
export declare const isNonEmptyString: (value: unknown) => value is number; | ||
export declare const isSameLengthAs: (other: string, value: unknown) => value is number; | ||
export declare const isShorterThan: (other: string, value: unknown) => value is number; | ||
export declare const isString: (value: unknown) => value is number; | ||
export declare const isVisibleString: (value: unknown) => value is number; | ||
export declare const isWhitespace: (value: unknown) => value is number; | ||
export declare const startsWith: (other: string, value: unknown) => value is number; | ||
declare const endsWith: (other: string, value: unknown) => value is string; | ||
declare const isEmptyString: (value: unknown) => value is string; | ||
declare const isIso8601: (value: unknown) => value is string; | ||
declare const isJsonString: (value: unknown) => value is string; | ||
declare const isLongerThan: (other: string, value: unknown) => value is string; | ||
declare const isNonEmptyString: (value: unknown) => value is string; | ||
declare const isSameLengthAs: (other: string, value: unknown) => value is string; | ||
declare const isShorterThan: (other: string, value: unknown) => value is string; | ||
declare const isString: (value: unknown) => value is string; | ||
declare const isVisibleString: (value: unknown) => value is string; | ||
declare const isWhitespace: (value: unknown) => value is string; | ||
declare const startsWith: (other: string, value: unknown) => value is string; | ||
``` | ||
@@ -147,8 +160,8 @@ | ||
```ts | ||
export declare const withMissingBranches: (value: object | any[]) => Generator; | ||
export declare const withMissingLeaves: (value: object | any[]) => Generator; | ||
export declare const withMissingNodes: (value: object | any[]) => Generator; | ||
export declare const withNullBranches: (value: object | any[]) => Generator; | ||
export declare const withNullLeaves: (value: object | any[]) => Generator; | ||
export declare const withNullNodes: (value: object | any[]) => Generator; | ||
declare const withMissingBranches: (value: object | any[]) => Generator; | ||
declare const withMissingLeaves: (value: object | any[]) => Generator; | ||
declare const withMissingNodes: (value: object | any[]) => Generator; | ||
declare const withNullBranches: (value: object | any[]) => Generator; | ||
declare const withNullLeaves: (value: object | any[]) => Generator; | ||
declare const withNullNodes: (value: object | any[]) => Generator; | ||
``` |
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
119907
171
2694
160