mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
chore(tools): add deprecation check (#2613)
This commit is contained in:
parent
aa23f04b69
commit
2f7713a164
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@ -129,6 +129,9 @@ jobs:
|
||||
- name: Check License headers
|
||||
run: "deno task lint:licence-headers"
|
||||
|
||||
- name: Check Deprecations
|
||||
run: "deno task lint:deprecations"
|
||||
|
||||
hash-wasm:
|
||||
name: "_wasm_crypto/"
|
||||
runs-on: ${{ github.repository_owner == 'denoland' && 'ubuntu-20.04-xl' || 'ubuntu-20.04' }}
|
||||
|
134
_tools/check_deprecation.ts
Executable file
134
_tools/check_deprecation.ts
Executable file
@ -0,0 +1,134 @@
|
||||
// Copyright 2022-2022 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { VERSION } from "../version.ts";
|
||||
import * as semver from "../semver/mod.ts";
|
||||
import * as colors from "../fmt/colors.ts";
|
||||
|
||||
const EXTENSIONS = [".mjs", ".js", ".ts", ".rs"];
|
||||
const EXCLUDED_PATHS = [
|
||||
".git",
|
||||
"node/",
|
||||
"dotenv/testdata",
|
||||
"fs/testdata",
|
||||
"http/testdata",
|
||||
];
|
||||
|
||||
console.warn(
|
||||
colors.yellow("Warning"),
|
||||
`ignore ${
|
||||
colors.green(`"fs/exists.ts"`)
|
||||
} until issue is resolved: https://github.com/denoland/deno_std/issues/2594`,
|
||||
);
|
||||
EXCLUDED_PATHS.push("fs/exists.ts");
|
||||
|
||||
const ROOT = new URL("../", import.meta.url).pathname.slice(0, -1);
|
||||
const FAIL_FAST = Deno.args.includes("--fail-fast");
|
||||
|
||||
const DEPRECATED_REGEX = /\*\s+@deprecated\s+(?<text>.+)/;
|
||||
const DEPRECATION_IN_FORMAT_REGEX =
|
||||
/^\(will be removed in (?<version>\d+\.\d+\.\d+)\)/;
|
||||
const DEPRECATION_AFTER_FORMAT_REGEX =
|
||||
/^\(will be removed after (?<version>\d+\.\d+\.\d+)\)/;
|
||||
|
||||
let shouldFail = false;
|
||||
|
||||
// add three minor version to current version
|
||||
const DEFAULT_DEPRECATED_VERSION = semver.inc(
|
||||
semver.inc(
|
||||
semver.inc(
|
||||
VERSION,
|
||||
"minor",
|
||||
)!,
|
||||
"minor",
|
||||
)!,
|
||||
"minor",
|
||||
);
|
||||
|
||||
const DEPRECATION_IN_FORMAT =
|
||||
`(will be removed in ${DEFAULT_DEPRECATED_VERSION})`;
|
||||
|
||||
function walk(dir: string) {
|
||||
for (const x of Deno.readDirSync(dir)) {
|
||||
const filePath = `${dir}/${x.name}`;
|
||||
|
||||
if (x.isDirectory) {
|
||||
walk(filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
const isExcluded = EXCLUDED_PATHS
|
||||
.map((x) => filePath.includes(x))
|
||||
.some((x) => x);
|
||||
if (
|
||||
isExcluded ||
|
||||
!EXTENSIONS.map((x) => filePath.endsWith(x)).some((x) => x)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const content = Deno.readTextFileSync(filePath);
|
||||
const lines = content.split("\n");
|
||||
let lineIndex = 1;
|
||||
for (const line of lines) {
|
||||
const match = DEPRECATED_REGEX.exec(line);
|
||||
if (match) {
|
||||
const text = match.groups?.text;
|
||||
if (!text) {
|
||||
console.error(
|
||||
colors.red("Error"),
|
||||
`${
|
||||
colors.bold("@deprecated")
|
||||
} tag must have a version: ${filePath}:${lineIndex}`,
|
||||
);
|
||||
shouldFail = true;
|
||||
if (FAIL_FAST) Deno.exit(1);
|
||||
continue;
|
||||
}
|
||||
const { version: afterVersion } =
|
||||
DEPRECATION_AFTER_FORMAT_REGEX.exec(text)?.groups || {};
|
||||
|
||||
if (afterVersion) {
|
||||
if (semver.lt(afterVersion, VERSION)) {
|
||||
console.warn(
|
||||
colors.yellow("Warn"),
|
||||
`${
|
||||
colors.bold("@deprecated")
|
||||
} tag is expired and export should be removed: ${filePath}:${lineIndex}`,
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
const { version: inVersion } =
|
||||
DEPRECATION_IN_FORMAT_REGEX.exec(text)?.groups || {};
|
||||
if (!inVersion) {
|
||||
console.error(
|
||||
colors.red("Error"),
|
||||
`${
|
||||
colors.bold("@deprecated")
|
||||
} tag version is missing. Append '${DEPRECATION_IN_FORMAT}' after @deprecated tag: ${filePath}:${lineIndex}`,
|
||||
);
|
||||
shouldFail = true;
|
||||
if (FAIL_FAST) Deno.exit(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!semver.gt(inVersion, VERSION)) {
|
||||
console.error(
|
||||
colors.red("Error"),
|
||||
`${
|
||||
colors.bold("@deprecated")
|
||||
} tag is expired and export must be removed: ${filePath}:${lineIndex}`,
|
||||
);
|
||||
if (FAIL_FAST) Deno.exit(1);
|
||||
shouldFail = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
lineIndex += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
walk(ROOT);
|
||||
if (shouldFail) Deno.exit(1);
|
@ -3,10 +3,10 @@
|
||||
|
||||
import { BinarySearchNode, Direction } from "./binary_search_node.ts";
|
||||
|
||||
/** @deprecated use Direction instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use Direction instead */
|
||||
export type { Direction as direction };
|
||||
|
||||
export type { Direction };
|
||||
|
||||
/** @deprecated use BinarySearchNode instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use BinarySearchNode instead */
|
||||
export { BinarySearchNode as BSNode };
|
||||
|
@ -4,5 +4,5 @@
|
||||
import { BinarySearchTree } from "./binary_search_tree.ts";
|
||||
export * from "./_comparators.ts";
|
||||
|
||||
/** @deprecated use BinarySearchTree instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use BinarySearchTree instead */
|
||||
export { BinarySearchTree as BSTree };
|
||||
|
@ -4,10 +4,10 @@
|
||||
import { Direction } from "./bs_node.ts";
|
||||
import { RedBlackNode } from "./red_black_node.ts";
|
||||
|
||||
/** @deprecated use Direction instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use Direction instead */
|
||||
export type { Direction as direction };
|
||||
|
||||
export type { Direction };
|
||||
|
||||
/** @deprecated use RedBlackNode instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use RedBlackNode instead */
|
||||
export { RedBlackNode as RBNode };
|
||||
|
@ -4,5 +4,5 @@
|
||||
import { RedBlackTree } from "./red_black_tree.ts";
|
||||
export * from "./_comparators.ts";
|
||||
|
||||
/** @deprecated use RedBlackTree instead */
|
||||
/** @deprecated (will be removed after 0.157.0) use RedBlackTree instead */
|
||||
export { RedBlackTree as RBTree };
|
||||
|
@ -5,7 +5,7 @@ import { BinarySearchNode, Direction } from "./binary_search_node.ts";
|
||||
export type { Direction };
|
||||
|
||||
/**
|
||||
* @deprecated use Direction instead
|
||||
* @deprecated (will be removed after 0.157.0) use Direction instead
|
||||
*/
|
||||
export type { Direction as direction };
|
||||
|
||||
|
@ -44,7 +44,8 @@
|
||||
"test:browser": "git grep --name-only \"This module is browser compatible.\" | grep -v deno.json | grep -v .github/workflows | xargs deno cache --check --reload --config browser-compat.tsconfig.json",
|
||||
"lint:circular-deps": "deno run --allow-read --allow-net=deno.land ./_tools/check_circular_deps.ts",
|
||||
"lint:licence-headers": "deno run --allow-read ./_tools/check_licence.ts",
|
||||
"lint": "deno lint && deno task lint:circular-deps && deno task lint:licence-headers",
|
||||
"lint:deprecations": "deno run --allow-read ./_tools/check_deprecation.ts",
|
||||
"lint": "deno lint && deno task lint:circular-deps && deno task lint:licence-headers && deno task lint:depreactions",
|
||||
"node:unit": "deno test --unstable --allow-all node/ --ignore=node/_tools/test.ts,node/_tools/versions/",
|
||||
"node:test": "deno test --unstable --allow-all node/_tools/test.ts",
|
||||
"node:setup": "deno run --allow-read --allow-net --allow-write node/_tools/setup.ts",
|
||||
|
@ -8,7 +8,7 @@ export interface CsvStreamOptions {
|
||||
comment?: string;
|
||||
}
|
||||
|
||||
/** @deprecated Use CsvStreamOptions instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use CsvStreamOptions instead. */
|
||||
export type CSVStreamOptions = CsvStreamOptions;
|
||||
|
||||
class StreamLineReader implements LineReader {
|
||||
@ -108,5 +108,5 @@ export class CsvStream implements TransformStream<string, Array<string>> {
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated Use CsvStream instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use CsvStream instead. */
|
||||
export const CSVStream = CsvStream;
|
||||
|
@ -19,7 +19,7 @@ import {
|
||||
*/
|
||||
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Use `Error` instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Use `Error` instead.
|
||||
*/
|
||||
export class StringifyError extends Error {
|
||||
override readonly name = "StringifyError";
|
||||
@ -27,29 +27,29 @@ export class StringifyError extends Error {
|
||||
|
||||
export type {
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Import from "./csv.ts" instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Import from "./csv.ts" instead.
|
||||
*/
|
||||
Column,
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Import from "./csv.ts" instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Import from "./csv.ts" instead.
|
||||
*/
|
||||
ColumnDetails,
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Import from "./csv.ts" instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Import from "./csv.ts" instead.
|
||||
*/
|
||||
DataItem,
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Import from "./csv.ts" instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Import from "./csv.ts" instead.
|
||||
*/
|
||||
StringifyOptions,
|
||||
};
|
||||
|
||||
export {
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Use `"\r\n"` instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Use `"\r\n"` instead.
|
||||
*/ NEWLINE,
|
||||
/**
|
||||
* @deprecated This file will be removed soon. Import from "./csv.ts" instead.
|
||||
* @deprecated (will be removed after 0.157.0) This file will be removed soon. Import from "./csv.ts" instead.
|
||||
*/
|
||||
stringify,
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ export type JsonValue =
|
||||
|
||||
/** The type of the result of parsing JSON.
|
||||
*
|
||||
* @deprecated Use JsonValue instead. */
|
||||
* @deprecated (will be removed after 0.157.0) Use JsonValue instead. */
|
||||
export type JSONValue = JsonValue;
|
||||
|
||||
/** Optional object interface for `JSONParseStream` and `ConcatenatedJSONParseStream`. */
|
||||
@ -70,7 +70,7 @@ export class JsonParseStream extends TransformStream<string, JsonValue> {
|
||||
|
||||
/** Parse each chunk as JSON.
|
||||
*
|
||||
* @deprecated Use JsonParseStream instead. */
|
||||
* @deprecated (will be removed after 0.157.0) Use JsonParseStream instead. */
|
||||
export const JSONParseStream = JsonParseStream;
|
||||
|
||||
const branks = /^[ \t\r\n]*$/;
|
||||
@ -201,7 +201,7 @@ export class ConcatenatedJsonParseStream
|
||||
|
||||
/** stream to parse [Concatenated JSON](https://en.wikipedia.org/wiki/JSON_streaming#Concatenated_JSON).
|
||||
*
|
||||
* @deprecated Use ConcatenatedJsonParseStream instead. */
|
||||
* @deprecated (will be removed after 0.157.0) Use ConcatenatedJsonParseStream instead. */
|
||||
export const ConcatenatedJSONParseStream = ConcatenatedJsonParseStream;
|
||||
|
||||
const blank = new Set(" \t\r\n");
|
||||
|
@ -59,5 +59,5 @@ export class JsonStringifyStream extends TransformStream<unknown, string> {
|
||||
|
||||
/** Convert each chunk to JSON string.
|
||||
*
|
||||
* @deprecated Use JsonStringifyStream instead. */
|
||||
* @deprecated (will be removed after 0.157.0) Use JsonStringifyStream instead. */
|
||||
export const JSONStringifyStream = JsonStringifyStream;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
||||
/**
|
||||
* Test whether or not the given path exists by checking with the file system
|
||||
* @deprecated Checking the state of a file before using it causes a race condition. Perform the actual operation directly instead.
|
||||
* @deprecated (will be removed after 0.157.0) Checking the state of a file before using it causes a race condition. Perform the actual operation directly instead.
|
||||
* @see https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
|
||||
*/
|
||||
export async function exists(filePath: string): Promise<boolean> {
|
||||
@ -19,7 +19,7 @@ export async function exists(filePath: string): Promise<boolean> {
|
||||
|
||||
/**
|
||||
* Test whether or not the given path exists by checking with the file system
|
||||
* @deprecated Checking the state of a file before using it causes a race condition. Perform the actual operation directly instead.
|
||||
* @deprecated (will be removed after 0.157.0) Checking the state of a file before using it causes a race condition. Perform the actual operation directly instead.
|
||||
* @see https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use
|
||||
*/
|
||||
export function existsSync(filePath: string): boolean {
|
||||
|
10
hash/mod.ts
10
hash/mod.ts
@ -6,16 +6,16 @@
|
||||
*
|
||||
* This module is browser compatible.
|
||||
*
|
||||
* @deprecated Use Web Crypto API or std/crypto instead.
|
||||
* @deprecated (will be removed after 0.157.0) Use Web Crypto API or std/crypto instead.
|
||||
* @module
|
||||
*/
|
||||
|
||||
import { Hash } from "./_wasm/hash.ts";
|
||||
import type { Hasher } from "./hasher.ts";
|
||||
|
||||
/** @deprecated Use Web Crypto API or std/crypto instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use Web Crypto API or std/crypto instead. */
|
||||
export type { Hasher } from "./hasher.ts";
|
||||
/** @deprecated Use Web Crypto API or std/crypto instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use Web Crypto API or std/crypto instead. */
|
||||
export const supportedAlgorithms = [
|
||||
"md2",
|
||||
"md4",
|
||||
@ -38,13 +38,13 @@ export const supportedAlgorithms = [
|
||||
"blake3",
|
||||
"tiger",
|
||||
] as const;
|
||||
/** @deprecated Use Web Crypto API or std/crypto instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use Web Crypto API or std/crypto instead. */
|
||||
export type SupportedAlgorithm = typeof supportedAlgorithms[number];
|
||||
/**
|
||||
* Creates a new `Hash` instance.
|
||||
*
|
||||
* @param algorithm name of hash algorithm to use
|
||||
* @deprecated Use Web Crypto API or std/crypto instead.
|
||||
* @deprecated (will be removed after 0.157.0) Use Web Crypto API or std/crypto instead.
|
||||
*/
|
||||
export function createHash(algorithm: SupportedAlgorithm): Hasher {
|
||||
return new Hash(algorithm as string);
|
||||
|
@ -725,7 +725,7 @@ export async function serveTls(
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `serve` instead.
|
||||
* @deprecated (will be removed after 0.157.0) Use `serve` instead.
|
||||
*
|
||||
* Constructs a server, creates a listener on the given address, accepts
|
||||
* incoming connections, and handles requests on these connections with the
|
||||
@ -771,7 +771,7 @@ export async function listenAndServe(
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `serveTls` instead.
|
||||
* @deprecated (will be removed after 0.157.0) Use `serveTls` instead.
|
||||
*
|
||||
* Constructs a server, creates a listener on the given address, accepts
|
||||
* incoming connections, upgrades them to TLS, and handles requests on these
|
||||
|
18
io/bufio.ts
18
io/bufio.ts
@ -4,21 +4,21 @@
|
||||
|
||||
import * as buffer from "./buffer.ts";
|
||||
|
||||
/** @deprecated Use BufferFullError from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use BufferFullError from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const BufferFullError = buffer.BufferFullError;
|
||||
/** @deprecated Use PartialReadError from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use PartialReadError from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const PartialReadError = buffer.PartialReadError;
|
||||
/** @deprecated Use ReadLineResult from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use ReadLineResult from https://deno.land/std/io/buffer.ts instead. */
|
||||
export type ReadLineResult = buffer.ReadLineResult;
|
||||
/** @deprecated Use BufReader from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use BufReader from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const BufReader = buffer.BufReader;
|
||||
/** @deprecated Use BufWriter from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use BufWriter from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const BufWriter = buffer.BufWriter;
|
||||
/** @deprecated Use BufWriterSync from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use BufWriterSync from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const BufWriterSync = buffer.BufWriterSync;
|
||||
/** @deprecated Use readDelim from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readDelim from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const readDelim = buffer.readDelim;
|
||||
/** @deprecated Use readStringDelim from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readStringDelim from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const readStringDelim = buffer.readStringDelim;
|
||||
/** @deprecated Use readLines from https://deno.land/std/io/buffer.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readLines from https://deno.land/std/io/buffer.ts instead. */
|
||||
export const readLines = buffer.readLines;
|
||||
|
10
io/ioutil.ts
10
io/ioutil.ts
@ -4,13 +4,13 @@
|
||||
|
||||
import * as util from "./util.ts";
|
||||
|
||||
/** @deprecated Use copyN from https://deno.land/std/io/util.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use copyN from https://deno.land/std/io/util.ts instead. */
|
||||
export const copyN = util.copyN;
|
||||
/** @deprecated Use readShort from https://deno.land/std/io/util.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readShort from https://deno.land/std/io/util.ts instead. */
|
||||
export const readShort = util.readShort;
|
||||
/** @deprecated Use readInt from https://deno.land/std/io/util.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readInt from https://deno.land/std/io/util.ts instead. */
|
||||
export const readInt = util.readInt;
|
||||
/** @deprecated Use readLong from https://deno.land/std/io/util.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readLong from https://deno.land/std/io/util.ts instead. */
|
||||
export const readLong = util.readLong;
|
||||
/** @deprecated Use readLongToBytes from https://deno.land/std/io/util.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readLongToBytes from https://deno.land/std/io/util.ts instead. */
|
||||
export const sliceLongToBytes = util.sliceLongToBytes;
|
||||
|
@ -17,33 +17,33 @@ import {
|
||||
writerFromStreamWriter as writerFromStreamWriter2,
|
||||
} from "../streams/conversion.ts";
|
||||
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readerFromIterable = readerFromIterable2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const writerFromStreamWriter = writerFromStreamWriter2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readerFromStreamReader = readerFromStreamReader2;
|
||||
/** @deprecated This interface has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This interface has been moved to `/streams/conversion.ts`. */
|
||||
export type WritableStreamFromWriterOptions = WritableStreamFromWriterOptions2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const writableStreamFromWriter = writableStreamFromWriter2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readableStreamFromIterable = readableStreamFromIterable2;
|
||||
/** @deprecated This interface has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This interface has been moved to `/streams/conversion.ts`. */
|
||||
export type ReadableStreamFromReaderOptions = ReadableStreamFromReaderOptions2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readableStreamFromReader = readableStreamFromReader2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readAll = readAll2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const readAllSync = readAllSync2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const writeAll = writeAll2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const writeAllSync = writeAllSync2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const iterateReader = iterateReader2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const iterateReaderSync = iterateReaderSync2;
|
||||
/** @deprecated This function has been moved to `/streams/conversion.ts`. */
|
||||
/** @deprecated (will be removed after 0.157.0) This function has been moved to `/streams/conversion.ts`. */
|
||||
export const copy = copy2;
|
||||
|
18
io/util.ts
18
io/util.ts
@ -103,21 +103,21 @@ export function sliceLongToBytes(
|
||||
return dest;
|
||||
}
|
||||
|
||||
/** @deprecated Use readAll from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readAll from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const readAll = streams.readAll;
|
||||
/** @deprecated Use readAllSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readAllSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const readAllSync = streams.readAllSync;
|
||||
/** @deprecated Use writeAll from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use writeAll from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const writeAll = streams.writeAll;
|
||||
/** @deprecated Use writeAllSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use writeAllSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const writeAllSync = streams.writeAllSync;
|
||||
/** @deprecated Use iterateReader from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use iterateReader from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const iter = streams.iterateReader;
|
||||
/** @deprecated Use iterateReaderSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use iterateReaderSync from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const iterSync = streams.iterateReaderSync;
|
||||
/** @deprecated Use copy from https://deno.land/std/streams/conversion.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use copy from https://deno.land/std/streams/conversion.ts instead. */
|
||||
export const copy = streams.copy;
|
||||
/** @deprecated Use readRange from https://deno.land/std/io/files.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readRange from https://deno.land/std/io/files.ts instead. */
|
||||
export const readRange = files.readRange;
|
||||
/** @deprecated Use readRangeSync from https://deno.land/std/io/files.ts instead. */
|
||||
/** @deprecated (will be removed after 0.157.0) Use readRangeSync from https://deno.land/std/io/files.ts instead. */
|
||||
export const readRangeSync = files.readRangeSync;
|
||||
|
@ -6,7 +6,7 @@ import { BytesList } from "../bytes/bytes_list.ts";
|
||||
const CR = "\r".charCodeAt(0);
|
||||
const LF = "\n".charCodeAt(0);
|
||||
|
||||
/** @deprecated Use TextLineStream instead, as it can handle empty lines.
|
||||
/** @deprecated (will be removed after 0.157.0) Use TextLineStream instead, as it can handle empty lines.
|
||||
*
|
||||
* Transform a stream into a stream where each chunk is divided by a newline,
|
||||
* be it `\n` or `\r\n`.
|
||||
|
@ -631,7 +631,7 @@ export function assertThrows<E extends Error = Error>(
|
||||
msgIncludes?: string,
|
||||
msg?: string,
|
||||
): E;
|
||||
/** @deprecated Use assertThrows(fn, msg) instead, which now returns thrown
|
||||
/** @deprecated (will be removed after 0.157.0) Use assertThrows(fn, msg) instead, which now returns thrown
|
||||
* value and you can assert on it. */
|
||||
export function assertThrows(
|
||||
fn: () => unknown,
|
||||
@ -714,7 +714,7 @@ export function assertRejects<E extends Error = Error>(
|
||||
msgIncludes?: string,
|
||||
msg?: string,
|
||||
): Promise<E>;
|
||||
/** @deprecated Use assertRejects(fn, msg) instead, which now returns rejected value
|
||||
/** @deprecated (will be removed after 0.157.0) Use assertRejects(fn, msg) instead, which now returns rejected value
|
||||
* and you can assert on it. */
|
||||
export function assertRejects(
|
||||
fn: () => PromiseLike<unknown>,
|
||||
|
@ -5,7 +5,7 @@
|
||||
*
|
||||
* See: https://doc.deno.land/deno/unstable/~/Deno.bench for details.
|
||||
*
|
||||
* @deprecated Use `Deno.bench()` instead.
|
||||
* @deprecated (will be removed after 0.157.0) Use `Deno.bench()` instead.
|
||||
* @module
|
||||
*/
|
||||
|
||||
@ -158,7 +158,7 @@ function createBenchmarkTimer(clock: BenchmarkClock): BenchmarkTimer {
|
||||
const candidates: BenchmarkDefinition[] = [];
|
||||
|
||||
/**
|
||||
* @deprecated Use `Deno.bench()` instead. See https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* @deprecated (will be removed after 0.157.0) Use `Deno.bench()` instead. See https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* for details.
|
||||
*
|
||||
* Registers a benchmark as a candidate for the runBenchmarks executor. */
|
||||
@ -183,7 +183,7 @@ export function bench(
|
||||
* Clears benchmark candidates which name matches `only` and doesn't match `skip`.
|
||||
* Removes all candidates if options were not provided.
|
||||
*
|
||||
* @deprecated Use `Deno.bench()` instead. See: https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* @deprecated (will be removed after 0.157.0) Use `Deno.bench()` instead. See: https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* for details.
|
||||
*/
|
||||
export function clearBenchmarks({
|
||||
@ -198,7 +198,7 @@ export function clearBenchmarks({
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `Deno.bench()` instead. See https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* @deprecated (will be removed after 0.157.0) Use `Deno.bench()` instead. See https://doc.deno.land/deno/unstable/~/Deno.bench
|
||||
* for details.
|
||||
*
|
||||
* Runs all registered and non-skipped benchmarks serially.
|
||||
|
@ -133,7 +133,7 @@ export class TextProtoReader {
|
||||
|
||||
/** ReadMIMEHeader reads a MIME-style header from r.
|
||||
*
|
||||
* @deprecated Use readMimeHeader instead. */
|
||||
* @deprecated (will be removed after 0.157.0) Use readMimeHeader instead. */
|
||||
readMIMEHeader(): Promise<Headers | null> {
|
||||
return this.readMimeHeader();
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ export function validate(id: string): boolean {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated v4 UUID generation is deprecated and will be removed in a future
|
||||
* @deprecated (will be removed after 0.157.0) v4 UUID generation is deprecated and will be removed in a future
|
||||
* std/uuid release. Use the web standard `globalThis.crypto.randomUUID()`
|
||||
* function instead.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user