-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_utils.ts
More file actions
17 lines (15 loc) · 566 Bytes
/
_utils.ts
File metadata and controls
17 lines (15 loc) · 566 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright 2021-present the Equal authors. All rights reserved. MIT license.
import { getOwnPropertySymbols } from "./_constants.ts";
import { curry } from "./deps.ts";
const entriesSymbol = (
val: Record<PropertyKey, unknown>,
): [string, unknown][] => {
const symbols = getOwnPropertySymbols(val) as Extract<
PropertyKey,
"symbol"
>[];
return symbols.map((symbol) => [symbol, val[symbol]]);
};
const _instanceOf = (obj: Function, val: unknown) => val instanceof obj;
const instanceOf = curry(_instanceOf);
export { entriesSymbol, instanceOf };