-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
2,280 additions
and
1,207 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
{ | ||
"presets": ["@babel/preset-env"] | ||
"presets": [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript" | ||
] | ||
} |
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
yarn-error.log | ||
node_modules | ||
dist | ||
.DS_Store | ||
coverage |
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,13 @@ | ||
/** | ||
* Possible results when comparing two items. | ||
*/ | ||
enum SORTING_ORDER { | ||
/** Any negative number */ | ||
LHS_BEFORE_RHS = -1, | ||
/** Any positive number */ | ||
LHS_AFTER_RHS = 1, | ||
/** Zero */ | ||
EQUAL = 0 | ||
} | ||
|
||
export { SORTING_ORDER } |
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,120 @@ | ||
import _ from 'lodash' | ||
|
||
export default fromPairsMap | ||
|
||
/** | ||
* Applies `fromPairs` to the result of mapping given `iteratee` to given | ||
* collection. | ||
* | ||
* @param collection Collection to iterate over | ||
* @param iteratee Function invoked per iteration | ||
* @returns New object | ||
*/ | ||
export function fromPairsMap<T, PropertyName, TResult> ( | ||
collection: T[] | null | undefined, | ||
iteratee: _.ArrayIterator<T, [PropertyName, TResult]> | ||
): _.Dictionary<TResult> { | ||
return _.fromPairs(_.map(collection, iteratee)) | ||
} | ||
|
||
declare module 'lodash' { | ||
interface LoDashStatic { | ||
/** | ||
* Applies `fromPairs` to the result of mapping given `iteratee` to given | ||
* collection. | ||
* | ||
* @param collection Collection to iterate over | ||
* @param iteratee Function invoked per iteration | ||
* @returns New object | ||
*/ | ||
fromPairsMap<T, PropertyName, TResult>( | ||
collection: T[] | null | undefined, | ||
iteratee: ArrayIterator<T, [PropertyName, TResult]> | ||
): Dictionary<TResult> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T, TResult>( | ||
collection: List<T> | null | undefined, | ||
iteratee: ListIterator<T, [PropertyName, TResult]> | ||
): Dictionary<TResult> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T>( | ||
collection: List<T> | Dictionary<T> | NumericDictionary<T> | null | undefined | ||
): Dictionary<T> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T extends object, TResult>( | ||
collection: T | null | undefined, | ||
iteratee: ObjectIterator<T, [PropertyName, TResult]> | ||
): Dictionary<TResult> | ||
} | ||
|
||
interface LoDashImplicitWrapper<TValue> { | ||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T, TResult>( | ||
this: LoDashImplicitWrapper<T[] | null | undefined>, | ||
iteratee: ArrayIterator<T, [PropertyName, TResult]> | ||
): LoDashImplicitWrapper<Dictionary<TResult>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T, TResult>( | ||
this: LoDashImplicitWrapper<List<T> | null | undefined>, | ||
iteratee: ListIterator<T, [PropertyName, TResult]> | ||
): LoDashImplicitWrapper<Dictionary<TResult>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T>(this: LoDashImplicitWrapper<List<T> | Dictionary<T> | NumericDictionary<T> | null | undefined>): LoDashImplicitWrapper<Dictionary<T>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T extends object, TResult>( | ||
this: LoDashImplicitWrapper<T | null | undefined>, | ||
iteratee: ObjectIterator<T, [PropertyName, TResult]> | ||
): LoDashImplicitWrapper<Dictionary<TResult>> | ||
} | ||
|
||
interface LoDashExplicitWrapper<TValue> { | ||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T, TResult>( | ||
this: LoDashExplicitWrapper<T[] | null | undefined>, | ||
iteratee: ArrayIterator<T, [PropertyName, TResult]> | ||
): LoDashExplicitWrapper<Dictionary<TResult>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T, TResult>( | ||
this: LoDashExplicitWrapper<List<T> | null | undefined>, | ||
iteratee: ListIterator<T, [PropertyName, TResult]> | ||
): LoDashExplicitWrapper<Dictionary<TResult>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T>(this: LoDashExplicitWrapper<List<T> | Dictionary<T> | NumericDictionary<T> | null | undefined>): LoDashExplicitWrapper<Dictionary<T>> | ||
|
||
/** | ||
* @see _.fromPairsMap | ||
*/ | ||
fromPairsMap<T extends object, TResult>( | ||
this: LoDashExplicitWrapper<T | null | undefined>, | ||
iteratee: ObjectIterator<T, [PropertyName, TResult]> | ||
): LoDashExplicitWrapper<Dictionary<TResult>> | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.