mirror of
https://github.com/denoland/deno.git
synced 2024-12-25 16:49:18 -05:00
build: migrate to dlint (#8176)
This commit migrates repository from using "eslint" to "dlint" for linting JavaScript code.
This commit is contained in:
parent
e736d0f60f
commit
8e914be742
124 changed files with 440 additions and 423 deletions
6
cli/dts/lib.deno.ns.d.ts
vendored
6
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -40,7 +40,7 @@ declare interface Performance {
|
||||||
|
|
||||||
declare interface PerformanceMarkOptions {
|
declare interface PerformanceMarkOptions {
|
||||||
/** Metadata to be included in the mark. */
|
/** Metadata to be included in the mark. */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
detail?: any;
|
detail?: any;
|
||||||
|
|
||||||
/** Timestamp to be used as the mark time. */
|
/** Timestamp to be used as the mark time. */
|
||||||
|
@ -49,7 +49,7 @@ declare interface PerformanceMarkOptions {
|
||||||
|
|
||||||
declare interface PerformanceMeasureOptions {
|
declare interface PerformanceMeasureOptions {
|
||||||
/** Metadata to be included in the measure. */
|
/** Metadata to be included in the measure. */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
detail?: any;
|
detail?: any;
|
||||||
|
|
||||||
/** Timestamp to be used as the start time or string to be used as start
|
/** Timestamp to be used as the start time or string to be used as start
|
||||||
|
@ -1847,7 +1847,7 @@ declare namespace Deno {
|
||||||
export function metrics(): Metrics;
|
export function metrics(): Metrics;
|
||||||
|
|
||||||
interface ResourceMap {
|
interface ResourceMap {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
[rid: number]: any;
|
[rid: number]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
cli/dts/lib.deno.shared_globals.d.ts
vendored
2
cli/dts/lib.deno.shared_globals.d.ts
vendored
|
@ -3,8 +3,6 @@
|
||||||
// Documentation partially adapted from [MDN](https://developer.mozilla.org/),
|
// Documentation partially adapted from [MDN](https://developer.mozilla.org/),
|
||||||
// by Mozilla Contributors, which is licensed under CC-BY-SA 2.5.
|
// by Mozilla Contributors, which is licensed under CC-BY-SA 2.5.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, no-var */
|
|
||||||
|
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="esnext" />
|
/// <reference lib="esnext" />
|
||||||
/// <reference lib="deno.web" />
|
/// <reference lib="deno.web" />
|
||||||
|
|
4
cli/dts/lib.deno.window.d.ts
vendored
4
cli/dts/lib.deno.window.d.ts
vendored
|
@ -1,7 +1,5 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
/// <reference lib="deno.shared_globals" />
|
/// <reference lib="deno.shared_globals" />
|
||||||
|
@ -51,5 +49,3 @@ declare function confirm(message?: string): boolean;
|
||||||
* @param defaultValue
|
* @param defaultValue
|
||||||
*/
|
*/
|
||||||
declare function prompt(message?: string, defaultValue?: string): string | null;
|
declare function prompt(message?: string, defaultValue?: string): string | null;
|
||||||
|
|
||||||
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
4
cli/dts/lib.deno.worker.d.ts
vendored
4
cli/dts/lib.deno.worker.d.ts
vendored
|
@ -1,7 +1,5 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
/// <reference lib="deno.shared_globals" />
|
/// <reference lib="deno.shared_globals" />
|
||||||
|
@ -60,5 +58,3 @@ declare var onerror:
|
||||||
declare var close: () => void;
|
declare var close: () => void;
|
||||||
declare var name: string;
|
declare var name: string;
|
||||||
declare var postMessage: (message: any) => void;
|
declare var postMessage: (message: any) => void;
|
||||||
|
|
||||||
/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
|
@ -173,8 +173,6 @@
|
||||||
static kClearScreenDown = "\x1b[0J";
|
static kClearScreenDown = "\x1b[0J";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
||||||
|
|
||||||
function getClassInstanceName(instance) {
|
function getClassInstanceName(instance) {
|
||||||
if (typeof instance != "object") {
|
if (typeof instance != "object") {
|
||||||
return "";
|
return "";
|
||||||
|
@ -194,7 +192,9 @@
|
||||||
if (customInspect in value && typeof value[customInspect] === "function") {
|
if (customInspect in value && typeof value[customInspect] === "function") {
|
||||||
try {
|
try {
|
||||||
return String(value[customInspect]());
|
return String(value[customInspect]());
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Might be Function/AsyncFunction/GeneratorFunction/AsyncGeneratorFunction
|
// Might be Function/AsyncFunction/GeneratorFunction/AsyncGeneratorFunction
|
||||||
let cstrName = Object.getPrototypeOf(value)?.constructor?.name;
|
let cstrName = Object.getPrototypeOf(value)?.constructor?.name;
|
||||||
|
@ -358,7 +358,6 @@
|
||||||
let order = "padStart";
|
let order = "padStart";
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
for (let i = 0; i < entries.length; i++) {
|
for (let i = 0; i < entries.length; i++) {
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
if (
|
if (
|
||||||
typeof value[i] !== "number" &&
|
typeof value[i] !== "number" &&
|
||||||
typeof value[i] !== "bigint"
|
typeof value[i] !== "bigint"
|
||||||
|
@ -366,7 +365,6 @@
|
||||||
order = "padEnd";
|
order = "padEnd";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* eslint-enable */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Each iteration creates a single line of grouped entries.
|
// Each iteration creates a single line of grouped entries.
|
||||||
|
@ -483,6 +481,7 @@
|
||||||
.replace(/\t/g, "\\t")
|
.replace(/\t/g, "\\t")
|
||||||
.replace(/\v/g, "\\v")
|
.replace(/\v/g, "\\v")
|
||||||
.replace(
|
.replace(
|
||||||
|
// deno-lint-ignore no-control-regex
|
||||||
/[\x00-\x1f\x7f-\x9f]/g,
|
/[\x00-\x1f\x7f-\x9f]/g,
|
||||||
(c) => "\\x" + c.charCodeAt(0).toString(16).padStart(2, "0"),
|
(c) => "\\x" + c.charCodeAt(0).toString(16).padStart(2, "0"),
|
||||||
);
|
);
|
||||||
|
@ -519,11 +518,12 @@
|
||||||
) {
|
) {
|
||||||
const green = maybeColor(colors.green, inspectOptions);
|
const green = maybeColor(colors.green, inspectOptions);
|
||||||
switch (typeof value) {
|
switch (typeof value) {
|
||||||
case "string":
|
case "string": {
|
||||||
const trunc = value.length > STR_ABBREVIATE_SIZE
|
const trunc = value.length > STR_ABBREVIATE_SIZE
|
||||||
? value.slice(0, STR_ABBREVIATE_SIZE) + "..."
|
? value.slice(0, STR_ABBREVIATE_SIZE) + "..."
|
||||||
: value;
|
: value;
|
||||||
return green(quoteString(trunc)); // Quoted strings are green
|
return green(quoteString(trunc)); // Quoted strings are green
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return inspectValue(value, ctx, level, inspectOptions);
|
return inspectValue(value, ctx, level, inspectOptions);
|
||||||
}
|
}
|
||||||
|
@ -784,7 +784,7 @@
|
||||||
: red(`[Thrown ${error.name}: ${error.message}]`);
|
: red(`[Thrown ${error.name}: ${error.message}]`);
|
||||||
entries.push(`${maybeQuoteString(key)}: ${inspectedValue}`);
|
entries.push(`${maybeQuoteString(key)}: ${inspectedValue}`);
|
||||||
} else {
|
} else {
|
||||||
let descriptor = Object.getOwnPropertyDescriptor(value, key);
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
||||||
if (descriptor.get !== undefined && descriptor.set !== undefined) {
|
if (descriptor.get !== undefined && descriptor.set !== undefined) {
|
||||||
entries.push(`${maybeQuoteString(key)}: [Getter/Setter]`);
|
entries.push(`${maybeQuoteString(key)}: [Getter/Setter]`);
|
||||||
} else if (descriptor.get !== undefined) {
|
} else if (descriptor.get !== undefined) {
|
||||||
|
@ -818,7 +818,7 @@
|
||||||
: red(`Thrown ${error.name}: ${error.message}`);
|
: red(`Thrown ${error.name}: ${error.message}`);
|
||||||
entries.push(`[${maybeQuoteSymbol(key)}]: ${inspectedValue}`);
|
entries.push(`[${maybeQuoteSymbol(key)}]: ${inspectedValue}`);
|
||||||
} else {
|
} else {
|
||||||
let descriptor = Object.getOwnPropertyDescriptor(value, key);
|
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
||||||
if (descriptor.get !== undefined && descriptor.set !== undefined) {
|
if (descriptor.get !== undefined && descriptor.set !== undefined) {
|
||||||
entries.push(`[${maybeQuoteSymbol(key)}]: [Getter/Setter]`);
|
entries.push(`[${maybeQuoteSymbol(key)}]: [Getter/Setter]`);
|
||||||
} else if (descriptor.get !== undefined) {
|
} else if (descriptor.get !== undefined) {
|
||||||
|
@ -867,7 +867,9 @@
|
||||||
if (customInspect in value && typeof value[customInspect] === "function") {
|
if (customInspect in value && typeof value[customInspect] === "function") {
|
||||||
try {
|
try {
|
||||||
return String(value[customInspect]());
|
return String(value[customInspect]());
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// This non-unique symbol is used to support op_crates, ie.
|
// This non-unique symbol is used to support op_crates, ie.
|
||||||
// in op_crates/web we don't want to depend on unique "Deno.customInspect"
|
// in op_crates/web we don't want to depend on unique "Deno.customInspect"
|
||||||
|
@ -880,7 +882,9 @@
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
return String(value[nonUniqueCustomInspect]());
|
return String(value[nonUniqueCustomInspect]());
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (value instanceof Error) {
|
if (value instanceof Error) {
|
||||||
return String(value.stack);
|
return String(value.stack);
|
||||||
|
@ -1158,7 +1162,7 @@
|
||||||
let inValue = false;
|
let inValue = false;
|
||||||
let currentKey = null;
|
let currentKey = null;
|
||||||
let parenthesesDepth = 0;
|
let parenthesesDepth = 0;
|
||||||
currentPart = "";
|
let currentPart = "";
|
||||||
for (let i = 0; i < cssString.length; i++) {
|
for (let i = 0; i < cssString.length; i++) {
|
||||||
const c = cssString[i];
|
const c = cssString[i];
|
||||||
if (c == "(") {
|
if (c == "(") {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
||||||
|
|
||||||
((window) => {
|
((window) => {
|
||||||
const core = window.Deno.core;
|
const core = window.Deno.core;
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
});
|
});
|
||||||
/** @type {{ emittedFiles: Record<string, string>, diagnostics: any[] }} */
|
/** @type {{ emittedFiles: Record<string, string>, diagnostics: any[] }} */
|
||||||
const result = await opCompile(payload);
|
const result = await opCompile(payload);
|
||||||
let output = result.emittedFiles["deno:///bundle.js"];
|
const output = result.emittedFiles["deno:///bundle.js"];
|
||||||
util.assert(output);
|
util.assert(output);
|
||||||
const maybeDiagnostics = result.diagnostics.length === 0
|
const maybeDiagnostics = result.diagnostics.length === 0
|
||||||
? undefined
|
? undefined
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const openOptions = !!options.append
|
const openOptions = options.append
|
||||||
? { write: true, create: true, append: true }
|
? { write: true, create: true, append: true }
|
||||||
: { write: true, create: true, truncate: true };
|
: { write: true, create: true, truncate: true };
|
||||||
const file = openSync(path, openOptions);
|
const file = openSync(path, openOptions);
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const openOptions = !!options.append
|
const openOptions = options.append
|
||||||
? { write: true, create: true, append: true }
|
? { write: true, create: true, append: true }
|
||||||
: { write: true, create: true, truncate: true };
|
: { write: true, create: true, truncate: true };
|
||||||
const file = await open(path, openOptions);
|
const file = await open(path, openOptions);
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
__bootstrap.denoNs = {
|
((window) => {
|
||||||
|
const __bootstrap = window.__bootstrap;
|
||||||
|
__bootstrap.denoNs = {
|
||||||
test: __bootstrap.testing.test,
|
test: __bootstrap.testing.test,
|
||||||
metrics: __bootstrap.metrics.metrics,
|
metrics: __bootstrap.metrics.metrics,
|
||||||
Process: __bootstrap.process.Process,
|
Process: __bootstrap.process.Process,
|
||||||
|
@ -85,9 +87,9 @@ __bootstrap.denoNs = {
|
||||||
fsync: __bootstrap.fs.fsync,
|
fsync: __bootstrap.fs.fsync,
|
||||||
fdatasyncSync: __bootstrap.fs.fdatasyncSync,
|
fdatasyncSync: __bootstrap.fs.fdatasyncSync,
|
||||||
fdatasync: __bootstrap.fs.fdatasync,
|
fdatasync: __bootstrap.fs.fdatasync,
|
||||||
};
|
};
|
||||||
|
|
||||||
__bootstrap.denoNsUnstable = {
|
__bootstrap.denoNsUnstable = {
|
||||||
signal: __bootstrap.signals.signal,
|
signal: __bootstrap.signals.signal,
|
||||||
signals: __bootstrap.signals.signals,
|
signals: __bootstrap.signals.signals,
|
||||||
Signal: __bootstrap.signals.Signal,
|
Signal: __bootstrap.signals.Signal,
|
||||||
|
@ -131,4 +133,5 @@ __bootstrap.denoNsUnstable = {
|
||||||
symlinkSync: __bootstrap.fs.symlinkSync,
|
symlinkSync: __bootstrap.fs.symlinkSync,
|
||||||
HttpClient: __bootstrap.fetch.HttpClient,
|
HttpClient: __bootstrap.fetch.HttpClient,
|
||||||
createHttpClient: __bootstrap.fetch.createHttpClient,
|
createHttpClient: __bootstrap.fetch.createHttpClient,
|
||||||
};
|
};
|
||||||
|
})(this);
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
// This is a specialised implementation of a System module loader.
|
// This is a specialised implementation of a System module loader.
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
/* eslint-disable */
|
|
||||||
let System, __instantiate;
|
let System, __instantiate;
|
||||||
(() => {
|
(() => {
|
||||||
const r = new Map();
|
const r = new Map();
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
// This is a specialised implementation of a System module loader.
|
// This is a specialised implementation of a System module loader.
|
||||||
|
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// @ts-nocheck
|
// @ts-nocheck
|
||||||
/* eslint-disable */
|
|
||||||
var System, __instantiate;
|
var System, __instantiate;
|
||||||
(function () {
|
(function () {
|
||||||
// deno-fmt-ignore
|
// deno-fmt-ignore
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// deno-lint-ignore-file
|
||||||
// There was a bug where if this was executed with --reload it would throw a
|
// There was a bug where if this was executed with --reload it would throw a
|
||||||
// type error.
|
// type error.
|
||||||
window.test = null;
|
window.test = null;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// @ts-expect-error
|
// @ts-expect-error "Deno.core" is not a public interface
|
||||||
Deno.core.evalContext(
|
Deno.core.evalContext(
|
||||||
"(async () => console.log(await import('./subdir/mod4.js')))()",
|
"(async () => console.log(await import('./subdir/mod4.js')))()",
|
||||||
);
|
);
|
||||||
|
|
|
@ -11,10 +11,10 @@ import { loaded as loadedJsx3 } from "http://localhost:4545/cli/tests/subdir/mt_
|
||||||
import { loaded as loadedJsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx";
|
import { loaded as loadedJsx4 } from "http://localhost:4545/cli/tests/subdir/mt_application_x_javascript_jsx.j4.jsx";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// deno-lint-ignore no-namespace
|
||||||
namespace JSX {
|
namespace JSX {
|
||||||
interface IntrinsicElements {
|
interface IntrinsicElements {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
[elemName: string]: any;
|
[elemName: string]: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
export namespace NS {
|
export namespace NS {
|
||||||
export function test(name: string, fn: Function): void;
|
export function test(name: string, fn: Function): void;
|
||||||
export function test(options: object): void;
|
export function test(options: object): void;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
export interface D {
|
export interface D {
|
||||||
resolve: any;
|
resolve: any;
|
||||||
reject: any;
|
reject: any;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||||
const name = Deno.args[0];
|
const name = Deno.args[0];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
||||||
read(files: string[]): void {
|
read(files: string[]): void {
|
||||||
files.forEach((file) => Deno.readFileSync(file));
|
files.forEach((file) => Deno.readFileSync(file));
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
function b() {
|
function b() {
|
||||||
return function (
|
return function (
|
||||||
_target: any,
|
_target: any,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
let x = {
|
let x = {
|
||||||
a: {
|
a: {
|
||||||
b: {
|
b: {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
export function retb() {
|
export function retb() {
|
||||||
return "b";
|
return "b";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
const { args } = Deno;
|
const { args } = Deno;
|
||||||
import { createHash, SupportedAlgorithm } from "../../std/hash/mod.ts";
|
import { createHash, SupportedAlgorithm } from "../../std/hash/mod.ts";
|
||||||
|
@ -6,6 +6,7 @@ import { Md5 } from "../../std/hash/md5.ts";
|
||||||
import { Sha1 } from "../../std/hash/sha1.ts";
|
import { Sha1 } from "../../std/hash/sha1.ts";
|
||||||
import { Sha256 } from "../../std/hash/sha256.ts";
|
import { Sha256 } from "../../std/hash/sha256.ts";
|
||||||
import { Sha512 } from "../../std/hash/sha512.ts";
|
import { Sha512 } from "../../std/hash/sha512.ts";
|
||||||
|
// deno-lint-ignore camelcase
|
||||||
import { Sha3_224, Sha3_256, Sha3_384, Sha3_512 } from "../../std/hash/sha3.ts";
|
import { Sha3_224, Sha3_256, Sha3_384, Sha3_512 } from "../../std/hash/sha3.ts";
|
||||||
|
|
||||||
if (args.length < 3) Deno.exit(0);
|
if (args.length < 3) Deno.exit(0);
|
||||||
|
@ -14,6 +15,7 @@ const method = args[0];
|
||||||
const alg = args[1];
|
const alg = args[1];
|
||||||
const inputFile = args[2];
|
const inputFile = args[2];
|
||||||
|
|
||||||
|
// deno-lint-ignore no-explicit-any
|
||||||
function getJsHash(alg: string): any {
|
function getJsHash(alg: string): any {
|
||||||
switch (alg) {
|
switch (alg) {
|
||||||
case "md5":
|
case "md5":
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
// deno-lint-ignore-file
|
||||||
require("invalid module specifier");
|
require("invalid module specifier");
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// deno-lint-ignore-file
|
||||||
for (let i = 0; i < 128; i++) {
|
for (let i = 0; i < 128; i++) {
|
||||||
console.log(i);
|
console.log(i);
|
||||||
debugger;
|
debugger;
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
try {
|
try {
|
||||||
Deno.removeSync("./lock_write_fetch.json");
|
Deno.removeSync("./lock_write_fetch.json");
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
|
||||||
const fetchProc = Deno.run({
|
const fetchProc = Deno.run({
|
||||||
stdout: "null",
|
stdout: "null",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
function a() {
|
function a() {
|
||||||
console.log("a(): evaluated");
|
console.log("a(): evaluated");
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||||
const name = Deno.args[0];
|
const name = Deno.args[0];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
const test: { [key: string]: (...args: any[]) => void | Promise<void> } = {
|
||||||
readRequired(): Promise<void> {
|
readRequired(): Promise<void> {
|
||||||
Deno.readFileSync("README.md");
|
Deno.readFileSync("README.md");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
function a() {
|
function a() {
|
||||||
console.log("a(): evaluated");
|
console.log("a(): evaluated");
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
export function boo() {
|
export function boo() {
|
||||||
console.log("Boo!");
|
console.log("Boo!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import order from "./order.js";
|
import order from "./order.js";
|
||||||
|
|
||||||
const end = Date.now() + 500;
|
const end = Date.now() + 500;
|
||||||
while (end < Date.now()) {}
|
while (end < Date.now()) {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
|
|
||||||
order.push("d");
|
order.push("d");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
function Decorate() {
|
function Decorate() {
|
||||||
return function (constructor: any): any {
|
return function (constructor: any): any {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
import { B } from "./subdir/more_decorators.ts";
|
import { B } from "./subdir/more_decorators.ts";
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
type Foo = import("./ts_type_imports_foo.ts").Foo;
|
type Foo = import("./ts_type_imports_foo.ts").Foo;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
/* eslint-disable */
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
const foo = { delete<S>() {} };
|
const foo = { delete<S>() {} };
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// deno-lint-ignore-file
|
||||||
/// <reference no-default-lib="true"/>
|
/// <reference no-default-lib="true"/>
|
||||||
/// <reference lib="dom" />
|
/// <reference lib="dom" />
|
||||||
/// <reference lib="deno.ns" />
|
/// <reference lib="deno.ns" />
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// deno-lint-ignore-file
|
||||||
|
|
||||||
// @deno-types="./type_definitions/foo.d.ts"
|
// @deno-types="./type_definitions/foo.d.ts"
|
||||||
import { foo } from "./type_definitions/foo.js";
|
import { foo } from "./type_definitions/foo.js";
|
||||||
// @deno-types="./type_definitions/fizz.d.ts"
|
// @deno-types="./type_definitions/fizz.d.ts"
|
||||||
|
|
|
@ -46,7 +46,7 @@ unitTest(function blobShouldNotThrowError(): void {
|
||||||
let hasThrown = false;
|
let hasThrown = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const options1: any = {
|
const options1: any = {
|
||||||
ending: "utf8",
|
ending: "utf8",
|
||||||
hasOwnProperty: "hasOwnProperty",
|
hasOwnProperty: "hasOwnProperty",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { assert, assertEquals, unitTest } from "./test_util.ts";
|
import { assert, assertEquals, unitTest } from "./test_util.ts";
|
||||||
|
|
||||||
// just a hack to get a body object
|
// just a hack to get a body object
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function buildBody(body: any, headers?: Headers): Body {
|
function buildBody(body: any, headers?: Headers): Body {
|
||||||
const stub = new Request("http://foo/", {
|
const stub = new Request("http://foo/", {
|
||||||
body: body,
|
body: body,
|
||||||
|
|
|
@ -184,7 +184,6 @@ unitTest(function consoleTestStringifyLongStrings(): void {
|
||||||
assertEquals(actual, veryLongString);
|
assertEquals(actual, veryLongString);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
||||||
unitTest(function consoleTestStringifyCircular(): void {
|
unitTest(function consoleTestStringifyCircular(): void {
|
||||||
class Base {
|
class Base {
|
||||||
a = 1;
|
a = 1;
|
||||||
|
@ -196,7 +195,7 @@ unitTest(function consoleTestStringifyCircular(): void {
|
||||||
m2() {}
|
m2() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const nestedObj: any = {
|
const nestedObj: any = {
|
||||||
num: 1,
|
num: 1,
|
||||||
bool: true,
|
bool: true,
|
||||||
|
@ -345,7 +344,6 @@ unitTest(function consoleTestStringifyCircular(): void {
|
||||||
// test inspect is working the same
|
// test inspect is working the same
|
||||||
assertEquals(stripColor(Deno.inspect(nestedObj)), nestedObjExpected);
|
assertEquals(stripColor(Deno.inspect(nestedObj)), nestedObjExpected);
|
||||||
});
|
});
|
||||||
/* eslint-enable @typescript-eslint/explicit-function-return-type */
|
|
||||||
|
|
||||||
unitTest(function consoleTestStringifyFunctionWithPrototypeRemoved(): void {
|
unitTest(function consoleTestStringifyFunctionWithPrototypeRemoved(): void {
|
||||||
const f = function f() {};
|
const f = function f() {};
|
||||||
|
@ -363,7 +361,7 @@ unitTest(function consoleTestStringifyFunctionWithPrototypeRemoved(): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
unitTest(function consoleTestStringifyWithDepth(): void {
|
unitTest(function consoleTestStringifyWithDepth(): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } };
|
const nestedObj: any = { a: { b: { c: { d: { e: { f: 42 } } } } } };
|
||||||
assertEquals(
|
assertEquals(
|
||||||
stripColor(inspectArgs([nestedObj], { depth: 3 })),
|
stripColor(inspectArgs([nestedObj], { depth: 3 })),
|
||||||
|
@ -1144,7 +1142,7 @@ class StringBuffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ConsoleExamineFunc = (
|
type ConsoleExamineFunc = (
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
csl: any,
|
csl: any,
|
||||||
out: StringBuffer,
|
out: StringBuffer,
|
||||||
err?: StringBuffer,
|
err?: StringBuffer,
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { assertMatch, assertStrictEquals, unitTest } from "./test_util.ts";
|
import { assertMatch, assertStrictEquals, unitTest } from "./test_util.ts";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// deno-lint-ignore no-namespace
|
||||||
namespace Deno {
|
namespace Deno {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
var core: any; // eslint-disable-line no-var
|
var core: any; // eslint-disable-line no-var
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,9 @@ unitTest(async function sendAsyncStackTrace(): Promise<void> {
|
||||||
});
|
});
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// deno-lint-ignore no-namespace
|
||||||
namespace Deno {
|
namespace Deno {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
var core: any; // eslint-disable-line no-var
|
var core: any; // eslint-disable-line no-var
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ unitTest(function testDomIterableScope(): void {
|
||||||
|
|
||||||
const domIterable = new DomIterable([["foo", 1]]);
|
const domIterable = new DomIterable([["foo", 1]]);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function checkScope(thisArg: any, expected: any): void {
|
function checkScope(thisArg: any, expected: any): void {
|
||||||
function callback(this: typeof thisArg): void {
|
function callback(this: typeof thisArg): void {
|
||||||
assertEquals(this, expected);
|
assertEquals(this, expected);
|
||||||
|
|
|
@ -7,7 +7,7 @@ const { setPrepareStackTrace } = Deno[Deno.internal];
|
||||||
interface CallSite {
|
interface CallSite {
|
||||||
getThis(): unknown;
|
getThis(): unknown;
|
||||||
getTypeName(): string | null;
|
getTypeName(): string | null;
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// deno-lint-ignore ban-types
|
||||||
getFunction(): Function | null;
|
getFunction(): Function | null;
|
||||||
getFunctionName(): string | null;
|
getFunctionName(): string | null;
|
||||||
getMethodName(): string | null;
|
getMethodName(): string | null;
|
||||||
|
@ -36,7 +36,7 @@ function getMockCallSite(
|
||||||
getTypeName(): string {
|
getTypeName(): string {
|
||||||
return "";
|
return "";
|
||||||
},
|
},
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-types
|
// deno-lint-ignore ban-types
|
||||||
getFunction(): Function {
|
getFunction(): Function {
|
||||||
return (): void => {};
|
return (): void => {};
|
||||||
},
|
},
|
||||||
|
@ -125,7 +125,7 @@ unitTest(function errorStackMessageLine(): void {
|
||||||
// FIXME(bartlomieju): no longer works after migrating
|
// FIXME(bartlomieju): no longer works after migrating
|
||||||
// to JavaScript runtime code
|
// to JavaScript runtime code
|
||||||
unitTest({ ignore: true }, function prepareStackTrace(): void {
|
unitTest({ ignore: true }, function prepareStackTrace(): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const MockError = {} as any;
|
const MockError = {} as any;
|
||||||
setPrepareStackTrace(MockError);
|
setPrepareStackTrace(MockError);
|
||||||
assert(typeof MockError.prepareStackTrace === "function");
|
assert(typeof MockError.prepareStackTrace === "function");
|
||||||
|
|
|
@ -68,7 +68,7 @@ unitTest(function eventPreventDefaultSuccess(): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
unitTest(function eventInitializedWithNonStringType(): void {
|
unitTest(function eventInitializedWithNonStringType(): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const type: any = undefined;
|
const type: any = undefined;
|
||||||
const event = new Event(type);
|
const event = new Event(type);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ unitTest(function eventIsTrusted(): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
unitTest(function eventInspectOutput(): void {
|
unitTest(function eventInspectOutput(): void {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const cases: Array<[any, (event: any) => string]> = [
|
const cases: Array<[any, (event: any) => string]> = [
|
||||||
[
|
[
|
||||||
new Event("test"),
|
new Event("test"),
|
||||||
|
|
|
@ -84,7 +84,7 @@ unitTest({ perms: { net: true } }, async function fetchBodyUsed(): Promise<
|
||||||
const response = await fetch("http://localhost:4545/cli/tests/fixture.json");
|
const response = await fetch("http://localhost:4545/cli/tests/fixture.json");
|
||||||
assertEquals(response.bodyUsed, false);
|
assertEquals(response.bodyUsed, false);
|
||||||
assertThrows((): void => {
|
assertThrows((): void => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(response as any).bodyUsed = true;
|
(response as any).bodyUsed = true;
|
||||||
});
|
});
|
||||||
await response.blob();
|
await response.blob();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
import { assert, assertEquals, unitTest } from "./test_util.ts";
|
import { assert, assertEquals, unitTest } from "./test_util.ts";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function testFirstArgument(arg1: any[], expectedSize: number): void {
|
function testFirstArgument(arg1: any[], expectedSize: number): void {
|
||||||
const file = new File(arg1, "name");
|
const file = new File(arg1, "name");
|
||||||
assert(file instanceof File);
|
assert(file instanceof File);
|
||||||
|
@ -77,7 +77,7 @@ unitTest(function fileObjectInFileBits(): void {
|
||||||
testFirstArgument([{}], 15);
|
testFirstArgument([{}], 15);
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function testSecondArgument(arg2: any, expectedFileName: string): void {
|
function testSecondArgument(arg2: any, expectedFileName: string): void {
|
||||||
const file = new File(["bits"], arg2);
|
const file = new File(["bits"], arg2);
|
||||||
assert(file instanceof File);
|
assert(file instanceof File);
|
||||||
|
|
|
@ -319,7 +319,7 @@ unitTest(
|
||||||
// writing null should throw an error
|
// writing null should throw an error
|
||||||
await assertThrowsAsync(
|
await assertThrowsAsync(
|
||||||
async (): Promise<void> => {
|
async (): Promise<void> => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await file.write(null as any);
|
await file.write(null as any);
|
||||||
},
|
},
|
||||||
); // TODO: Check error kind when dispatch_minimal pipes errors properly
|
); // TODO: Check error kind when dispatch_minimal pipes errors properly
|
||||||
|
@ -346,7 +346,7 @@ unitTest(
|
||||||
|
|
||||||
// reading file into null buffer should throw an error
|
// reading file into null buffer should throw an error
|
||||||
await assertThrowsAsync(async () => {
|
await assertThrowsAsync(async () => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await file.read(null as any);
|
await file.read(null as any);
|
||||||
}, TypeError);
|
}, TypeError);
|
||||||
// TODO: Check error kind when dispatch_minimal pipes errors properly
|
// TODO: Check error kind when dispatch_minimal pipes errors properly
|
||||||
|
|
|
@ -41,9 +41,9 @@ unitTest(function formDataParamsGetSuccess(): void {
|
||||||
formData.append("a", "true");
|
formData.append("a", "true");
|
||||||
formData.append("b", "false");
|
formData.append("b", "false");
|
||||||
formData.append("a", "null");
|
formData.append("a", "null");
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
formData.append("d", undefined as any);
|
formData.append("d", undefined as any);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
formData.append("e", null as any);
|
formData.append("e", null as any);
|
||||||
assertEquals(formData.get("a"), "true");
|
assertEquals(formData.get("a"), "true");
|
||||||
assertEquals(formData.get("b"), "false");
|
assertEquals(formData.get("b"), "false");
|
||||||
|
@ -70,10 +70,10 @@ unitTest(function formDataParamsSetSuccess(): void {
|
||||||
assertEquals(formData.getAll("b"), ["false"]);
|
assertEquals(formData.getAll("b"), ["false"]);
|
||||||
formData.set("a", "false");
|
formData.set("a", "false");
|
||||||
assertEquals(formData.getAll("a"), ["false"]);
|
assertEquals(formData.getAll("a"), ["false"]);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
formData.set("d", undefined as any);
|
formData.set("d", undefined as any);
|
||||||
assertEquals(formData.get("d"), "undefined");
|
assertEquals(formData.get("d"), "undefined");
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
formData.set("e", null as any);
|
formData.set("e", null as any);
|
||||||
assertEquals(formData.get("e"), "null");
|
assertEquals(formData.get("e"), "null");
|
||||||
});
|
});
|
||||||
|
@ -143,7 +143,7 @@ unitTest(function formDataParamsArgumentsCheck(): void {
|
||||||
let hasThrown = 0;
|
let hasThrown = 0;
|
||||||
let errMsg = "";
|
let errMsg = "";
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(formData as any)[method]();
|
(formData as any)[method]();
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -167,7 +167,7 @@ unitTest(function formDataParamsArgumentsCheck(): void {
|
||||||
let errMsg = "";
|
let errMsg = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(formData as any)[method]();
|
(formData as any)[method]();
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -187,7 +187,7 @@ unitTest(function formDataParamsArgumentsCheck(): void {
|
||||||
hasThrown = 0;
|
hasThrown = 0;
|
||||||
errMsg = "";
|
errMsg = "";
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(formData as any)[method]("foo");
|
(formData as any)[method]("foo");
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -27,7 +27,7 @@ unitTest(function formatDiagnosticBasic() {
|
||||||
|
|
||||||
unitTest(function formatDiagnosticError() {
|
unitTest(function formatDiagnosticError() {
|
||||||
let thrown = false;
|
let thrown = false;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const bad = ([{ hello: 123 }] as any) as Deno.Diagnostic[];
|
const bad = ([{ hello: 123 }] as any) as Deno.Diagnostic[];
|
||||||
try {
|
try {
|
||||||
Deno.formatDiagnostics(bad);
|
Deno.formatDiagnostics(bad);
|
||||||
|
|
|
@ -60,7 +60,6 @@ unitTest(function webAssemblyExists(): void {
|
||||||
assert(typeof WebAssembly.compile === "function");
|
assert(typeof WebAssembly.compile === "function");
|
||||||
});
|
});
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-namespace, @typescript-eslint/no-explicit-any,no-var */
|
|
||||||
declare global {
|
declare global {
|
||||||
// deno-lint-ignore no-namespace
|
// deno-lint-ignore no-namespace
|
||||||
namespace Deno {
|
namespace Deno {
|
||||||
|
@ -68,26 +67,25 @@ declare global {
|
||||||
var core: any;
|
var core: any;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* eslint-enable */
|
|
||||||
|
|
||||||
unitTest(function DenoNamespaceImmutable(): void {
|
unitTest(function DenoNamespaceImmutable(): void {
|
||||||
const denoCopy = window.Deno;
|
const denoCopy = window.Deno;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(Deno as any) = 1;
|
(Deno as any) = 1;
|
||||||
} catch {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
assert(denoCopy === Deno);
|
assert(denoCopy === Deno);
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(window as any).Deno = 1;
|
(window as any).Deno = 1;
|
||||||
} catch {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
assert(denoCopy === Deno);
|
assert(denoCopy === Deno);
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
delete (window as any).Deno;
|
delete (window as any).Deno;
|
||||||
} catch {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
|
@ -96,14 +94,14 @@ unitTest(function DenoNamespaceImmutable(): void {
|
||||||
|
|
||||||
const { readFile } = Deno;
|
const { readFile } = Deno;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(Deno as any).readFile = 1;
|
(Deno as any).readFile = 1;
|
||||||
} catch {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
}
|
}
|
||||||
assert(readFile === Deno.readFile);
|
assert(readFile === Deno.readFile);
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
delete (window as any).Deno.readFile;
|
delete (window as any).Deno.readFile;
|
||||||
} catch {
|
} catch {
|
||||||
// pass
|
// pass
|
||||||
|
|
|
@ -22,7 +22,7 @@ unitTest(function newHeaderTest(): void {
|
||||||
new Headers(undefined);
|
new Headers(undefined);
|
||||||
new Headers({});
|
new Headers({});
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
new Headers(null as any);
|
new Headers(null as any);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
assertEquals(
|
assertEquals(
|
||||||
|
@ -36,11 +36,11 @@ const headerDict: Record<string, string> = {
|
||||||
name1: "value1",
|
name1: "value1",
|
||||||
name2: "value2",
|
name2: "value2",
|
||||||
name3: "value3",
|
name3: "value3",
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
name4: undefined as any,
|
name4: undefined as any,
|
||||||
"Content-Type": "value4",
|
"Content-Type": "value4",
|
||||||
};
|
};
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const headerSeq: any[] = [];
|
const headerSeq: any[] = [];
|
||||||
for (const name in headerDict) {
|
for (const name in headerDict) {
|
||||||
headerSeq.push([name, headerDict[name]]);
|
headerSeq.push([name, headerDict[name]]);
|
||||||
|
@ -273,7 +273,7 @@ unitTest(function headerParamsArgumentsCheck(): void {
|
||||||
let hasThrown = 0;
|
let hasThrown = 0;
|
||||||
let errMsg = "";
|
let errMsg = "";
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(headers as any)[method]();
|
(headers as any)[method]();
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -297,7 +297,7 @@ unitTest(function headerParamsArgumentsCheck(): void {
|
||||||
let errMsg = "";
|
let errMsg = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(headers as any)[method]();
|
(headers as any)[method]();
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -317,7 +317,7 @@ unitTest(function headerParamsArgumentsCheck(): void {
|
||||||
hasThrown = 0;
|
hasThrown = 0;
|
||||||
errMsg = "";
|
errMsg = "";
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(headers as any)[method]("foo");
|
(headers as any)[method]("foo");
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { assertThrows, assertThrowsAsync, unitTest } from "./test_util.ts";
|
||||||
|
|
||||||
unitTest(async function permissionInvalidName(): Promise<void> {
|
unitTest(async function permissionInvalidName(): Promise<void> {
|
||||||
await assertThrowsAsync(async () => {
|
await assertThrowsAsync(async () => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await Deno.permissions.query({ name: "foo" as any });
|
await Deno.permissions.query({ name: "foo" as any });
|
||||||
}, Error);
|
}, Error);
|
||||||
});
|
});
|
||||||
|
|
|
@ -10,7 +10,7 @@ unitTest(function fromInit(): void {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertEquals("ahoyhoy", (req as any)._bodySource);
|
assertEquals("ahoyhoy", (req as any)._bodySource);
|
||||||
assertEquals(req.url, "http://foo/");
|
assertEquals(req.url, "http://foo/");
|
||||||
assertEquals(req.headers.get("test-header"), "value");
|
assertEquals(req.headers.get("test-header"), "value");
|
||||||
|
@ -18,13 +18,13 @@ unitTest(function fromInit(): void {
|
||||||
|
|
||||||
unitTest(function fromRequest(): void {
|
unitTest(function fromRequest(): void {
|
||||||
const r = new Request("http://foo/");
|
const r = new Request("http://foo/");
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(r as any)._bodySource = "ahoyhoy";
|
(r as any)._bodySource = "ahoyhoy";
|
||||||
r.headers.set("test-header", "value");
|
r.headers.set("test-header", "value");
|
||||||
|
|
||||||
const req = new Request(r);
|
const req = new Request(r);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertEquals((req as any)._bodySource, (r as any)._bodySource);
|
assertEquals((req as any)._bodySource, (r as any)._bodySource);
|
||||||
assertEquals(req.url, r.url);
|
assertEquals(req.url, r.url);
|
||||||
assertEquals(req.headers.get("test-header"), r.headers.get("test-header"));
|
assertEquals(req.headers.get("test-header"), r.headers.get("test-header"));
|
||||||
|
@ -64,6 +64,6 @@ unitTest(async function cloneRequestBodyStream(): Promise<void> {
|
||||||
|
|
||||||
assertEquals(b1, b2);
|
assertEquals(b1, b2);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assert((r1 as any)._bodySource !== (r2 as any)._bodySource);
|
assert((r1 as any)._bodySource !== (r2 as any)._bodySource);
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import { assertThrows, unitTest } from "./test_util.ts";
|
import { assertThrows, unitTest } from "./test_util.ts";
|
||||||
|
|
||||||
unitTest(function streamReadableHwmError() {
|
unitTest(function streamReadableHwmError() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
||||||
for (const highWaterMark of invalidHwm) {
|
for (const highWaterMark of invalidHwm) {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
@ -17,14 +17,14 @@ unitTest(function streamReadableHwmError() {
|
||||||
assertThrows(() => {
|
assertThrows(() => {
|
||||||
new ReadableStream<number>(
|
new ReadableStream<number>(
|
||||||
undefined,
|
undefined,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
{ highWaterMark: Symbol("hwk") as any },
|
{ highWaterMark: Symbol("hwk") as any },
|
||||||
);
|
);
|
||||||
}, TypeError);
|
}, TypeError);
|
||||||
});
|
});
|
||||||
|
|
||||||
unitTest(function streamWriteableHwmError() {
|
unitTest(function streamWriteableHwmError() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
||||||
for (const highWaterMark of invalidHwm) {
|
for (const highWaterMark of invalidHwm) {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
@ -42,14 +42,14 @@ unitTest(function streamWriteableHwmError() {
|
||||||
assertThrows(() => {
|
assertThrows(() => {
|
||||||
new WritableStream(
|
new WritableStream(
|
||||||
undefined,
|
undefined,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
new CountQueuingStrategy({ highWaterMark: Symbol("hwmk") as any }),
|
new CountQueuingStrategy({ highWaterMark: Symbol("hwmk") as any }),
|
||||||
);
|
);
|
||||||
}, TypeError);
|
}, TypeError);
|
||||||
});
|
});
|
||||||
|
|
||||||
unitTest(function streamTransformHwmError() {
|
unitTest(function streamTransformHwmError() {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
const invalidHwm: any[] = [NaN, Number("NaN"), {}, -1, "two"];
|
||||||
for (const highWaterMark of invalidHwm) {
|
for (const highWaterMark of invalidHwm) {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
|
@ -65,7 +65,7 @@ unitTest(function streamTransformHwmError() {
|
||||||
new TransformStream(
|
new TransformStream(
|
||||||
undefined,
|
undefined,
|
||||||
undefined,
|
undefined,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
{ highWaterMark: Symbol("hwmk") as any },
|
{ highWaterMark: Symbol("hwmk") as any },
|
||||||
);
|
);
|
||||||
}, TypeError);
|
}, TypeError);
|
||||||
|
|
|
@ -506,7 +506,7 @@ unitTest(async function transformStreamStartCalledOnce() {
|
||||||
|
|
||||||
unitTest(function transformStreamReadableTypeThrows() {
|
unitTest(function transformStreamReadableTypeThrows() {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
() => new TransformStream({ readableType: "bytes" as any }),
|
() => new TransformStream({ readableType: "bytes" as any }),
|
||||||
RangeError,
|
RangeError,
|
||||||
undefined,
|
undefined,
|
||||||
|
@ -516,7 +516,7 @@ unitTest(function transformStreamReadableTypeThrows() {
|
||||||
|
|
||||||
unitTest(function transformStreamWirtableTypeThrows() {
|
unitTest(function transformStreamWirtableTypeThrows() {
|
||||||
assertThrows(
|
assertThrows(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
() => new TransformStream({ writableType: "bytes" as any }),
|
() => new TransformStream({ writableType: "bytes" as any }),
|
||||||
RangeError,
|
RangeError,
|
||||||
undefined,
|
undefined,
|
||||||
|
|
|
@ -189,7 +189,7 @@ export function unitTest(
|
||||||
|
|
||||||
export interface ResolvableMethods<T> {
|
export interface ResolvableMethods<T> {
|
||||||
resolve: (value?: T | PromiseLike<T>) => void;
|
resolve: (value?: T | PromiseLike<T>) => void;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
reject: (reason?: any) => void;
|
reject: (reason?: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ export function createResolvable<T>(): Resolvable<T> {
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
||||||
// Replace functions with null, errors with their stack strings, and JSONify.
|
// Replace functions with null, errors with their stack strings, and JSONify.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function serializeTestMessage(message: any): string {
|
function serializeTestMessage(message: any): string {
|
||||||
return JSON.stringify({
|
return JSON.stringify({
|
||||||
start: message.start && {
|
start: message.start && {
|
||||||
|
@ -225,7 +225,7 @@ function serializeTestMessage(message: any): string {
|
||||||
},
|
},
|
||||||
end: message.end && {
|
end: message.end && {
|
||||||
...message.end,
|
...message.end,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
results: message.end.results.map((result: any) => ({
|
results: message.end.results.map((result: any) => ({
|
||||||
...result,
|
...result,
|
||||||
error: result.error?.stack,
|
error: result.error?.stack,
|
||||||
|
@ -236,7 +236,7 @@ function serializeTestMessage(message: any): string {
|
||||||
|
|
||||||
export async function reportToConn(
|
export async function reportToConn(
|
||||||
conn: Deno.Conn,
|
conn: Deno.Conn,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
message: any,
|
message: any,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const line = serializeTestMessage(message);
|
const line = serializeTestMessage(message);
|
||||||
|
|
|
@ -15,15 +15,15 @@ import {
|
||||||
|
|
||||||
// @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
|
// @ts-expect-error TypeScript (as of 3.7) does not support indexing namespaces by symbol
|
||||||
const internalObj = Deno[Deno.internal];
|
const internalObj = Deno[Deno.internal];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const reportToConsole = internalObj.reportToConsole as (message: any) => void;
|
const reportToConsole = internalObj.reportToConsole as (message: any) => void;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const runTests = internalObj.runTests as (options: any) => Promise<any>;
|
const runTests = internalObj.runTests as (options: any) => Promise<any>;
|
||||||
|
|
||||||
interface PermissionSetTestResult {
|
interface PermissionSetTestResult {
|
||||||
perms: Permissions;
|
perms: Permissions;
|
||||||
passed: boolean;
|
passed: boolean;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
endMessage: any;
|
endMessage: any;
|
||||||
permsStr: string;
|
permsStr: string;
|
||||||
}
|
}
|
||||||
|
@ -135,12 +135,12 @@ async function runTestsForPermissionSet(
|
||||||
const conn = await listener.accept();
|
const conn = await listener.accept();
|
||||||
|
|
||||||
let expectedPassedTests;
|
let expectedPassedTests;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
let endMessage: any;
|
let endMessage: any;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
for await (const line of readLines(conn)) {
|
for await (const line of readLines(conn)) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const message = JSON.parse(line) as any;
|
const message = JSON.parse(line) as any;
|
||||||
reportToConsole(message);
|
reportToConsole(message);
|
||||||
if (message.start != null) {
|
if (message.start != null) {
|
||||||
|
|
|
@ -102,7 +102,7 @@ unitTest(function urlSearchParamsInitRecord(): void {
|
||||||
unitTest(function urlSearchParamsInit(): void {
|
unitTest(function urlSearchParamsInit(): void {
|
||||||
const params1 = new URLSearchParams("a=b");
|
const params1 = new URLSearchParams("a=b");
|
||||||
assertEquals(params1.toString(), "a=b");
|
assertEquals(params1.toString(), "a=b");
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const params2 = new URLSearchParams(params1 as any);
|
const params2 = new URLSearchParams(params1 as any);
|
||||||
assertEquals(params2.toString(), "a=b");
|
assertEquals(params2.toString(), "a=b");
|
||||||
});
|
});
|
||||||
|
@ -257,7 +257,7 @@ unitTest(function urlSearchParamsAppendArgumentsCheck(): void {
|
||||||
const searchParams = new URLSearchParams();
|
const searchParams = new URLSearchParams();
|
||||||
let hasThrown = 0;
|
let hasThrown = 0;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(searchParams as any)[method]();
|
(searchParams as any)[method]();
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -274,7 +274,7 @@ unitTest(function urlSearchParamsAppendArgumentsCheck(): void {
|
||||||
const searchParams = new URLSearchParams();
|
const searchParams = new URLSearchParams();
|
||||||
let hasThrown = 0;
|
let hasThrown = 0;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(searchParams as any)[method]("foo");
|
(searchParams as any)[method]("foo");
|
||||||
hasThrown = 1;
|
hasThrown = 1;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -315,7 +315,7 @@ unitTest(function urlSearchParamsCustomSymbolIterator(): void {
|
||||||
unitTest(
|
unitTest(
|
||||||
function urlSearchParamsCustomSymbolIteratorWithNonStringParams(): void {
|
function urlSearchParamsCustomSymbolIteratorWithNonStringParams(): void {
|
||||||
const params = {};
|
const params = {};
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(params as any)[Symbol.iterator] = function* (): IterableIterator<
|
(params as any)[Symbol.iterator] = function* (): IterableIterator<
|
||||||
[number, number]
|
[number, number]
|
||||||
> {
|
> {
|
||||||
|
|
|
@ -7,7 +7,7 @@ const cmdsPerWorker = 400;
|
||||||
|
|
||||||
export interface ResolvableMethods<T> {
|
export interface ResolvableMethods<T> {
|
||||||
resolve: (value?: T | PromiseLike<T>) => void;
|
resolve: (value?: T | PromiseLike<T>) => void;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
reject: (reason?: any) => void;
|
reject: (reason?: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ import { assert, assertEquals } from "../../std/testing/asserts.ts";
|
||||||
|
|
||||||
export interface ResolvableMethods<T> {
|
export interface ResolvableMethods<T> {
|
||||||
resolve: (value?: T | PromiseLike<T>) => void;
|
resolve: (value?: T | PromiseLike<T>) => void;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
reject: (reason?: any) => void;
|
reject: (reason?: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ Deno.test({
|
||||||
{ type: "module" },
|
{ type: "module" },
|
||||||
);
|
);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
throwingWorker.onerror = (e: any): void => {
|
throwingWorker.onerror = (e: any): void => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
assert(/Uncaught Error: Thrown error/.test(e.message));
|
assert(/Uncaught Error: Thrown error/.test(e.message));
|
||||||
|
@ -133,7 +133,7 @@ Deno.test({
|
||||||
{ type: "module" },
|
{ type: "module" },
|
||||||
);
|
);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
fetchingWorker.onerror = (e: any): void => {
|
fetchingWorker.onerror = (e: any): void => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
promise.reject(e.message);
|
promise.reject(e.message);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
|
// deno-lint-ignore-file no-undef
|
||||||
|
|
||||||
// This module is the entry point for "compiler" isolate, ie. the one
|
// This module is the entry point for "compiler" isolate, ie. the one
|
||||||
// that is created when Deno needs to type check TypeScript, and in some
|
// that is created when Deno needs to type check TypeScript, and in some
|
||||||
// instances convert TypeScript to JavaScript.
|
// instances convert TypeScript to JavaScript.
|
||||||
|
@ -234,7 +236,7 @@ delete Object.prototype.__proto__;
|
||||||
specifiers,
|
specifiers,
|
||||||
base,
|
base,
|
||||||
});
|
});
|
||||||
let r = resolved.map(([resolvedFileName, extension]) => ({
|
const r = resolved.map(([resolvedFileName, extension]) => ({
|
||||||
resolvedFileName,
|
resolvedFileName,
|
||||||
extension,
|
extension,
|
||||||
isExternalLibraryImport: false,
|
isExternalLibraryImport: false,
|
||||||
|
@ -357,7 +359,7 @@ delete Object.prototype.__proto__;
|
||||||
/** @type {{ buildSpecifier: string; libs: string[] }} */
|
/** @type {{ buildSpecifier: string; libs: string[] }} */
|
||||||
const { buildSpecifier, libs } = core.jsonOpSync("op_build_info", {});
|
const { buildSpecifier, libs } = core.jsonOpSync("op_build_info", {});
|
||||||
for (const lib of libs) {
|
for (const lib of libs) {
|
||||||
let specifier = `lib.${lib}.d.ts`;
|
const specifier = `lib.${lib}.d.ts`;
|
||||||
// we are using internal APIs here to "inject" our custom libraries into
|
// we are using internal APIs here to "inject" our custom libraries into
|
||||||
// tsc, so things like `"lib": [ "deno.ns" ]` are supported.
|
// tsc, so things like `"lib": [ "deno.ns" ]` are supported.
|
||||||
if (!ts.libs.includes(lib)) {
|
if (!ts.libs.includes(lib)) {
|
||||||
|
|
|
@ -16,8 +16,6 @@ SharedQueue Binary Layout
|
||||||
+---------------------------------------------------------------+
|
+---------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
||||||
|
|
||||||
((window) => {
|
((window) => {
|
||||||
const MAX_RECORDS = 100;
|
const MAX_RECORDS = 100;
|
||||||
const INDEX_NUM_RECORDS = 0;
|
const INDEX_NUM_RECORDS = 0;
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
function assert(cond) {
|
||||||
|
if (!cond) {
|
||||||
|
throw Error("assert");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function assertArrayEquals(a1, a2) {
|
function assertArrayEquals(a1, a2) {
|
||||||
if (a1.length !== a2.length) throw Error("assert");
|
if (a1.length !== a2.length) throw Error("assert");
|
||||||
|
|
|
@ -295,7 +295,7 @@ let x: any;
|
||||||
Should rather be:
|
Should rather be:
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
let x: any;
|
let x: any;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ it's required to specify the ignored rule name:
|
||||||
// eslint-disable-next-line no-empty
|
// eslint-disable-next-line no-empty
|
||||||
while (true) {}
|
while (true) {}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function bar(a: any) {
|
function bar(a: any) {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,23 @@
|
||||||
// comments which point to steps of the specification that are not implemented.
|
// comments which point to steps of the specification that are not implemented.
|
||||||
|
|
||||||
((window) => {
|
((window) => {
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any,require-await */
|
|
||||||
|
|
||||||
const customInspect = Symbol.for("Deno.customInspect");
|
const customInspect = Symbol.for("Deno.customInspect");
|
||||||
|
|
||||||
|
function cloneArrayBuffer(
|
||||||
|
srcBuffer,
|
||||||
|
srcByteOffset,
|
||||||
|
srcLength,
|
||||||
|
_cloneConstructor,
|
||||||
|
) {
|
||||||
|
// this function fudges the return type but SharedArrayBuffer is disabled for a while anyway
|
||||||
|
return srcBuffer.slice(
|
||||||
|
srcByteOffset,
|
||||||
|
srcByteOffset + srcLength,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const objectCloneMemo = new WeakMap();
|
||||||
|
|
||||||
/** Clone a value in a similar way to structured cloning. It is similar to a
|
/** Clone a value in a similar way to structured cloning. It is similar to a
|
||||||
* StructureDeserialize(StructuredSerialize(...)). */
|
* StructureDeserialize(StructuredSerialize(...)). */
|
||||||
function cloneValue(value) {
|
function cloneValue(value) {
|
||||||
|
@ -88,6 +101,7 @@
|
||||||
}
|
}
|
||||||
case "symbol":
|
case "symbol":
|
||||||
case "function":
|
case "function":
|
||||||
|
// fallthrough
|
||||||
default:
|
default:
|
||||||
throw new DOMException("Uncloneable value in stream", "DataCloneError");
|
throw new DOMException("Uncloneable value in stream", "DataCloneError");
|
||||||
}
|
}
|
||||||
|
@ -2151,10 +2165,10 @@
|
||||||
let canceled2 = false;
|
let canceled2 = false;
|
||||||
let reason1 = undefined;
|
let reason1 = undefined;
|
||||||
let reason2 = undefined;
|
let reason2 = undefined;
|
||||||
/* eslint-disable prefer-const */
|
// deno-lint-ignore prefer-const
|
||||||
let branch1;
|
let branch1;
|
||||||
|
// deno-lint-ignore prefer-const
|
||||||
let branch2;
|
let branch2;
|
||||||
/* eslint-enable prefer-const */
|
|
||||||
const cancelPromise = getDeferred();
|
const cancelPromise = getDeferred();
|
||||||
const pullAlgorithm = () => {
|
const pullAlgorithm = () => {
|
||||||
if (reading) {
|
if (reading) {
|
||||||
|
@ -3365,7 +3379,6 @@
|
||||||
}
|
}
|
||||||
stream[sym.backpressure] = backpressure;
|
stream[sym.backpressure] = backpressure;
|
||||||
}
|
}
|
||||||
/* eslint-enable */
|
|
||||||
|
|
||||||
class CountQueuingStrategy {
|
class CountQueuingStrategy {
|
||||||
constructor({ highWaterMark }) {
|
constructor({ highWaterMark }) {
|
||||||
|
|
|
@ -166,6 +166,7 @@
|
||||||
if (typeof str !== "string") {
|
if (typeof str !== "string") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// deno-lint-ignore no-control-regex
|
||||||
return /^[\x00-\x7F]*$/.test(str);
|
return /^[\x00-\x7F]*$/.test(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1349,7 +1350,8 @@
|
||||||
});
|
});
|
||||||
return new Response(null, responseInit);
|
return new Response(null, responseInit);
|
||||||
case "follow":
|
case "follow":
|
||||||
default:
|
// fallthrough
|
||||||
|
default: {
|
||||||
let redirectUrl = response.headers.get("Location");
|
let redirectUrl = response.headers.get("Location");
|
||||||
if (redirectUrl == null) {
|
if (redirectUrl == null) {
|
||||||
return response; // Unspecified
|
return response; // Unspecified
|
||||||
|
@ -1364,6 +1366,7 @@
|
||||||
redirected = true;
|
redirected = true;
|
||||||
remRedirectCount--;
|
remRedirectCount--;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
10
op_crates/fetch/lib.deno_fetch.d.ts
vendored
10
op_crates/fetch/lib.deno_fetch.d.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, no-var */
|
// deno-lint-ignore-file no-explicit-any
|
||||||
|
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="esnext" />
|
/// <reference lib="esnext" />
|
||||||
|
@ -101,7 +101,7 @@ interface QueuingStrategy<T = any> {
|
||||||
size?: QueuingStrategySizeCallback<T>;
|
size?: QueuingStrategySizeCallback<T>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This Streams API interface provides a built-in byte length queuing strategy
|
/** This Streams API interface provides a built-in byte length queuing strategy
|
||||||
* that can be used when constructing streams. */
|
* that can be used when constructing streams. */
|
||||||
declare class CountQueuingStrategy implements QueuingStrategy {
|
declare class CountQueuingStrategy implements QueuingStrategy {
|
||||||
constructor(options: { highWaterMark: number });
|
constructor(options: { highWaterMark: number });
|
||||||
|
@ -182,7 +182,7 @@ interface UnderlyingSink<W = any> {
|
||||||
write?: WritableStreamDefaultControllerWriteCallback<W>;
|
write?: WritableStreamDefaultControllerWriteCallback<W>;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This Streams API interface provides a standard abstraction for writing
|
/** This Streams API interface provides a standard abstraction for writing
|
||||||
* streaming data to a destination, known as a sink. This object comes with
|
* streaming data to a destination, known as a sink. This object comes with
|
||||||
* built-in backpressure and queuing. */
|
* built-in backpressure and queuing. */
|
||||||
declare class WritableStream<W = any> {
|
declare class WritableStream<W = any> {
|
||||||
|
@ -351,8 +351,8 @@ type HeadersInit = Headers | string[][] | Record<string, string>;
|
||||||
/** This Fetch API interface allows you to perform various actions on HTTP
|
/** This Fetch API interface allows you to perform various actions on HTTP
|
||||||
* request and response headers. These actions include retrieving, setting,
|
* request and response headers. These actions include retrieving, setting,
|
||||||
* adding to, and removing. A Headers object has an associated header list,
|
* adding to, and removing. A Headers object has an associated header list,
|
||||||
* which is initially empty and consists of zero or more name and value pairs.
|
* which is initially empty and consists of zero or more name and value pairs.
|
||||||
* You can add to this using methods like append() (see Examples.) In all
|
* You can add to this using methods like append() (see Examples). In all
|
||||||
* methods of this interface, header names are matched by case-insensitive byte
|
* methods of this interface, header names are matched by case-insensitive byte
|
||||||
* sequence. */
|
* sequence. */
|
||||||
interface Headers {
|
interface Headers {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
if (key !== illegalConstructorKey) {
|
if (key !== illegalConstructorKey) {
|
||||||
throw new TypeError("Illegal constructor.");
|
throw new TypeError("Illegal constructor.");
|
||||||
}
|
}
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
|
@ -20,6 +21,7 @@
|
||||||
if (key != illegalConstructorKey) {
|
if (key != illegalConstructorKey) {
|
||||||
throw new TypeError("Illegal constructor.");
|
throw new TypeError("Illegal constructor.");
|
||||||
}
|
}
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
|
@ -32,6 +34,7 @@
|
||||||
if (key != illegalConstructorKey) {
|
if (key != illegalConstructorKey) {
|
||||||
throw new TypeError("Illegal constructor.");
|
throw new TypeError("Illegal constructor.");
|
||||||
}
|
}
|
||||||
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
get [Symbol.toStringTag]() {
|
get [Symbol.toStringTag]() {
|
||||||
|
|
|
@ -593,7 +593,9 @@
|
||||||
try {
|
try {
|
||||||
const isSpecial = specialSchemes.includes(parts.get(this).protocol);
|
const isSpecial = specialSchemes.includes(parts.get(this).protocol);
|
||||||
parts.get(this).hostname = encodeHostname(value, isSpecial);
|
parts.get(this).hostname = encodeHostname(value, isSpecial);
|
||||||
} catch {}
|
} catch {
|
||||||
|
// pass
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get href() {
|
get href() {
|
||||||
|
|
2
op_crates/web/lib.deno_web.d.ts
vendored
2
op_crates/web/lib.deno_web.d.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, no-var */
|
// deno-lint-ignore-file no-explicit-any
|
||||||
|
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="esnext" />
|
/// <reference lib="esnext" />
|
||||||
|
|
|
@ -14,11 +14,11 @@ export function deepAssign<T, U, V, W>(
|
||||||
source3: W,
|
source3: W,
|
||||||
): T & U & V & W;
|
): T & U & V & W;
|
||||||
export function deepAssign(
|
export function deepAssign(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
target: Record<string, any>,
|
target: Record<string, any>,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
...sources: any[]
|
...sources: any[]
|
||||||
): // eslint-disable-next-line @typescript-eslint/ban-types
|
): // deno-lint-ignore ban-types
|
||||||
object | undefined {
|
object | undefined {
|
||||||
for (let i = 0; i < sources.length; i++) {
|
for (let i = 0; i < sources.length; i++) {
|
||||||
const source = sources[i];
|
const source = sources[i];
|
||||||
|
|
|
@ -297,7 +297,7 @@ export interface TarMeta extends TarInfo {
|
||||||
fileSize?: number;
|
fileSize?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
// deno-lint-ignore no-empty-interface
|
||||||
interface TarEntry extends TarMeta {}
|
interface TarEntry extends TarMeta {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// At the time of writing, the github issue is closed but the problem remains.
|
// At the time of writing, the github issue is closed but the problem remains.
|
||||||
export interface Deferred<T> extends Promise<T> {
|
export interface Deferred<T> extends Promise<T> {
|
||||||
resolve: (value?: T | PromiseLike<T>) => void;
|
resolve: (value?: T | PromiseLike<T>) => void;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
reject: (reason?: any) => void;
|
reject: (reason?: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ interface TaggedYieldedValue<T> {
|
||||||
export class MuxAsyncIterator<T> implements AsyncIterable<T> {
|
export class MuxAsyncIterator<T> implements AsyncIterable<T> {
|
||||||
private iteratorCount = 0;
|
private iteratorCount = 0;
|
||||||
private yields: Array<TaggedYieldedValue<T>> = [];
|
private yields: Array<TaggedYieldedValue<T>> = [];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
private throws: any[] = [];
|
private throws: any[] = [];
|
||||||
private signal: Deferred<void> = deferred();
|
private signal: Deferred<void> = deferred();
|
||||||
|
|
||||||
|
|
|
@ -310,9 +310,10 @@ export class DateTimeFormatter {
|
||||||
string += digits(value, Number(token.value));
|
string += digits(value, Number(token.value));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// FIXME(bartlomieju)
|
||||||
case "timeZoneName": {
|
case "timeZoneName": {
|
||||||
// string += utc ? "Z" : token.value
|
// string += utc ? "Z" : token.value
|
||||||
// break
|
break;
|
||||||
}
|
}
|
||||||
case "dayPeriod": {
|
case "dayPeriod": {
|
||||||
string += token.value ? (date.getHours() >= 12 ? "PM" : "AM") : "";
|
string += token.value ? (date.getHours() >= 12 ? "PM" : "AM") : "";
|
||||||
|
|
|
@ -64,11 +64,11 @@ Deno.test({
|
||||||
name: "[std/datetime] invalidParseDateTimeFormatThrows",
|
name: "[std/datetime] invalidParseDateTimeFormatThrows",
|
||||||
fn: () => {
|
fn: () => {
|
||||||
assertThrows((): void => {
|
assertThrows((): void => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(datetime as any).parse("2019-01-01 00:00", "x-y-z");
|
(datetime as any).parse("2019-01-01 00:00", "x-y-z");
|
||||||
}, Error);
|
}, Error);
|
||||||
assertThrows((): void => {
|
assertThrows((): void => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(datetime as any).parse("2019-01-01", "x-y-z");
|
(datetime as any).parse("2019-01-01", "x-y-z");
|
||||||
}, Error);
|
}, Error);
|
||||||
},
|
},
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
|
|
||||||
import { YAMLError } from "../error.ts";
|
import { YAMLError } from "../error.ts";
|
||||||
import type { RepresentFn, StyleVariant, Type } from "../type.ts";
|
import type { RepresentFn, StyleVariant, Type } from "../type.ts";
|
||||||
import * as common from "../utils.ts";
|
import * as common from "../utils.ts";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
|
||||||
|
|
||||||
import { parse } from "../../yaml.ts";
|
import { parse } from "../../yaml.ts";
|
||||||
|
|
||||||
|
@ -7,7 +6,7 @@ import { parse } from "../../yaml.ts";
|
||||||
const yml = Deno.readFileSync(`${Deno.cwd()}/example/sample_document.yml`);
|
const yml = Deno.readFileSync(`${Deno.cwd()}/example/sample_document.yml`);
|
||||||
|
|
||||||
const document = new TextDecoder().decode(yml);
|
const document = new TextDecoder().decode(yml);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const obj = parse(document) as Record<string, any>;
|
const obj = parse(document) as Record<string, any>;
|
||||||
console.log(obj);
|
console.log(obj);
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@
|
||||||
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
|
|
||||||
import { YAMLError } from "../error.ts";
|
import { YAMLError } from "../error.ts";
|
||||||
import { Mark } from "../mark.ts";
|
import { Mark } from "../mark.ts";
|
||||||
import type { Type } from "../type.ts";
|
import type { Type } from "../type.ts";
|
||||||
|
@ -31,7 +29,6 @@ const PATTERN_NON_PRINTABLE =
|
||||||
const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
const PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
|
||||||
const PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
const PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
|
||||||
const PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
const PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
|
||||||
/* eslint-disable-next-line max-len */
|
|
||||||
const PATTERN_TAG_URI =
|
const PATTERN_TAG_URI =
|
||||||
/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ export interface LoaderStateOptions {
|
||||||
onWarning?(this: null, e?: YAMLError): void;
|
onWarning?(this: null, e?: YAMLError): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
export type ResultType = any[] | Record<string, any> | string;
|
export type ResultType = any[] | Record<string, any> | string;
|
||||||
|
|
||||||
export class LoaderState extends State {
|
export class LoaderState extends State {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
||||||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
export type Any = any;
|
export type Any = any;
|
||||||
|
|
||||||
export function isNothing(subject: unknown): subject is never {
|
export function isNothing(subject: unknown): subject is never {
|
||||||
|
|
|
@ -452,7 +452,7 @@ class Parser {
|
||||||
}
|
}
|
||||||
obj[k] = v;
|
obj[k] = v;
|
||||||
if (v instanceof Object) {
|
if (v instanceof Object) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
this._propertyClean(v as any);
|
this._propertyClean(v as any);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -486,7 +486,7 @@ class Dumper {
|
||||||
this.srcObject = srcObjc;
|
this.srcObject = srcObjc;
|
||||||
}
|
}
|
||||||
dump(): string[] {
|
dump(): string[] {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
this.output = this._parse(this.srcObject as any);
|
this.output = this._parse(this.srcObject as any);
|
||||||
this.output = this._format();
|
this.output = this._format();
|
||||||
return this.output;
|
return this.output;
|
||||||
|
|
|
@ -6,13 +6,12 @@
|
||||||
// Install using `deno install`
|
// Install using `deno install`
|
||||||
// $ deno install --allow-read https://deno.land/std/examples/catj.ts
|
// $ deno install --allow-read https://deno.land/std/examples/catj.ts
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
||||||
import { parse } from "../flags/mod.ts";
|
import { parse } from "../flags/mod.ts";
|
||||||
import * as colors from "../fmt/colors.ts";
|
import * as colors from "../fmt/colors.ts";
|
||||||
|
|
||||||
const decoder = new TextDecoder();
|
const decoder = new TextDecoder();
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function isObject(arg: any): arg is Record<string, unknown> {
|
function isObject(arg: any): arg is Record<string, unknown> {
|
||||||
return !!arg && arg.constructor === Object;
|
return !!arg && arg.constructor === Object;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +71,7 @@ function printArray(array: unknown[], path: string): void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function print(data: any[] | Record<string, unknown>): void {
|
function print(data: any[] | Record<string, unknown>): void {
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
printArray(data, "");
|
printArray(data, "");
|
||||||
|
|
|
@ -2,12 +2,10 @@
|
||||||
import { parse } from "../flags/mod.ts";
|
import { parse } from "../flags/mod.ts";
|
||||||
import { readStringDelim } from "../io/bufio.ts";
|
import { readStringDelim } from "../io/bufio.ts";
|
||||||
|
|
||||||
/* eslint-disable-next-line max-len */
|
|
||||||
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction.
|
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction.
|
||||||
const AsyncFunction = Object.getPrototypeOf(async function (): Promise<void> {})
|
const AsyncFunction = Object.getPrototypeOf(async function (): Promise<void> {})
|
||||||
.constructor;
|
.constructor;
|
||||||
|
|
||||||
/* eslint-disable max-len */
|
|
||||||
const HELP_MSG = `xeval
|
const HELP_MSG = `xeval
|
||||||
|
|
||||||
Run a script for each new-line or otherwise delimited chunk of standard input.
|
Run a script for each new-line or otherwise delimited chunk of standard input.
|
||||||
|
@ -28,7 +26,6 @@ OPTIONS:
|
||||||
-I, --replvar <replvar> Set variable name to be used in eval, defaults to $
|
-I, --replvar <replvar> Set variable name to be used in eval, defaults to $
|
||||||
ARGS:
|
ARGS:
|
||||||
<code>`;
|
<code>`;
|
||||||
/* eslint-enable max-len */
|
|
||||||
|
|
||||||
export type XevalFunc = (v: string) => void;
|
export type XevalFunc = (v: string) => void;
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ export interface Args {
|
||||||
/** Contains all the arguments that didn't have an option associated with
|
/** Contains all the arguments that didn't have an option associated with
|
||||||
* them. */
|
* them. */
|
||||||
_: Array<string | number>;
|
_: Array<string | number>;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -278,7 +278,7 @@ class Printf {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleLessThan(): string {
|
handleLessThan(): string {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const arg = this.args[this.argNum] as any;
|
const arg = this.args[this.argNum] as any;
|
||||||
if ((arg || {}).constructor.name !== "Array") {
|
if ((arg || {}).constructor.name !== "Array") {
|
||||||
throw new Error(`arg ${arg} is not an array. Todo better error handling`);
|
throw new Error(`arg ${arg} is not an array. Todo better error handling`);
|
||||||
|
@ -315,7 +315,7 @@ class Printf {
|
||||||
this.state = State.PASSTHROUGH;
|
this.state = State.PASSTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
_handleVerb(arg: any): string {
|
_handleVerb(arg: any): string {
|
||||||
switch (this.verb) {
|
switch (this.verb) {
|
||||||
case "t":
|
case "t":
|
||||||
|
|
|
@ -230,7 +230,7 @@ Deno.test("testZero", function (): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
// relevant test cases from fmt_test.go
|
// relevant test cases from fmt_test.go
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const tests: Array<[string, any, string]> = [
|
const tests: Array<[string, any, string]> = [
|
||||||
["%d", 12345, "12345"],
|
["%d", 12345, "12345"],
|
||||||
["%v", 12345, "12345"],
|
["%v", 12345, "12345"],
|
||||||
|
|
|
@ -32,7 +32,7 @@ async function encodeWasm(wasmPath: string): Promise<string> {
|
||||||
async function generate(wasm: string, output: string): Promise<void> {
|
async function generate(wasm: string, output: string): Promise<void> {
|
||||||
const initScript = await Deno.readTextFile(`${output}/deno_hash.js`);
|
const initScript = await Deno.readTextFile(`${output}/deno_hash.js`);
|
||||||
const denoHashScript =
|
const denoHashScript =
|
||||||
"/* eslint-disable */\n" +
|
"// deno-lint-ignore-file\n" +
|
||||||
"//deno-fmt-ignore-file\n" +
|
"//deno-fmt-ignore-file\n" +
|
||||||
"//deno-lint-ignore-file\n" +
|
"//deno-lint-ignore-file\n" +
|
||||||
`import * as base64 from "../../encoding/base64.ts";` +
|
`import * as base64 from "../../encoding/base64.ts";` +
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -3,7 +3,7 @@ import { getLevelByName, getLevelName, LogLevels } from "./levels.ts";
|
||||||
import type { LevelName } from "./levels.ts";
|
import type { LevelName } from "./levels.ts";
|
||||||
import type { BaseHandler } from "./handlers.ts";
|
import type { BaseHandler } from "./handlers.ts";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
export type GenericFunction = (...args: any[]) => any;
|
export type GenericFunction = (...args: any[]) => any;
|
||||||
|
|
||||||
export interface LogRecordOptions {
|
export interface LogRecordOptions {
|
||||||
|
|
|
@ -26,7 +26,7 @@ export interface FormFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Type guard for FormFile */
|
/** Type guard for FormFile */
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
export function isFormFile(x: any): x is FormFile {
|
export function isFormFile(x: any): x is FormFile {
|
||||||
return hasOwnProperty(x, "filename") && hasOwnProperty(x, "type");
|
return hasOwnProperty(x, "filename") && hasOwnProperty(x, "type");
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,7 +145,7 @@ Deno.test("multipartMultipartWriter3", async function (): Promise<void> {
|
||||||
);
|
);
|
||||||
await assertThrowsAsync(
|
await assertThrowsAsync(
|
||||||
async (): Promise<void> => {
|
async (): Promise<void> => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
await mw.writeFile("bar", "file", null as any);
|
await mw.writeFile("bar", "file", null as any);
|
||||||
},
|
},
|
||||||
Error,
|
Error,
|
||||||
|
|
|
@ -49,7 +49,7 @@ export function getEncoding(
|
||||||
optOrCallback?:
|
optOrCallback?:
|
||||||
| FileOptions
|
| FileOptions
|
||||||
| WriteFileOptions
|
| WriteFileOptions
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
| ((...args: any[]) => any)
|
| ((...args: any[]) => any)
|
||||||
| Encodings
|
| Encodings
|
||||||
| null,
|
| null,
|
||||||
|
|
|
@ -18,7 +18,7 @@ export default class Dir {
|
||||||
return this.dirPath;
|
return this.dirPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
read(callback?: (...args: any[]) => void): Promise<Dirent | null> {
|
read(callback?: (...args: any[]) => void): Promise<Dirent | null> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (!this.asyncIterator) {
|
if (!this.asyncIterator) {
|
||||||
|
@ -57,7 +57,7 @@ export default class Dir {
|
||||||
* directories, and therefore does not need to close directories when
|
* directories, and therefore does not need to close directories when
|
||||||
* finished reading.
|
* finished reading.
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
close(callback?: (...args: any[]) => void): Promise<void> {
|
close(callback?: (...args: any[]) => void): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -7,7 +7,7 @@ Deno.test({
|
||||||
name: "Closing current directory with callback is successful",
|
name: "Closing current directory with callback is successful",
|
||||||
fn() {
|
fn() {
|
||||||
let calledBack = false;
|
let calledBack = false;
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
new Dir(".").close((valOrErr: any) => {
|
new Dir(".").close((valOrErr: any) => {
|
||||||
assert(!valOrErr);
|
assert(!valOrErr);
|
||||||
calledBack = true;
|
calledBack = true;
|
||||||
|
@ -51,7 +51,7 @@ Deno.test({
|
||||||
let calledBack = false;
|
let calledBack = false;
|
||||||
const fileFromCallback: Dirent | null = await new Dir(
|
const fileFromCallback: Dirent | null = await new Dir(
|
||||||
testDir,
|
testDir,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
).read((err: any, res: Dirent) => {
|
).read((err: any, res: Dirent) => {
|
||||||
assert(res === null);
|
assert(res === null);
|
||||||
assert(err === null);
|
assert(err === null);
|
||||||
|
@ -81,7 +81,7 @@ Deno.test({
|
||||||
const dir: Dir = new Dir(testDir);
|
const dir: Dir = new Dir(testDir);
|
||||||
const firstRead: Dirent | null = await dir.read();
|
const firstRead: Dirent | null = await dir.read();
|
||||||
const secondRead: Dirent | null = await dir.read(
|
const secondRead: Dirent | null = await dir.read(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(err: any, secondResult: Dirent) => {
|
(err: any, secondResult: Dirent) => {
|
||||||
assert(
|
assert(
|
||||||
secondResult.name === "bar.txt" ||
|
secondResult.name === "bar.txt" ||
|
||||||
|
|
|
@ -84,7 +84,7 @@ function callbackify<Arg1T, Arg2T, Arg3T, Arg4T, Arg5T, ResultT>(
|
||||||
callback: Callback<ResultT>,
|
callback: Callback<ResultT>,
|
||||||
) => void;
|
) => void;
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function callbackify(original: any): any {
|
function callbackify(original: any): any {
|
||||||
if (typeof original !== "function") {
|
if (typeof original !== "function") {
|
||||||
throw new NodeInvalidArgTypeError('"original"');
|
throw new NodeInvalidArgTypeError('"original"');
|
||||||
|
|
|
@ -105,10 +105,10 @@ Deno.test(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const thenableFn = (): PromiseLike<any> => {
|
const thenableFn = (): PromiseLike<any> => {
|
||||||
return {
|
return {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
then(onfulfilled): PromiseLike<any> {
|
then(onfulfilled): PromiseLike<any> {
|
||||||
assert(onfulfilled);
|
assert(onfulfilled);
|
||||||
onfulfilled(value);
|
onfulfilled(value);
|
||||||
|
@ -150,11 +150,11 @@ Deno.test(
|
||||||
if ("reason" in err) {
|
if ("reason" in err) {
|
||||||
assert(!value);
|
assert(!value);
|
||||||
assertStrictEquals(
|
assertStrictEquals(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(err as any).code,
|
(err as any).code,
|
||||||
"ERR_FALSY_VALUE_REJECTION",
|
"ERR_FALSY_VALUE_REJECTION",
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertStrictEquals((err as any).reason, value);
|
assertStrictEquals((err as any).reason, value);
|
||||||
} else {
|
} else {
|
||||||
assertStrictEquals(String(value).endsWith(err.message), true);
|
assertStrictEquals(String(value).endsWith(err.message), true);
|
||||||
|
@ -186,11 +186,11 @@ Deno.test(
|
||||||
if ("reason" in err) {
|
if ("reason" in err) {
|
||||||
assert(!value);
|
assert(!value);
|
||||||
assertStrictEquals(
|
assertStrictEquals(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(err as any).code,
|
(err as any).code,
|
||||||
"ERR_FALSY_VALUE_REJECTION",
|
"ERR_FALSY_VALUE_REJECTION",
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertStrictEquals((err as any).reason, value);
|
assertStrictEquals((err as any).reason, value);
|
||||||
} else {
|
} else {
|
||||||
assertStrictEquals(String(value).endsWith(err.message), true);
|
assertStrictEquals(String(value).endsWith(err.message), true);
|
||||||
|
@ -220,11 +220,11 @@ Deno.test(
|
||||||
if ("reason" in err) {
|
if ("reason" in err) {
|
||||||
assert(!value);
|
assert(!value);
|
||||||
assertStrictEquals(
|
assertStrictEquals(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(err as any).code,
|
(err as any).code,
|
||||||
"ERR_FALSY_VALUE_REJECTION",
|
"ERR_FALSY_VALUE_REJECTION",
|
||||||
);
|
);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertStrictEquals((err as any).reason, value);
|
assertStrictEquals((err as any).reason, value);
|
||||||
} else {
|
} else {
|
||||||
assertStrictEquals(String(value).endsWith(err.message), true);
|
assertStrictEquals(String(value).endsWith(err.message), true);
|
||||||
|
@ -341,12 +341,12 @@ Deno.test("callbackify preserves the `this` binding", async () => {
|
||||||
Deno.test("callbackify throws with non-function inputs", () => {
|
Deno.test("callbackify throws with non-function inputs", () => {
|
||||||
["foo", null, undefined, false, 0, {}, Symbol(), []].forEach((value) => {
|
["foo", null, undefined, false, 0, {}, Symbol(), []].forEach((value) => {
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
callbackify(value as any);
|
callbackify(value as any);
|
||||||
throw Error("We should never reach this error");
|
throw Error("We should never reach this error");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
assert(err instanceof TypeError);
|
assert(err instanceof TypeError);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE");
|
assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE");
|
||||||
assertStrictEquals(err.name, "TypeError");
|
assertStrictEquals(err.name, "TypeError");
|
||||||
assertStrictEquals(
|
assertStrictEquals(
|
||||||
|
@ -365,7 +365,7 @@ Deno.test(
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const cb = callbackify(asyncFn) as any;
|
const cb = callbackify(asyncFn) as any;
|
||||||
const args: unknown[] = [];
|
const args: unknown[] = [];
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ Deno.test(
|
||||||
throw Error("We should never reach this error");
|
throw Error("We should never reach this error");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
assert(err instanceof TypeError);
|
assert(err instanceof TypeError);
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE");
|
assertStrictEquals((err as any).code, "ERR_INVALID_ARG_TYPE");
|
||||||
assertStrictEquals(err.name, "TypeError");
|
assertStrictEquals(err.name, "TypeError");
|
||||||
assertStrictEquals(
|
assertStrictEquals(
|
||||||
|
|
|
@ -57,16 +57,16 @@ class NodeInvalidArgTypeError extends TypeError {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function promisify(
|
export function promisify(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
original: (...args: any[]) => void,
|
original: (...args: any[]) => void,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
): (...args: any[]) => Promise<any> {
|
): (...args: any[]) => Promise<any> {
|
||||||
if (typeof original !== "function") {
|
if (typeof original !== "function") {
|
||||||
throw new NodeInvalidArgTypeError("original", "Function", original);
|
throw new NodeInvalidArgTypeError("original", "Function", original);
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
if ((original as any)[kCustomPromisifiedSymbol]) {
|
if ((original as any)[kCustomPromisifiedSymbol]) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const fn = (original as any)[kCustomPromisifiedSymbol];
|
const fn = (original as any)[kCustomPromisifiedSymbol];
|
||||||
if (typeof fn !== "function") {
|
if (typeof fn !== "function") {
|
||||||
throw new NodeInvalidArgTypeError(
|
throw new NodeInvalidArgTypeError(
|
||||||
|
@ -85,9 +85,9 @@ export function promisify(
|
||||||
|
|
||||||
// Names to create an object from in case the callback receives multiple
|
// Names to create an object from in case the callback receives multiple
|
||||||
// arguments, e.g. ['bytesRead', 'buffer'] for fs.read.
|
// arguments, e.g. ['bytesRead', 'buffer'] for fs.read.
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
const argumentNames = (original as any)[kCustomPromisifyArgsSymbol];
|
const argumentNames = (original as any)[kCustomPromisifyArgsSymbol];
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
function fn(this: any, ...args: unknown[]): Promise<unknown> {
|
function fn(this: any, ...args: unknown[]): Promise<unknown> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
original.call(this, ...args, (err: Error, ...values: unknown[]) => {
|
original.call(this, ...args, (err: Error, ...values: unknown[]) => {
|
||||||
|
@ -97,7 +97,7 @@ export function promisify(
|
||||||
if (argumentNames !== undefined && values.length > 1) {
|
if (argumentNames !== undefined && values.length > 1) {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
for (let i = 0; i < argumentNames.length; i++) {
|
for (let i = 0; i < argumentNames.length; i++) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
(obj as any)[argumentNames[i]] = values[i];
|
(obj as any)[argumentNames[i]] = values[i];
|
||||||
}
|
}
|
||||||
resolve(obj);
|
resolve(obj);
|
||||||
|
|
|
@ -29,7 +29,7 @@ import {
|
||||||
import { promisify } from "./_util_promisify.ts";
|
import { promisify } from "./_util_promisify.ts";
|
||||||
import * as fs from "../fs.ts";
|
import * as fs from "../fs.ts";
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
type VoidFunction = (...args: any[]) => void;
|
type VoidFunction = (...args: any[]) => void;
|
||||||
|
|
||||||
const readFile = promisify(fs.readFile);
|
const readFile = promisify(fs.readFile);
|
||||||
|
|
|
@ -18,10 +18,10 @@ export type MaybeDefined<T> = T | undefined;
|
||||||
export type MaybeEmpty<T> = T | null | undefined;
|
export type MaybeEmpty<T> = T | null | undefined;
|
||||||
|
|
||||||
export function intoCallbackAPI<T>(
|
export function intoCallbackAPI<T>(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
func: (...args: any[]) => Promise<T>,
|
func: (...args: any[]) => Promise<T>,
|
||||||
cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T>) => void>,
|
cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T>) => void>,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
...args: any[]
|
...args: any[]
|
||||||
): void {
|
): void {
|
||||||
func(...args)
|
func(...args)
|
||||||
|
@ -30,11 +30,11 @@ export function intoCallbackAPI<T>(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function intoCallbackAPIWithIntercept<T1, T2>(
|
export function intoCallbackAPIWithIntercept<T1, T2>(
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
func: (...args: any[]) => Promise<T1>,
|
func: (...args: any[]) => Promise<T1>,
|
||||||
interceptor: (v: T1) => T2,
|
interceptor: (v: T1) => T2,
|
||||||
cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T2>) => void>,
|
cb: MaybeEmpty<(err: MaybeNull<Error>, value: MaybeEmpty<T2>) => void>,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
...args: any[]
|
...args: any[]
|
||||||
): void {
|
): void {
|
||||||
func(...args)
|
func(...args)
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue