mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-14 16:56:06 -05:00
Enable @typescript-eslint/ban-types (#55133)
This commit is contained in:
@@ -1711,7 +1711,7 @@ export let sys: System = (() => {
|
||||
|
||||
function bufferFrom(input: string, encoding?: string): Buffer {
|
||||
// See https://github.com/Microsoft/TypeScript/issues/25652
|
||||
return Buffer.from && (Buffer.from as Function) !== Int8Array.from
|
||||
return Buffer.from && Buffer.from !== Int8Array.from
|
||||
? Buffer.from(input, encoding)
|
||||
: new Buffer(input, encoding);
|
||||
}
|
||||
|
||||
@@ -442,11 +442,11 @@ export class TestState {
|
||||
for (const k of keys) {
|
||||
const key = k as keyof typeof ls;
|
||||
if (cacheableMembers.indexOf(key) === -1) {
|
||||
proxy[key] = (...args: any[]) => (ls[key] as Function)(...args);
|
||||
proxy[key] = (...args: any[]) => (ls[key] as (...args: any[]) => any)(...args);
|
||||
continue;
|
||||
}
|
||||
const memo = Utils.memoize(
|
||||
(_version: number, _active: string, _caret: number, _selectEnd: number, _marker: string | undefined, ...args: any[]) => (ls[key] as Function)(...args),
|
||||
(_version: number, _active: string, _caret: number, _selectEnd: number, _marker: string | undefined, ...args: any[]) => (ls[key] as (...args: any[]) => any)(...args),
|
||||
(...args) => args.map(a => a && typeof a === "object" ? JSON.stringify(a) : a).join("|,|")
|
||||
);
|
||||
proxy[key] = (...args: any[]) => memo(
|
||||
|
||||
Reference in New Issue
Block a user