mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 08:09:08 -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)
|
* 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
|
* @category I/O
|
||||||
*/
|
*/
|
||||||
export function seek(
|
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)
|
* 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
|
* @category I/O
|
||||||
*/
|
*/
|
||||||
export function seekSync(
|
export function seekSync(
|
||||||
|
|
|
@ -109,8 +109,22 @@ const denoNs = {
|
||||||
stdin: io.stdin,
|
stdin: io.stdin,
|
||||||
stdout: io.stdout,
|
stdout: io.stdout,
|
||||||
stderr: io.stderr,
|
stderr: io.stderr,
|
||||||
seek: fs.seek,
|
seek(rid, offset, whence) {
|
||||||
seekSync: fs.seekSync,
|
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,
|
connect: net.connect,
|
||||||
listen: net.listen,
|
listen: net.listen,
|
||||||
loadavg: os.loadavg,
|
loadavg: os.loadavg,
|
||||||
|
|
Loading…
Reference in a new issue