Skip to content

Commit

Permalink
BREAKING(fs): deprecate EOL enum (denoland#3809)
Browse files Browse the repository at this point in the history
  • Loading branch information
iuioiua committed Nov 16, 2023
1 parent 16db0d5 commit 1a4be18
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion fs/eol.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,33 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

/** Platform-specific conventions for the line ending format (i.e., the "end-of-line"). */
// End-of-line character for POSIX platforms such as macOS and Linux.
export const LF = "\n" as const;

/** End-of-line character for Windows platforms. */
export const CRLF = "\r\n" as const;

/**
* End-of-line character evaluated for the current platform.
*
* @example
* ```ts
* import { EOL } from "https://deno.land/std@$STD_VERSION/fs/eol.ts";
*
* EOL; // Returns "\n" on POSIX platforms or "\r\n" on Windows
* ```
*
* @todo(iuioiua): Uncomment the following line upon deprecation of the `EOL`
* enum.
*/
// export const EOL = Deno.build.os === "windows" ? CRLF : LF;

/**
* Platform-specific conventions for the line ending format (i.e., the "end-of-line").
*
* @deprecated (will be removed in 0.209.0) This will be replaced by an
* OS-dependent `EOL` constant.
*/
export enum EOL {
/** Line Feed. Typically used in Unix (and Unix-like) systems. */
LF = "\n",
Expand Down

0 comments on commit 1a4be18

Please sign in to comment.