Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING(fs): deprecate EOL enum #3809

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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