-
Notifications
You must be signed in to change notification settings - Fork 0
/
deps.ts
36 lines (32 loc) · 1.27 KB
/
deps.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This module is browser compatible.
// deno-lint-ignore-file no-explicit-any
export {
isBoolean,
isFunction,
isIterable,
isLength0,
isNil,
isNumber,
isObject,
isString,
isUndefined,
} from "https://deno.land/x/isx@v1.0.0-beta.17/mod.ts";
export { distinct } from "https://deno.land/std@0.136.0/collections/distinct.ts";
export { mapValues } from "https://deno.land/std@0.136.0/collections/map_values.ts";
export { mapEntries } from "https://deno.land/std@0.136.0/collections/map_entries.ts";
export { filterKeys } from "https://deno.land/std@0.136.0/collections/filter_keys.ts";
export { filterValues } from "https://deno.land/std@0.136.0/collections/filter_values.ts";
export { associateWith } from "https://deno.land/std@0.138.0/collections/mod.ts";
export { sortBy } from "https://deno.land/std@0.142.0/collections/mod.ts";
export type VFn = () => void;
export type Fn<Args extends readonly unknown[] = [], Return = any> = (
...args: Args
) => Return;
export type ValueOf<T> = T[keyof T];
export function wrap<T>(val: T): T extends any[] ? T : T[] {
return Array.isArray(val) ? val as never : [val] as never;
}
export function not<T extends (...args: any[]) => any>(fn: T) {
return (...args: Parameters<T>): boolean => !fn(...args);
}
export function noop(): void {}