mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 15:49:44 -05:00
feat: deprecate Deno.seek()
and Deno.seekSync()
(#22065)
For removal in Deno v2.
This commit is contained in:
parent
4c5ce90883
commit
ea48bee3f7
2 changed files with 22 additions and 2 deletions
6
cli/tsc/dts/lib.deno.ns.d.ts
vendored
6
cli/tsc/dts/lib.deno.ns.d.ts
vendored
|
@ -2100,6 +2100,9 @@ declare namespace Deno {
|
|||
* console.log(await Deno.seek(file.rid, -2, Deno.SeekMode.End)); // "9" (i.e. 11-2)
|
||||
* ```
|
||||
*
|
||||
* @deprecated Use `file.seek()` instead. {@linkcode Deno.seek} will be
|
||||
* removed in Deno 2.0.
|
||||
*
|
||||
* @category I/O
|
||||
*/
|
||||
export function seek(
|
||||
|
@ -2145,6 +2148,9 @@ declare namespace Deno {
|
|||
* console.log(Deno.seekSync(file.rid, -2, Deno.SeekMode.End)); // "9" (i.e. 11-2)
|
||||
* ```
|
||||
*
|
||||
* @deprecated Use `file.seekSync()` instead. {@linkcode Deno.seekSync}
|
||||
* will be removed in Deno 2.0.
|
||||
*
|
||||
* @category I/O
|
||||
*/
|
||||
export function seekSync(
|
||||
|
|
|
@ -109,8 +109,22 @@ const denoNs = {
|
|||
stdin: io.stdin,
|
||||
stdout: io.stdout,
|
||||
stderr: io.stderr,
|
||||
seek: fs.seek,
|
||||
seekSync: fs.seekSync,
|
||||
seek(rid, offset, whence) {
|
||||
internals.warnOnDeprecatedApi(
|
||||
"Deno.seek()",
|
||||
new Error().stack,
|
||||
"Use `file.seek()` instead.",
|
||||
);
|
||||
return fs.seek(rid, offset, whence);
|
||||
},
|
||||
seekSync(rid, offset, whence) {
|
||||
internals.warnOnDeprecatedApi(
|
||||
"Deno.seekSync()",
|
||||
new Error().stack,
|
||||
"Use `file.seekSync()` instead.",
|
||||
);
|
||||
return fs.seekSync(rid, offset, whence);
|
||||
},
|
||||
connect: net.connect,
|
||||
listen: net.listen,
|
||||
loadavg: os.loadavg,
|
||||
|
|
Loading…
Reference in a new issue