-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): convert to typescript
- Loading branch information
1 parent
5592065
commit 3e2868a
Showing
165 changed files
with
6,805 additions
and
10,589 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export { default as after } from './toBeAfter'; | ||
export { default as arrayOfBooleans } from './toBeArrayOfBooleans'; | ||
export { default as arrayOfNumbers } from './toBeArrayOfNumbers'; | ||
export { default as arrayOfObjects } from './toBeArrayOfObjects'; | ||
export { default as arrayOfSize } from './toBeArrayOfSize'; | ||
export { default as arrayOfStrings } from './toBeArrayOfStrings'; | ||
export { default as before } from './toBeBefore'; | ||
export { default as calculable } from './toBeCalculable'; | ||
export { default as emptyArray } from './toBeEmptyArray'; | ||
export { default as emptyObject } from './toBeEmptyObject'; | ||
export { default as endingWith } from './toEndWith'; | ||
export { default as evenNumber } from './toBeEvenNumber'; | ||
export { default as greaterThanOrEqualTo } from './toBeGreaterThanOrEqualTo'; | ||
export { default as iso8601 } from './toBeIso8601'; | ||
export { default as jsonString } from './toBeJsonString'; | ||
export { default as lessThanOrEqualTo } from './toBeLessThanOrEqualTo'; | ||
export { default as longerThan } from './toBeLongerThan'; | ||
export { default as nonEmptyArray } from './toBeNonEmptyArray'; | ||
export { default as nonEmptyObject } from './toBeNonEmptyObject'; | ||
export { default as nonEmptyString } from './toBeNonEmptyString'; | ||
export { default as oddNumber } from './toBeOddNumber'; | ||
export { default as regExp } from './toBeRegExp'; | ||
export { default as sameLengthAs } from './toBeSameLengthAs'; | ||
export { default as shorterThan } from './toBeShorterThan'; | ||
export { default as startingWith } from './toStartWith'; | ||
export { default as whitespace } from './toBeWhitespace'; | ||
export { default as wholeNumber } from './toBeWholeNumber'; | ||
export { default as withinRange } from './toBeWithinRange'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import addMatchers from 'add-matchers'; | ||
import * as asymmetricMatchersByName from './asymmetricMatchersByName'; | ||
import * as matchersByName from './matchersByName'; | ||
|
||
addMatchers(matchersByName); | ||
addMatchers.asymmetric(asymmetricMatchersByName); | ||
|
||
export default matchersByName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const createIs = (type) => (value) => | ||
Object.prototype.toString.call(value) === `[object ${type}]`; | ||
|
||
const createIsBooleanObject = (trueOrFalse) => (value) => | ||
is.Boolean(value) && value.valueOf() === trueOrFalse; | ||
|
||
const is = { | ||
Array: createIs('Array'), | ||
Boolean: createIs('Boolean'), | ||
Date: createIs('Date'), | ||
False: createIsBooleanObject(false), | ||
Function: createIs('Function'), | ||
Object: createIs('Object'), | ||
String: createIs('String'), | ||
True: createIsBooleanObject(true) | ||
}; | ||
|
||
export default is; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import reduce from './reduce'; | ||
|
||
export default (object) => | ||
reduce(object, (keys, value, key) => keys.concat(key), []); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import is from './is'; | ||
|
||
export default (toBeX) => (key, actual) => | ||
is.Object(actual) && toBeX(actual[key]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
export { default as toBeAfter } from './toBeAfter'; | ||
export { default as toBeArray } from './toBeArray'; | ||
export { default as toBeArrayOfBooleans } from './toBeArrayOfBooleans'; | ||
export { default as toBeArrayOfNumbers } from './toBeArrayOfNumbers'; | ||
export { default as toBeArrayOfObjects } from './toBeArrayOfObjects'; | ||
export { default as toBeArrayOfSize } from './toBeArrayOfSize'; | ||
export { default as toBeArrayOfStrings } from './toBeArrayOfStrings'; | ||
export { default as toBeBefore } from './toBeBefore'; | ||
export { default as toBeBoolean } from './toBeBoolean'; | ||
export { default as toBeCalculable } from './toBeCalculable'; | ||
export { default as toBeDate } from './toBeDate'; | ||
export { default as toBeEmptyArray } from './toBeEmptyArray'; | ||
export { default as toBeEmptyObject } from './toBeEmptyObject'; | ||
export { default as toBeEmptyString } from './toBeEmptyString'; | ||
export { default as toBeEvenNumber } from './toBeEvenNumber'; | ||
export { default as toBeFalse } from './toBeFalse'; | ||
export { default as toBeFunction } from './toBeFunction'; | ||
export { | ||
default as toBeGreaterThanOrEqualTo | ||
} from './toBeGreaterThanOrEqualTo'; | ||
export { default as toBeHtmlString } from './toBeHtmlString'; | ||
export { default as toBeIso8601 } from './toBeIso8601'; | ||
export { default as toBeJsonString } from './toBeJsonString'; | ||
export { default as toBeLessThanOrEqualTo } from './toBeLessThanOrEqualTo'; | ||
export { default as toBeLongerThan } from './toBeLongerThan'; | ||
export { default as toBeNear } from './toBeNear'; | ||
export { default as toBeNonEmptyArray } from './toBeNonEmptyArray'; | ||
export { default as toBeNonEmptyObject } from './toBeNonEmptyObject'; | ||
export { default as toBeNonEmptyString } from './toBeNonEmptyString'; | ||
export { default as toBeNumber } from './toBeNumber'; | ||
export { default as toBeObject } from './toBeObject'; | ||
export { default as toBeOddNumber } from './toBeOddNumber'; | ||
export { default as toBeRegExp } from './toBeRegExp'; | ||
export { default as toBeSameLengthAs } from './toBeSameLengthAs'; | ||
export { default as toBeShorterThan } from './toBeShorterThan'; | ||
export { default as toBeString } from './toBeString'; | ||
export { default as toBeTrue } from './toBeTrue'; | ||
export { default as toBeValidDate } from './toBeValidDate'; | ||
export { default as toBeWhitespace } from './toBeWhitespace'; | ||
export { default as toBeWholeNumber } from './toBeWholeNumber'; | ||
export { default as toBeWithinRange } from './toBeWithinRange'; | ||
export { default as toEndWith } from './toEndWith'; | ||
export { default as toHaveArray } from './toHaveArray'; | ||
export { default as toHaveArrayOfBooleans } from './toHaveArrayOfBooleans'; | ||
export { default as toHaveArrayOfNumbers } from './toHaveArrayOfNumbers'; | ||
export { default as toHaveArrayOfObjects } from './toHaveArrayOfObjects'; | ||
export { default as toHaveArrayOfSize } from './toHaveArrayOfSize'; | ||
export { default as toHaveArrayOfStrings } from './toHaveArrayOfStrings'; | ||
export { default as toHaveBoolean } from './toHaveBoolean'; | ||
export { default as toHaveCalculable } from './toHaveCalculable'; | ||
export { default as toHaveDate } from './toHaveDate'; | ||
export { default as toHaveDateAfter } from './toHaveDateAfter'; | ||
export { default as toHaveDateBefore } from './toHaveDateBefore'; | ||
export { default as toHaveEmptyArray } from './toHaveEmptyArray'; | ||
export { default as toHaveEmptyObject } from './toHaveEmptyObject'; | ||
export { default as toHaveEmptyString } from './toHaveEmptyString'; | ||
export { default as toHaveEvenNumber } from './toHaveEvenNumber'; | ||
export { default as toHaveFalse } from './toHaveFalse'; | ||
export { default as toHaveHtmlString } from './toHaveHtmlString'; | ||
export { default as toHaveIso8601 } from './toHaveIso8601'; | ||
export { default as toHaveJsonString } from './toHaveJsonString'; | ||
export { default as toHaveMember } from './toHaveMember'; | ||
export { default as toHaveMethod } from './toHaveMethod'; | ||
export { default as toHaveNonEmptyArray } from './toHaveNonEmptyArray'; | ||
export { default as toHaveNonEmptyObject } from './toHaveNonEmptyObject'; | ||
export { default as toHaveNonEmptyString } from './toHaveNonEmptyString'; | ||
export { default as toHaveNumber } from './toHaveNumber'; | ||
export { default as toHaveNumberWithinRange } from './toHaveNumberWithinRange'; | ||
export { default as toHaveObject } from './toHaveObject'; | ||
export { default as toHaveOddNumber } from './toHaveOddNumber'; | ||
export { default as toHaveString } from './toHaveString'; | ||
export { default as toHaveStringLongerThan } from './toHaveStringLongerThan'; | ||
export { | ||
default as toHaveStringSameLengthAs | ||
} from './toHaveStringSameLengthAs'; | ||
export { default as toHaveStringShorterThan } from './toHaveStringShorterThan'; | ||
export { default as toHaveTrue } from './toHaveTrue'; | ||
export { default as toHaveUndefined } from './toHaveUndefined'; | ||
export { default as toHaveWhitespaceString } from './toHaveWhitespaceString'; | ||
export { default as toHaveWholeNumber } from './toHaveWholeNumber'; | ||
export { default as toStartWith } from './toStartWith'; | ||
export { default as toThrowAnyError } from './toThrowAnyError'; | ||
export { default as toThrowErrorOfType } from './toThrowErrorOfType'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import toBeBefore from './toBeBefore'; | ||
export default (otherDate, actual) => toBeBefore(actual, otherDate); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import is from './lib/is'; | ||
export default is.Array; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import every from './lib/every'; | ||
import toBeArray from './toBeArray'; | ||
import toBeBoolean from './toBeBoolean'; | ||
export default (actual) => toBeArray(actual) && every(actual, toBeBoolean); |
Oops, something went wrong.