From c977a809748256347ff4213813a7ee426dc72bde Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Mon, 28 Feb 2022 16:58:24 +0800 Subject: [PATCH] doc: deprecate coercion to string in `fs.write` Refs: https://github.com/nodejs/node/pull/41677 --- doc/api/deprecations.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index 6a497a00c9e726..fc5f80368cd7cf 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -3110,6 +3110,20 @@ releases. Use [`process.getActiveResourcesInfo()`][] to get a list of types of active resources and not the actual references. +### DEP0XXX: `fs.write` coercion to string + + + +Type: Documentation-only + +Implicit coercion of objects with own `toString` property, passed as second +parameter in [`fs.write()`][], is deprecated. Convert them to primitive strings. + [Legacy URL API]: url.md#legacy-url-api [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 @@ -3168,6 +3182,7 @@ resources and not the actual references. [`fs.read()`]: fs.md#fsreadfd-buffer-offset-length-position-callback [`fs.readSync()`]: fs.md#fsreadsyncfd-buffer-offset-length-position [`fs.stat()`]: fs.md#fsstatpath-options-callback +[`fs.write()`]: fs.md#fswritefd-buffer-offset-length-position-callback [`http.ClientRequest`]: http.md#class-httpclientrequest [`http.IncomingMessage`]: http.md#class-httpincomingmessage [`http.ServerResponse`]: http.md#class-httpserverresponse