@opencreek/ext
Advanced tools
Comparing version 1.1.0--canary.1.c7fdd1ae303a59b3ef529a08735b2d44b9564296.0 to 1.1.0
@@ -20,3 +20,2 @@ declare type PairSplit<T> = T extends [infer F, infer L] ? [F[], L[]] : never; | ||
mapNotNullish<O>(transformer: (el: T) => O): NonNullable<O>[]; | ||
maxBy(selector: ((el: T) => number) | ((el: T) => string) | ((el: T) => bigint) | ((el: T) => Date)): T | undefined; | ||
maxBy(selector: (el: T) => string): T | undefined; | ||
@@ -26,3 +25,2 @@ maxBy(selector: (el: T) => bigint): T | undefined; | ||
maxBy(selector: (el: T) => Date): T | undefined; | ||
maxOf<S extends ((el: T) => number) | ((el: T) => bigint)>(selector: S): ReturnType<S> | undefined; | ||
maxOf(selector: (el: T) => bigint): bigint | undefined; | ||
@@ -35,5 +33,3 @@ maxOf(selector: (el: T) => number): number | undefined; | ||
minBy(selector: (el: T) => Date): T | undefined; | ||
minBy(selector: ((el: T) => number) | ((el: T) => string) | ((el: T) => bigint) | ((el: T) => Date)): T | undefined; | ||
minOf(selector: (el: T) => bigint): bigint | undefined; | ||
minOf<S extends ((el: T) => number) | ((el: T) => bigint)>(selector: S): ReturnType<S> | undefined; | ||
minOf(selector: (el: T) => number): number | undefined; | ||
@@ -49,3 +45,2 @@ minWith(comparator: (a: T, b: T) => number): T | undefined; | ||
}): T[][]; | ||
sortBy(selector: ((el: T) => number) | ((el: T) => string) | ((el: T) => bigint) | ((el: T) => Date)): T[]; | ||
sortBy(selector: (el: T) => Date): T[]; | ||
@@ -52,0 +47,0 @@ sortBy(selector: (el: T) => bigint): T[]; |
@@ -25,3 +25,3 @@ "use strict"; | ||
function filterNotNullish() { | ||
return this.filter((it) => it != undefined); | ||
return this.filter((it) => it != null); | ||
} | ||
@@ -28,0 +28,0 @@ function extendArray(key) { |
@@ -0,1 +1,13 @@ | ||
# v1.1.0 (Thu Sep 30 2021) | ||
#### 🚀 Enhancement | ||
- Add Deno collections as Array extensions and some object extensions [#1](https://github.com/opencreek/typescript-extensions/pull/1) ([@mhlz](https://github.com/mhlz)) | ||
#### Authors: 1 | ||
- Mischa Holz ([@mhlz](https://github.com/mhlz)) | ||
--- | ||
# v1.0.2 (Wed Sep 29 2021) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "@opencreek/ext", | ||
"version": "1.1.0--canary.1.c7fdd1ae303a59b3ef529a08735b2d44b9564296.0", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -7,3 +7,3 @@ import * as collections from "@opencreek/deno-std-collections" | ||
function filterNotNullish<T>(this: Array<T>): Array<NonNullable<T>> { | ||
return this.filter((it): it is NonNullable<T> => it != undefined) | ||
return this.filter((it): it is NonNullable<T> => it != null) | ||
} | ||
@@ -84,9 +84,2 @@ | ||
mapNotNullish<O>(transformer: (el: T) => O): NonNullable<O>[] | ||
maxBy( | ||
selector: | ||
| ((el: T) => number) | ||
| ((el: T) => string) | ||
| ((el: T) => bigint) | ||
| ((el: T) => Date) | ||
): T | undefined | ||
maxBy(selector: (el: T) => string): T | undefined | ||
@@ -96,5 +89,2 @@ maxBy(selector: (el: T) => bigint): T | undefined | ||
maxBy(selector: (el: T) => Date): T | undefined | ||
maxOf<S extends ((el: T) => number) | ((el: T) => bigint)>( | ||
selector: S | ||
): ReturnType<S> | undefined | ||
maxOf(selector: (el: T) => bigint): bigint | undefined | ||
@@ -107,13 +97,3 @@ maxOf(selector: (el: T) => number): number | undefined | ||
minBy(selector: (el: T) => Date): T | undefined | ||
minBy( | ||
selector: | ||
| ((el: T) => number) | ||
| ((el: T) => string) | ||
| ((el: T) => bigint) | ||
| ((el: T) => Date) | ||
): T | undefined | ||
minOf(selector: (el: T) => bigint): bigint | undefined | ||
minOf<S extends ((el: T) => number) | ((el: T) => bigint)>( | ||
selector: S | ||
): ReturnType<S> | undefined | ||
minOf(selector: (el: T) => number): number | undefined | ||
@@ -132,9 +112,2 @@ minWith(comparator: (a: T, b: T) => number): T | undefined | ||
): T[][] | ||
sortBy( | ||
selector: | ||
| ((el: T) => number) | ||
| ((el: T) => string) | ||
| ((el: T) => bigint) | ||
| ((el: T) => Date) | ||
): T[] | ||
sortBy(selector: (el: T) => Date): T[] | ||
@@ -141,0 +114,0 @@ sortBy(selector: (el: T) => bigint): T[] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
0
30957
485