-
Notifications
You must be signed in to change notification settings - Fork 0
closer
Nicholas Berlette edited this page Jun 19, 2025
·
1 revision
function isCloser(it: unknown): it is Closer;Checks if a given value implments the Deno.Closer interface, which means it
has a close method that can be called to release associated resources.
| Name | Info |
|---|---|
it |
The value to check. |
true if the value implements Deno.Closer, false otherwise.
I/O
import { isCloser } from "jsr:@nick/is/closer";
const file = await Deno.open("file.txt");
isCloser(file); // true
const socket = new WebSocket("ws://example.com");
isCloser(socket); // trueAn abstract interface which when implemented provides an interface to close files/resources that were previously opened.
I/O
close(): void;Closes the resource, "freeing" the backing file/resource.