-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refactor] extract implementations to
side-channel-weakmap
, `side-c…
…hannel-map`, `side-channel-list`
- Loading branch information
Showing
6 changed files
with
106 additions
and
239 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
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,13 +1,14 @@ | ||
import getSideChannelList from 'side-channel-list'; | ||
import getSideChannelMap from 'side-channel-map'; | ||
import getSideChannelWeakMap from 'side-channel-weakmap'; | ||
|
||
declare namespace getSideChannel { | ||
type Channel<V, K> = { | ||
assert: (key: K) => void; | ||
has: (key: K) => boolean; | ||
get: (key: K) => V | undefined; | ||
set: (key: K, value: V) => void; | ||
delete: (key: K) => boolean; | ||
} | ||
type Channel<K, V> = | ||
| getSideChannelList.Channel<K, V> | ||
| ReturnType<Exclude<typeof getSideChannelMap<K, V>, false>> | ||
| ReturnType<Exclude<typeof getSideChannelWeakMap<K, V>, false>>; | ||
} | ||
|
||
declare function getSideChannel<V, K>(): getSideChannel.Channel<V, K>; | ||
declare function getSideChannel<K, V>(): getSideChannel.Channel<K, V>; | ||
|
||
export = getSideChannel; |
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 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
Oops, something went wrong.