diff options
| author | Aya Morisawa <AyaMorisawa4869@gmail.com> | 2018-11-09 11:01:55 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2018-11-09 11:01:55 +0900 |
| commit | a9436306abbb504e7746ff5821b6fe2daac1e4fe (patch) | |
| tree | 142e191d93e73326bef135e52fc706734b80ee09 /src/prelude/array.ts | |
| parent | Update autobind-decorator requirement from 2.1.0 to 2.2.1 (#3151) (diff) | |
| download | misskey-a9436306abbb504e7746ff5821b6fe2daac1e4fe.tar.gz misskey-a9436306abbb504e7746ff5821b6fe2daac1e4fe.tar.bz2 misskey-a9436306abbb504e7746ff5821b6fe2daac1e4fe.zip | |
Fix #3170 (#3173)
Diffstat (limited to 'src/prelude/array.ts')
| -rw-r--r-- | src/prelude/array.ts | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/prelude/array.ts b/src/prelude/array.ts index 54f7081712..42f05dc0c9 100644 --- a/src/prelude/array.ts +++ b/src/prelude/array.ts @@ -18,6 +18,10 @@ export function erase<T>(x: T, xs: T[]): T[] { return xs.filter(y => x !== y); } +export function setDifference<T>(xs: T[], ys: T[]): T[] { + return xs.filter(x => !ys.includes(x)); +} + export function unique<T>(xs: T[]): T[] { return [...new Set(xs)]; } |