chore(cli): remove atty crate (#20275)

Removes a crate with an outstanding vulnerability.
This commit is contained in:
Matt Mastracci 2023-08-25 07:43:07 -06:00 committed by GitHub
parent 9e31f9452e
commit c272d26ae8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 37 additions and 39 deletions

View file

@ -4,7 +4,6 @@ const ops = core.ops;
const primordials = globalThis.__bootstrap.primordials;
const {
Uint32Array,
Uint8Array,
} = primordials;
const size = new Uint32Array(2);
@ -14,10 +13,8 @@ function consoleSize() {
return { columns: size[0], rows: size[1] };
}
const isattyBuffer = new Uint8Array(1);
function isatty(rid) {
ops.op_isatty(rid, isattyBuffer);
return !!isattyBuffer[0];
return ops.op_isatty(rid);
}
export { consoleSize, isatty };