forked from projectmoon/tenebrous-dicebot
Working grpc-web. Needs tonic master. Next step: attempt same shit with web assembly
This commit is contained in:
parent
764426382a
commit
f9d6b7b827
|
@ -2654,6 +2654,18 @@ dependencies = [
|
||||||
"utf-8",
|
"utf-8",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tenebrous-api"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"prost",
|
||||||
|
"tenebrous-rpc",
|
||||||
|
"tokio",
|
||||||
|
"tokio-stream",
|
||||||
|
"tonic",
|
||||||
|
"tonic-web",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tenebrous-dicebot"
|
name = "tenebrous-dicebot"
|
||||||
version = "0.10.0"
|
version = "0.10.0"
|
||||||
|
@ -2684,7 +2696,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"toml",
|
"toml",
|
||||||
"tonic",
|
"tonic",
|
||||||
"tonic-build",
|
"tonic-build 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
@ -2695,7 +2707,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"prost",
|
"prost",
|
||||||
"tonic",
|
"tonic",
|
||||||
"tonic-build",
|
"tonic-build 0.4.2 (git+https://github.com/hyperium/tonic)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2868,8 +2880,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tonic"
|
name = "tonic"
|
||||||
version = "0.4.3"
|
version = "0.4.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/hyperium/tonic?branch=master#3e95553c57c0a21a7ae150128ee0d35bc50f3b90"
|
||||||
checksum = "2ac42cd97ac6bd2339af5bcabf105540e21e45636ec6fa6aae5e85d44db31be0"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-stream",
|
"async-stream",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
@ -2889,6 +2900,7 @@ dependencies = [
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tower",
|
"tower",
|
||||||
|
"tower-layer",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-futures",
|
"tracing-futures",
|
||||||
|
@ -2906,6 +2918,34 @@ dependencies = [
|
||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tonic-build"
|
||||||
|
version = "0.4.2"
|
||||||
|
source = "git+https://github.com/hyperium/tonic?branch=master#3e95553c57c0a21a7ae150128ee0d35bc50f3b90"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"prost-build",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tonic-web"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "git+https://github.com/hyperium/tonic?branch=master#3e95553c57c0a21a7ae150128ee0d35bc50f3b90"
|
||||||
|
dependencies = [
|
||||||
|
"base64",
|
||||||
|
"bytes",
|
||||||
|
"futures-core",
|
||||||
|
"http",
|
||||||
|
"http-body",
|
||||||
|
"hyper",
|
||||||
|
"pin-project",
|
||||||
|
"tonic",
|
||||||
|
"tower-service",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tower"
|
name = "tower"
|
||||||
version = "0.4.8"
|
version = "0.4.8"
|
||||||
|
|
|
@ -3,4 +3,5 @@
|
||||||
members = [
|
members = [
|
||||||
"dicebot",
|
"dicebot",
|
||||||
"rpc",
|
"rpc",
|
||||||
|
"api",
|
||||||
]
|
]
|
|
@ -0,0 +1,18 @@
|
||||||
|
[package]
|
||||||
|
name = "tenebrous-api"
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["projectmoon <projectmoon@agnos.is>"]
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
tonic = { git = "https://github.com/hyperium/tonic", branch = "master" }
|
||||||
|
tonic-web = { git = "https://github.com/hyperium/tonic", branch = "master" }
|
||||||
|
prost = "0.7"
|
||||||
|
tenebrous-rpc = { path = "../rpc" }
|
||||||
|
tokio-stream = { version = "0.1", features = ["net"] }
|
||||||
|
|
||||||
|
[dependencies.tokio]
|
||||||
|
version = "1"
|
||||||
|
features = [ "full" ]
|
|
@ -0,0 +1,214 @@
|
||||||
|
// package: dicebot
|
||||||
|
// file: dicebot.proto
|
||||||
|
|
||||||
|
import * as jspb from "google-protobuf";
|
||||||
|
|
||||||
|
export class GetVariableRequest extends jspb.Message {
|
||||||
|
getUserId(): string;
|
||||||
|
setUserId(value: string): void;
|
||||||
|
|
||||||
|
getRoomId(): string;
|
||||||
|
setRoomId(value: string): void;
|
||||||
|
|
||||||
|
getVariableName(): string;
|
||||||
|
setVariableName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): GetVariableRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: GetVariableRequest): GetVariableRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: GetVariableRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): GetVariableRequest;
|
||||||
|
static deserializeBinaryFromReader(message: GetVariableRequest, reader: jspb.BinaryReader): GetVariableRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace GetVariableRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
userId: string,
|
||||||
|
roomId: string,
|
||||||
|
variableName: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetVariableReply extends jspb.Message {
|
||||||
|
getValue(): number;
|
||||||
|
setValue(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): GetVariableReply.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: GetVariableReply): GetVariableReply.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: GetVariableReply, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): GetVariableReply;
|
||||||
|
static deserializeBinaryFromReader(message: GetVariableReply, reader: jspb.BinaryReader): GetVariableReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace GetVariableReply {
|
||||||
|
export type AsObject = {
|
||||||
|
value: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetAllVariablesRequest extends jspb.Message {
|
||||||
|
getUserId(): string;
|
||||||
|
setUserId(value: string): void;
|
||||||
|
|
||||||
|
getRoomId(): string;
|
||||||
|
setRoomId(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): GetAllVariablesRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: GetAllVariablesRequest): GetAllVariablesRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: GetAllVariablesRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): GetAllVariablesRequest;
|
||||||
|
static deserializeBinaryFromReader(message: GetAllVariablesRequest, reader: jspb.BinaryReader): GetAllVariablesRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace GetAllVariablesRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
userId: string,
|
||||||
|
roomId: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class GetAllVariablesReply extends jspb.Message {
|
||||||
|
getVariablesMap(): jspb.Map<string, number>;
|
||||||
|
clearVariablesMap(): void;
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): GetAllVariablesReply.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: GetAllVariablesReply): GetAllVariablesReply.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: GetAllVariablesReply, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): GetAllVariablesReply;
|
||||||
|
static deserializeBinaryFromReader(message: GetAllVariablesReply, reader: jspb.BinaryReader): GetAllVariablesReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace GetAllVariablesReply {
|
||||||
|
export type AsObject = {
|
||||||
|
variablesMap: Array<[string, number]>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SetVariableRequest extends jspb.Message {
|
||||||
|
getUserId(): string;
|
||||||
|
setUserId(value: string): void;
|
||||||
|
|
||||||
|
getRoomId(): string;
|
||||||
|
setRoomId(value: string): void;
|
||||||
|
|
||||||
|
getVariableName(): string;
|
||||||
|
setVariableName(value: string): void;
|
||||||
|
|
||||||
|
getValue(): number;
|
||||||
|
setValue(value: number): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): SetVariableRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: SetVariableRequest): SetVariableRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: SetVariableRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SetVariableRequest;
|
||||||
|
static deserializeBinaryFromReader(message: SetVariableRequest, reader: jspb.BinaryReader): SetVariableRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace SetVariableRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
userId: string,
|
||||||
|
roomId: string,
|
||||||
|
variableName: string,
|
||||||
|
value: number,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SetVariableReply extends jspb.Message {
|
||||||
|
getSuccess(): boolean;
|
||||||
|
setSuccess(value: boolean): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): SetVariableReply.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: SetVariableReply): SetVariableReply.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: SetVariableReply, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): SetVariableReply;
|
||||||
|
static deserializeBinaryFromReader(message: SetVariableReply, reader: jspb.BinaryReader): SetVariableReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace SetVariableReply {
|
||||||
|
export type AsObject = {
|
||||||
|
success: boolean,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class UserIdRequest extends jspb.Message {
|
||||||
|
getUserId(): string;
|
||||||
|
setUserId(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): UserIdRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: UserIdRequest): UserIdRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: UserIdRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): UserIdRequest;
|
||||||
|
static deserializeBinaryFromReader(message: UserIdRequest, reader: jspb.BinaryReader): UserIdRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UserIdRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
userId: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RoomsListReply extends jspb.Message {
|
||||||
|
clearRoomsList(): void;
|
||||||
|
getRoomsList(): Array<RoomsListReply.Room>;
|
||||||
|
setRoomsList(value: Array<RoomsListReply.Room>): void;
|
||||||
|
addRooms(value?: RoomsListReply.Room, index?: number): RoomsListReply.Room;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): RoomsListReply.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: RoomsListReply): RoomsListReply.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: RoomsListReply, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): RoomsListReply;
|
||||||
|
static deserializeBinaryFromReader(message: RoomsListReply, reader: jspb.BinaryReader): RoomsListReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace RoomsListReply {
|
||||||
|
export type AsObject = {
|
||||||
|
roomsList: Array<RoomsListReply.Room.AsObject>,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Room extends jspb.Message {
|
||||||
|
getRoomId(): string;
|
||||||
|
setRoomId(value: string): void;
|
||||||
|
|
||||||
|
getDisplayName(): string;
|
||||||
|
setDisplayName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Room.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Room): Room.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Room, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Room;
|
||||||
|
static deserializeBinaryFromReader(message: Room, reader: jspb.BinaryReader): Room;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Room {
|
||||||
|
export type AsObject = {
|
||||||
|
roomId: string,
|
||||||
|
displayName: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,120 @@
|
||||||
|
// package: dicebot
|
||||||
|
// file: dicebot.proto
|
||||||
|
|
||||||
|
import * as dicebot_pb from "./dicebot_pb";
|
||||||
|
import {grpc} from "@improbable-eng/grpc-web";
|
||||||
|
|
||||||
|
type DicebotGetVariable = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof Dicebot;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof dicebot_pb.GetVariableRequest;
|
||||||
|
readonly responseType: typeof dicebot_pb.GetVariableReply;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DicebotGetAllVariables = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof Dicebot;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof dicebot_pb.GetAllVariablesRequest;
|
||||||
|
readonly responseType: typeof dicebot_pb.GetAllVariablesReply;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DicebotSetVariable = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof Dicebot;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof dicebot_pb.SetVariableRequest;
|
||||||
|
readonly responseType: typeof dicebot_pb.SetVariableReply;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DicebotRoomsForUser = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof Dicebot;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof dicebot_pb.UserIdRequest;
|
||||||
|
readonly responseType: typeof dicebot_pb.RoomsListReply;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class Dicebot {
|
||||||
|
static readonly serviceName: string;
|
||||||
|
static readonly GetVariable: DicebotGetVariable;
|
||||||
|
static readonly GetAllVariables: DicebotGetAllVariables;
|
||||||
|
static readonly SetVariable: DicebotSetVariable;
|
||||||
|
static readonly RoomsForUser: DicebotRoomsForUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
||||||
|
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
||||||
|
|
||||||
|
interface UnaryResponse {
|
||||||
|
cancel(): void;
|
||||||
|
}
|
||||||
|
interface ResponseStream<T> {
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
||||||
|
}
|
||||||
|
interface RequestStream<T> {
|
||||||
|
write(message: T): RequestStream<T>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
||||||
|
}
|
||||||
|
interface BidirectionalStream<ReqT, ResT> {
|
||||||
|
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DicebotClient {
|
||||||
|
readonly serviceHost: string;
|
||||||
|
|
||||||
|
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
||||||
|
getVariable(
|
||||||
|
requestMessage: dicebot_pb.GetVariableRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetVariableReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
getVariable(
|
||||||
|
requestMessage: dicebot_pb.GetVariableRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetVariableReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
getAllVariables(
|
||||||
|
requestMessage: dicebot_pb.GetAllVariablesRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetAllVariablesReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
getAllVariables(
|
||||||
|
requestMessage: dicebot_pb.GetAllVariablesRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.GetAllVariablesReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
setVariable(
|
||||||
|
requestMessage: dicebot_pb.SetVariableRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.SetVariableReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
setVariable(
|
||||||
|
requestMessage: dicebot_pb.SetVariableRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.SetVariableReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
roomsForUser(
|
||||||
|
requestMessage: dicebot_pb.UserIdRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.RoomsListReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
roomsForUser(
|
||||||
|
requestMessage: dicebot_pb.UserIdRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: dicebot_pb.RoomsListReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,181 @@
|
||||||
|
// package: dicebot
|
||||||
|
// file: dicebot.proto
|
||||||
|
|
||||||
|
var dicebot_pb = require("./dicebot_pb");
|
||||||
|
var grpc = require("@improbable-eng/grpc-web").grpc;
|
||||||
|
|
||||||
|
var Dicebot = (function () {
|
||||||
|
function Dicebot() {}
|
||||||
|
Dicebot.serviceName = "dicebot.Dicebot";
|
||||||
|
return Dicebot;
|
||||||
|
}());
|
||||||
|
|
||||||
|
Dicebot.GetVariable = {
|
||||||
|
methodName: "GetVariable",
|
||||||
|
service: Dicebot,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: dicebot_pb.GetVariableRequest,
|
||||||
|
responseType: dicebot_pb.GetVariableReply
|
||||||
|
};
|
||||||
|
|
||||||
|
Dicebot.GetAllVariables = {
|
||||||
|
methodName: "GetAllVariables",
|
||||||
|
service: Dicebot,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: dicebot_pb.GetAllVariablesRequest,
|
||||||
|
responseType: dicebot_pb.GetAllVariablesReply
|
||||||
|
};
|
||||||
|
|
||||||
|
Dicebot.SetVariable = {
|
||||||
|
methodName: "SetVariable",
|
||||||
|
service: Dicebot,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: dicebot_pb.SetVariableRequest,
|
||||||
|
responseType: dicebot_pb.SetVariableReply
|
||||||
|
};
|
||||||
|
|
||||||
|
Dicebot.RoomsForUser = {
|
||||||
|
methodName: "RoomsForUser",
|
||||||
|
service: Dicebot,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: dicebot_pb.UserIdRequest,
|
||||||
|
responseType: dicebot_pb.RoomsListReply
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.Dicebot = Dicebot;
|
||||||
|
|
||||||
|
function DicebotClient(serviceHost, options) {
|
||||||
|
this.serviceHost = serviceHost;
|
||||||
|
this.options = options || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
DicebotClient.prototype.getVariable = function getVariable(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(Dicebot.GetVariable, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
DicebotClient.prototype.getAllVariables = function getAllVariables(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(Dicebot.GetAllVariables, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
DicebotClient.prototype.setVariable = function setVariable(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(Dicebot.SetVariable, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
DicebotClient.prototype.roomsForUser = function roomsForUser(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(Dicebot.RoomsForUser, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.DicebotClient = DicebotClient;
|
||||||
|
|
|
@ -0,0 +1,71 @@
|
||||||
|
// package: web_api
|
||||||
|
// file: web-api.proto
|
||||||
|
|
||||||
|
import * as jspb from "google-protobuf";
|
||||||
|
|
||||||
|
export class UserIdRequest extends jspb.Message {
|
||||||
|
getUserId(): string;
|
||||||
|
setUserId(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): UserIdRequest.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: UserIdRequest): UserIdRequest.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: UserIdRequest, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): UserIdRequest;
|
||||||
|
static deserializeBinaryFromReader(message: UserIdRequest, reader: jspb.BinaryReader): UserIdRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace UserIdRequest {
|
||||||
|
export type AsObject = {
|
||||||
|
userId: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class RoomsListReply extends jspb.Message {
|
||||||
|
clearRoomsList(): void;
|
||||||
|
getRoomsList(): Array<RoomsListReply.Room>;
|
||||||
|
setRoomsList(value: Array<RoomsListReply.Room>): void;
|
||||||
|
addRooms(value?: RoomsListReply.Room, index?: number): RoomsListReply.Room;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): RoomsListReply.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: RoomsListReply): RoomsListReply.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: RoomsListReply, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): RoomsListReply;
|
||||||
|
static deserializeBinaryFromReader(message: RoomsListReply, reader: jspb.BinaryReader): RoomsListReply;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace RoomsListReply {
|
||||||
|
export type AsObject = {
|
||||||
|
roomsList: Array<RoomsListReply.Room.AsObject>,
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Room extends jspb.Message {
|
||||||
|
getRoomId(): string;
|
||||||
|
setRoomId(value: string): void;
|
||||||
|
|
||||||
|
getDisplayName(): string;
|
||||||
|
setDisplayName(value: string): void;
|
||||||
|
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
toObject(includeInstance?: boolean): Room.AsObject;
|
||||||
|
static toObject(includeInstance: boolean, msg: Room): Room.AsObject;
|
||||||
|
static extensions: {[key: number]: jspb.ExtensionFieldInfo<jspb.Message>};
|
||||||
|
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo<jspb.Message>};
|
||||||
|
static serializeBinaryToWriter(message: Room, writer: jspb.BinaryWriter): void;
|
||||||
|
static deserializeBinary(bytes: Uint8Array): Room;
|
||||||
|
static deserializeBinaryFromReader(message: Room, reader: jspb.BinaryReader): Room;
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace Room {
|
||||||
|
export type AsObject = {
|
||||||
|
roomId: string,
|
||||||
|
displayName: string,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,534 @@
|
||||||
|
// source: web-api.proto
|
||||||
|
/**
|
||||||
|
* @fileoverview
|
||||||
|
* @enhanceable
|
||||||
|
* @suppress {missingRequire} reports error on implicit type usages.
|
||||||
|
* @suppress {messageConventions} JS Compiler reports an error if a variable or
|
||||||
|
* field starts with 'MSG_' and isn't a translatable message.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
|
// GENERATED CODE -- DO NOT EDIT!
|
||||||
|
/* eslint-disable */
|
||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
|
var jspb = require('google-protobuf');
|
||||||
|
var goog = jspb;
|
||||||
|
var global = Function('return this')();
|
||||||
|
|
||||||
|
goog.exportSymbol('proto.web_api.RoomsListReply', null, global);
|
||||||
|
goog.exportSymbol('proto.web_api.RoomsListReply.Room', null, global);
|
||||||
|
goog.exportSymbol('proto.web_api.UserIdRequest', null, global);
|
||||||
|
/**
|
||||||
|
* Generated by JsPbCodeGenerator.
|
||||||
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||||
|
* server response, or constructed directly in Javascript. The array is used
|
||||||
|
* in place and becomes part of the constructed object. It is not cloned.
|
||||||
|
* If no data is provided, the constructed object will be empty, but still
|
||||||
|
* valid.
|
||||||
|
* @extends {jspb.Message}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest = function(opt_data) {
|
||||||
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||||
|
};
|
||||||
|
goog.inherits(proto.web_api.UserIdRequest, jspb.Message);
|
||||||
|
if (goog.DEBUG && !COMPILED) {
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.displayName = 'proto.web_api.UserIdRequest';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Generated by JsPbCodeGenerator.
|
||||||
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||||
|
* server response, or constructed directly in Javascript. The array is used
|
||||||
|
* in place and becomes part of the constructed object. It is not cloned.
|
||||||
|
* If no data is provided, the constructed object will be empty, but still
|
||||||
|
* valid.
|
||||||
|
* @extends {jspb.Message}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply = function(opt_data) {
|
||||||
|
jspb.Message.initialize(this, opt_data, 0, -1, proto.web_api.RoomsListReply.repeatedFields_, null);
|
||||||
|
};
|
||||||
|
goog.inherits(proto.web_api.RoomsListReply, jspb.Message);
|
||||||
|
if (goog.DEBUG && !COMPILED) {
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.displayName = 'proto.web_api.RoomsListReply';
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Generated by JsPbCodeGenerator.
|
||||||
|
* @param {Array=} opt_data Optional initial data array, typically from a
|
||||||
|
* server response, or constructed directly in Javascript. The array is used
|
||||||
|
* in place and becomes part of the constructed object. It is not cloned.
|
||||||
|
* If no data is provided, the constructed object will be empty, but still
|
||||||
|
* valid.
|
||||||
|
* @extends {jspb.Message}
|
||||||
|
* @constructor
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room = function(opt_data) {
|
||||||
|
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||||
|
};
|
||||||
|
goog.inherits(proto.web_api.RoomsListReply.Room, jspb.Message);
|
||||||
|
if (goog.DEBUG && !COMPILED) {
|
||||||
|
/**
|
||||||
|
* @public
|
||||||
|
* @override
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.displayName = 'proto.web_api.RoomsListReply.Room';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||||
|
/**
|
||||||
|
* Creates an object representation of this proto.
|
||||||
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||||
|
* Optional fields that are not set will be set to undefined.
|
||||||
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||||
|
* For the list of reserved names please see:
|
||||||
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||||
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||||
|
* JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @return {!Object}
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.prototype.toObject = function(opt_includeInstance) {
|
||||||
|
return proto.web_api.UserIdRequest.toObject(opt_includeInstance, this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static version of the {@see toObject} method.
|
||||||
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||||
|
* the JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @param {!proto.web_api.UserIdRequest} msg The msg instance to transform.
|
||||||
|
* @return {!Object}
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.toObject = function(includeInstance, msg) {
|
||||||
|
var f, obj = {
|
||||||
|
userId: jspb.Message.getFieldWithDefault(msg, 1, "")
|
||||||
|
};
|
||||||
|
|
||||||
|
if (includeInstance) {
|
||||||
|
obj.$jspbMessageInstance = msg;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format).
|
||||||
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||||
|
* @return {!proto.web_api.UserIdRequest}
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.deserializeBinary = function(bytes) {
|
||||||
|
var reader = new jspb.BinaryReader(bytes);
|
||||||
|
var msg = new proto.web_api.UserIdRequest;
|
||||||
|
return proto.web_api.UserIdRequest.deserializeBinaryFromReader(msg, reader);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format) from the
|
||||||
|
* given reader into the given message object.
|
||||||
|
* @param {!proto.web_api.UserIdRequest} msg The message object to deserialize into.
|
||||||
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||||
|
* @return {!proto.web_api.UserIdRequest}
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.deserializeBinaryFromReader = function(msg, reader) {
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var field = reader.getFieldNumber();
|
||||||
|
switch (field) {
|
||||||
|
case 1:
|
||||||
|
var value = /** @type {string} */ (reader.readString());
|
||||||
|
msg.setUserId(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reader.skipField();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the message to binary data (in protobuf wire format).
|
||||||
|
* @return {!Uint8Array}
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.prototype.serializeBinary = function() {
|
||||||
|
var writer = new jspb.BinaryWriter();
|
||||||
|
proto.web_api.UserIdRequest.serializeBinaryToWriter(this, writer);
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the given message to binary data (in protobuf wire
|
||||||
|
* format), writing to the given BinaryWriter.
|
||||||
|
* @param {!proto.web_api.UserIdRequest} message
|
||||||
|
* @param {!jspb.BinaryWriter} writer
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.serializeBinaryToWriter = function(message, writer) {
|
||||||
|
var f = undefined;
|
||||||
|
f = message.getUserId();
|
||||||
|
if (f.length > 0) {
|
||||||
|
writer.writeString(
|
||||||
|
1,
|
||||||
|
f
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* optional string user_id = 1;
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.prototype.getUserId = function() {
|
||||||
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} value
|
||||||
|
* @return {!proto.web_api.UserIdRequest} returns this
|
||||||
|
*/
|
||||||
|
proto.web_api.UserIdRequest.prototype.setUserId = function(value) {
|
||||||
|
return jspb.Message.setProto3StringField(this, 1, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of repeated fields within this message type.
|
||||||
|
* @private {!Array<number>}
|
||||||
|
* @const
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.repeatedFields_ = [1];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||||
|
/**
|
||||||
|
* Creates an object representation of this proto.
|
||||||
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||||
|
* Optional fields that are not set will be set to undefined.
|
||||||
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||||
|
* For the list of reserved names please see:
|
||||||
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||||
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||||
|
* JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @return {!Object}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.toObject = function(opt_includeInstance) {
|
||||||
|
return proto.web_api.RoomsListReply.toObject(opt_includeInstance, this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static version of the {@see toObject} method.
|
||||||
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||||
|
* the JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @param {!proto.web_api.RoomsListReply} msg The msg instance to transform.
|
||||||
|
* @return {!Object}
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.toObject = function(includeInstance, msg) {
|
||||||
|
var f, obj = {
|
||||||
|
roomsList: jspb.Message.toObjectList(msg.getRoomsList(),
|
||||||
|
proto.web_api.RoomsListReply.Room.toObject, includeInstance)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (includeInstance) {
|
||||||
|
obj.$jspbMessageInstance = msg;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format).
|
||||||
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||||
|
* @return {!proto.web_api.RoomsListReply}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.deserializeBinary = function(bytes) {
|
||||||
|
var reader = new jspb.BinaryReader(bytes);
|
||||||
|
var msg = new proto.web_api.RoomsListReply;
|
||||||
|
return proto.web_api.RoomsListReply.deserializeBinaryFromReader(msg, reader);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format) from the
|
||||||
|
* given reader into the given message object.
|
||||||
|
* @param {!proto.web_api.RoomsListReply} msg The message object to deserialize into.
|
||||||
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||||
|
* @return {!proto.web_api.RoomsListReply}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.deserializeBinaryFromReader = function(msg, reader) {
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var field = reader.getFieldNumber();
|
||||||
|
switch (field) {
|
||||||
|
case 1:
|
||||||
|
var value = new proto.web_api.RoomsListReply.Room;
|
||||||
|
reader.readMessage(value,proto.web_api.RoomsListReply.Room.deserializeBinaryFromReader);
|
||||||
|
msg.addRooms(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reader.skipField();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the message to binary data (in protobuf wire format).
|
||||||
|
* @return {!Uint8Array}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.serializeBinary = function() {
|
||||||
|
var writer = new jspb.BinaryWriter();
|
||||||
|
proto.web_api.RoomsListReply.serializeBinaryToWriter(this, writer);
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the given message to binary data (in protobuf wire
|
||||||
|
* format), writing to the given BinaryWriter.
|
||||||
|
* @param {!proto.web_api.RoomsListReply} message
|
||||||
|
* @param {!jspb.BinaryWriter} writer
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.serializeBinaryToWriter = function(message, writer) {
|
||||||
|
var f = undefined;
|
||||||
|
f = message.getRoomsList();
|
||||||
|
if (f.length > 0) {
|
||||||
|
writer.writeRepeatedMessage(
|
||||||
|
1,
|
||||||
|
f,
|
||||||
|
proto.web_api.RoomsListReply.Room.serializeBinaryToWriter
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||||
|
/**
|
||||||
|
* Creates an object representation of this proto.
|
||||||
|
* Field names that are reserved in JavaScript and will be renamed to pb_name.
|
||||||
|
* Optional fields that are not set will be set to undefined.
|
||||||
|
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
|
||||||
|
* For the list of reserved names please see:
|
||||||
|
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
|
||||||
|
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
|
||||||
|
* JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @return {!Object}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.toObject = function(opt_includeInstance) {
|
||||||
|
return proto.web_api.RoomsListReply.Room.toObject(opt_includeInstance, this);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static version of the {@see toObject} method.
|
||||||
|
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
|
||||||
|
* the JSPB instance for transitional soy proto support:
|
||||||
|
* http://goto/soy-param-migration
|
||||||
|
* @param {!proto.web_api.RoomsListReply.Room} msg The msg instance to transform.
|
||||||
|
* @return {!Object}
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.toObject = function(includeInstance, msg) {
|
||||||
|
var f, obj = {
|
||||||
|
roomId: jspb.Message.getFieldWithDefault(msg, 1, ""),
|
||||||
|
displayName: jspb.Message.getFieldWithDefault(msg, 2, "")
|
||||||
|
};
|
||||||
|
|
||||||
|
if (includeInstance) {
|
||||||
|
obj.$jspbMessageInstance = msg;
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format).
|
||||||
|
* @param {jspb.ByteSource} bytes The bytes to deserialize.
|
||||||
|
* @return {!proto.web_api.RoomsListReply.Room}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.deserializeBinary = function(bytes) {
|
||||||
|
var reader = new jspb.BinaryReader(bytes);
|
||||||
|
var msg = new proto.web_api.RoomsListReply.Room;
|
||||||
|
return proto.web_api.RoomsListReply.Room.deserializeBinaryFromReader(msg, reader);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes binary data (in protobuf wire format) from the
|
||||||
|
* given reader into the given message object.
|
||||||
|
* @param {!proto.web_api.RoomsListReply.Room} msg The message object to deserialize into.
|
||||||
|
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
|
||||||
|
* @return {!proto.web_api.RoomsListReply.Room}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.deserializeBinaryFromReader = function(msg, reader) {
|
||||||
|
while (reader.nextField()) {
|
||||||
|
if (reader.isEndGroup()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
var field = reader.getFieldNumber();
|
||||||
|
switch (field) {
|
||||||
|
case 1:
|
||||||
|
var value = /** @type {string} */ (reader.readString());
|
||||||
|
msg.setRoomId(value);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
var value = /** @type {string} */ (reader.readString());
|
||||||
|
msg.setDisplayName(value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reader.skipField();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return msg;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the message to binary data (in protobuf wire format).
|
||||||
|
* @return {!Uint8Array}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.serializeBinary = function() {
|
||||||
|
var writer = new jspb.BinaryWriter();
|
||||||
|
proto.web_api.RoomsListReply.Room.serializeBinaryToWriter(this, writer);
|
||||||
|
return writer.getResultBuffer();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes the given message to binary data (in protobuf wire
|
||||||
|
* format), writing to the given BinaryWriter.
|
||||||
|
* @param {!proto.web_api.RoomsListReply.Room} message
|
||||||
|
* @param {!jspb.BinaryWriter} writer
|
||||||
|
* @suppress {unusedLocalVariables} f is only used for nested messages
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.serializeBinaryToWriter = function(message, writer) {
|
||||||
|
var f = undefined;
|
||||||
|
f = message.getRoomId();
|
||||||
|
if (f.length > 0) {
|
||||||
|
writer.writeString(
|
||||||
|
1,
|
||||||
|
f
|
||||||
|
);
|
||||||
|
}
|
||||||
|
f = message.getDisplayName();
|
||||||
|
if (f.length > 0) {
|
||||||
|
writer.writeString(
|
||||||
|
2,
|
||||||
|
f
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* optional string room_id = 1;
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.getRoomId = function() {
|
||||||
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} value
|
||||||
|
* @return {!proto.web_api.RoomsListReply.Room} returns this
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.setRoomId = function(value) {
|
||||||
|
return jspb.Message.setProto3StringField(this, 1, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* optional string display_name = 2;
|
||||||
|
* @return {string}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.getDisplayName = function() {
|
||||||
|
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} value
|
||||||
|
* @return {!proto.web_api.RoomsListReply.Room} returns this
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.Room.prototype.setDisplayName = function(value) {
|
||||||
|
return jspb.Message.setProto3StringField(this, 2, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* repeated Room rooms = 1;
|
||||||
|
* @return {!Array<!proto.web_api.RoomsListReply.Room>}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.getRoomsList = function() {
|
||||||
|
return /** @type{!Array<!proto.web_api.RoomsListReply.Room>} */ (
|
||||||
|
jspb.Message.getRepeatedWrapperField(this, proto.web_api.RoomsListReply.Room, 1));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {!Array<!proto.web_api.RoomsListReply.Room>} value
|
||||||
|
* @return {!proto.web_api.RoomsListReply} returns this
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.setRoomsList = function(value) {
|
||||||
|
return jspb.Message.setRepeatedWrapperField(this, 1, value);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {!proto.web_api.RoomsListReply.Room=} opt_value
|
||||||
|
* @param {number=} opt_index
|
||||||
|
* @return {!proto.web_api.RoomsListReply.Room}
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.addRooms = function(opt_value, opt_index) {
|
||||||
|
return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.web_api.RoomsListReply.Room, opt_index);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the list making it empty but non-null.
|
||||||
|
* @return {!proto.web_api.RoomsListReply} returns this
|
||||||
|
*/
|
||||||
|
proto.web_api.RoomsListReply.prototype.clearRoomsList = function() {
|
||||||
|
return this.setRoomsList([]);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
goog.object.extend(exports, proto.web_api);
|
|
@ -0,0 +1,63 @@
|
||||||
|
// package: web_api
|
||||||
|
// file: web-api.proto
|
||||||
|
|
||||||
|
import * as web_api_pb from "./web-api_pb";
|
||||||
|
import {grpc} from "@improbable-eng/grpc-web";
|
||||||
|
|
||||||
|
type WebApiListRoom = {
|
||||||
|
readonly methodName: string;
|
||||||
|
readonly service: typeof WebApi;
|
||||||
|
readonly requestStream: false;
|
||||||
|
readonly responseStream: false;
|
||||||
|
readonly requestType: typeof web_api_pb.UserIdRequest;
|
||||||
|
readonly responseType: typeof web_api_pb.RoomsListReply;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class WebApi {
|
||||||
|
static readonly serviceName: string;
|
||||||
|
static readonly ListRoom: WebApiListRoom;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
|
||||||
|
export type Status = { details: string, code: number; metadata: grpc.Metadata }
|
||||||
|
|
||||||
|
interface UnaryResponse {
|
||||||
|
cancel(): void;
|
||||||
|
}
|
||||||
|
interface ResponseStream<T> {
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
|
||||||
|
}
|
||||||
|
interface RequestStream<T> {
|
||||||
|
write(message: T): RequestStream<T>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
|
||||||
|
}
|
||||||
|
interface BidirectionalStream<ReqT, ResT> {
|
||||||
|
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
|
||||||
|
end(): void;
|
||||||
|
cancel(): void;
|
||||||
|
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WebApiClient {
|
||||||
|
readonly serviceHost: string;
|
||||||
|
|
||||||
|
constructor(serviceHost: string, options?: grpc.RpcOptions);
|
||||||
|
listRoom(
|
||||||
|
requestMessage: web_api_pb.UserIdRequest,
|
||||||
|
metadata: grpc.Metadata,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: web_api_pb.RoomsListReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
listRoom(
|
||||||
|
requestMessage: web_api_pb.UserIdRequest,
|
||||||
|
callback: (error: ServiceError|null, responseMessage: web_api_pb.RoomsListReply|null) => void
|
||||||
|
): UnaryResponse;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
// package: web_api
|
||||||
|
// file: web-api.proto
|
||||||
|
|
||||||
|
var web_api_pb = require("./web-api_pb");
|
||||||
|
var grpc = require("@improbable-eng/grpc-web").grpc;
|
||||||
|
|
||||||
|
var WebApi = (function () {
|
||||||
|
function WebApi() {}
|
||||||
|
WebApi.serviceName = "web_api.WebApi";
|
||||||
|
return WebApi;
|
||||||
|
}());
|
||||||
|
|
||||||
|
WebApi.ListRoom = {
|
||||||
|
methodName: "ListRoom",
|
||||||
|
service: WebApi,
|
||||||
|
requestStream: false,
|
||||||
|
responseStream: false,
|
||||||
|
requestType: web_api_pb.UserIdRequest,
|
||||||
|
responseType: web_api_pb.RoomsListReply
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.WebApi = WebApi;
|
||||||
|
|
||||||
|
function WebApiClient(serviceHost, options) {
|
||||||
|
this.serviceHost = serviceHost;
|
||||||
|
this.options = options || {};
|
||||||
|
}
|
||||||
|
|
||||||
|
WebApiClient.prototype.listRoom = function listRoom(requestMessage, metadata, callback) {
|
||||||
|
if (arguments.length === 2) {
|
||||||
|
callback = arguments[1];
|
||||||
|
}
|
||||||
|
var client = grpc.unary(WebApi.ListRoom, {
|
||||||
|
request: requestMessage,
|
||||||
|
host: this.serviceHost,
|
||||||
|
metadata: metadata,
|
||||||
|
transport: this.options.transport,
|
||||||
|
debug: this.options.debug,
|
||||||
|
onEnd: function (response) {
|
||||||
|
if (callback) {
|
||||||
|
if (response.status !== grpc.Code.OK) {
|
||||||
|
var err = new Error(response.statusMessage);
|
||||||
|
err.code = response.status;
|
||||||
|
err.metadata = response.trailers;
|
||||||
|
callback(err, null);
|
||||||
|
} else {
|
||||||
|
callback(null, response.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
cancel: function () {
|
||||||
|
callback = null;
|
||||||
|
client.close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.WebApiClient = WebApiClient;
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
const {HelloRequest, HelloReply} = require('./helloworld_pb.js');
|
||||||
|
const {GreeterClient} = require('./helloworld_grpc_web_pb.js');
|
||||||
|
|
||||||
|
var client = new GreeterClient('http://localhost:8080');
|
||||||
|
|
||||||
|
var request = new HelloRequest();
|
||||||
|
request.setName('World');
|
||||||
|
|
||||||
|
client.sayHello(request, {}, (err, response) => {
|
||||||
|
console.log(response.getMessage());
|
||||||
|
});
|
|
@ -0,0 +1,19 @@
|
||||||
|
import { grpc } from "@improbable-eng/grpc-web";
|
||||||
|
|
||||||
|
// Import code-generated data structures.
|
||||||
|
import { WebApi, WebApiClient } from "./_proto/web-api_pb_service";
|
||||||
|
import { UserIdRequest, RoomsListReply } from "./_proto/web-api_pb";
|
||||||
|
|
||||||
|
const listRoomsRequest = new UserIdRequest();
|
||||||
|
listRoomsRequest.setUserId("@projectmoon:agnos.is");
|
||||||
|
grpc.unary(WebApi.ListRoom, {
|
||||||
|
request: listRoomsRequest,
|
||||||
|
host: "http://localhost:10000",
|
||||||
|
onEnd: res => {
|
||||||
|
const { status, statusMessage, headers, message, trailers } = res;
|
||||||
|
console.log(status, '-', statusMessage);
|
||||||
|
if (status === grpc.Code.OK && message) {
|
||||||
|
console.log("all ok. got rooms: ", message.toObject());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,9 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>Webpack App</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"></head>
|
||||||
|
<body>
|
||||||
|
<script src="app.bundle.js"></script></body>
|
||||||
|
</html>
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>gRPC-Web Example</title>
|
||||||
|
<script src="./dist/main.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<p>Open up the developer console and see the logs for the output.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1 @@
|
||||||
|
../acorn/bin/acorn
|
|
@ -0,0 +1 @@
|
||||||
|
../ansi-html/bin/ansi-html
|
|
@ -0,0 +1 @@
|
||||||
|
../atob/bin/atob.js
|
|
@ -0,0 +1 @@
|
||||||
|
../browserslist/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../envinfo/dist/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../errno/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../he/bin/he
|
|
@ -0,0 +1 @@
|
||||||
|
../html-minifier-terser/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../import-local/fixtures/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../json5/lib/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../mime/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../mkdirp/bin/cmd.js
|
|
@ -0,0 +1 @@
|
||||||
|
../multicast-dns/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../ts-protoc-gen/bin/protoc-gen-ts
|
|
@ -0,0 +1 @@
|
||||||
|
../rimraf/bin.js
|
|
@ -0,0 +1 @@
|
||||||
|
../default-gateway/node_modules/semver/bin/semver
|
|
@ -0,0 +1 @@
|
||||||
|
../terser/bin/terser
|
|
@ -0,0 +1 @@
|
||||||
|
../typescript/bin/tsc
|
|
@ -0,0 +1 @@
|
||||||
|
../typescript/bin/tsserver
|
|
@ -0,0 +1 @@
|
||||||
|
../uuid/bin/uuid
|
|
@ -0,0 +1 @@
|
||||||
|
../webpack/bin/webpack.js
|
|
@ -0,0 +1 @@
|
||||||
|
../webpack-cli/bin/cli.js
|
|
@ -0,0 +1 @@
|
||||||
|
../webpack-dev-server/bin/webpack-dev-server.js
|
|
@ -0,0 +1 @@
|
||||||
|
../default-gateway/node_modules/which/bin/which
|
|
@ -0,0 +1,657 @@
|
||||||
|
{
|
||||||
|
"systemParams": "linux-x64-83",
|
||||||
|
"modulesFolders": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"flags": [],
|
||||||
|
"linkedModules": [],
|
||||||
|
"topLevelPatterns": [
|
||||||
|
"@improbable-eng/grpc-web@^0.13.0",
|
||||||
|
"@types/google-protobuf@^3.7.4",
|
||||||
|
"clean-webpack-plugin@^3.0.0",
|
||||||
|
"compression-webpack-plugin@^7.1.2",
|
||||||
|
"google-protobuf@^3.14.0",
|
||||||
|
"html-webpack-plugin@^4.5.0",
|
||||||
|
"jsx-dom@^7.0.0-beta.0",
|
||||||
|
"ts-loader@^8.0.13",
|
||||||
|
"ts-protoc-gen@^0.14.0",
|
||||||
|
"typescript@^4.1.3",
|
||||||
|
"webpack-cli@^4.3.1",
|
||||||
|
"webpack-dev-server@^3.11.1",
|
||||||
|
"webpack@^5.11.1"
|
||||||
|
],
|
||||||
|
"lockfileEntries": {
|
||||||
|
"@discoveryjs/json-ext@^0.5.0": "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz#90420f9f9c6d3987f176a19a7d8e764271a2f55d",
|
||||||
|
"@improbable-eng/grpc-web@^0.13.0": "https://registry.yarnpkg.com/@improbable-eng/grpc-web/-/grpc-web-0.13.0.tgz#289e6fc4dafc00b1af8e2b93b970e6892299014d",
|
||||||
|
"@types/eslint-scope@^3.7.0": "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.0.tgz#4792816e31119ebd506902a482caec4951fabd86",
|
||||||
|
"@types/eslint@*": "https://registry.yarnpkg.com/@types/eslint/-/eslint-7.2.13.tgz#e0ca7219ba5ded402062ad6f926d491ebb29dd53",
|
||||||
|
"@types/estree@*": "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.48.tgz#18dc8091b285df90db2f25aa7d906cfc394b7f74",
|
||||||
|
"@types/estree@^0.0.47": "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.47.tgz#d7a51db20f0650efec24cd04994f523d93172ed4",
|
||||||
|
"@types/glob@^7.1.1": "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183",
|
||||||
|
"@types/google-protobuf@^3.7.4": "https://registry.yarnpkg.com/@types/google-protobuf/-/google-protobuf-3.15.2.tgz#70753e948cabeb416d71299dc35c3f562a10fb0f",
|
||||||
|
"@types/html-minifier-terser@^5.0.0": "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#3c9ee980f1a10d6021ae6632ca3e79ca2ec4fb50",
|
||||||
|
"@types/json-schema@*": "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad",
|
||||||
|
"@types/json-schema@^7.0.6": "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.7.tgz#98a993516c859eb0d5c4c8f098317a9ea68db9ad",
|
||||||
|
"@types/minimatch@*": "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21",
|
||||||
|
"@types/node@*": "https://registry.yarnpkg.com/@types/node/-/node-15.6.2.tgz#c61d49f38af70da32424b5322eee21f97e627175",
|
||||||
|
"@types/source-list-map@*": "https://registry.yarnpkg.com/@types/source-list-map/-/source-list-map-0.1.2.tgz#0078836063ffaf17412349bba364087e0ac02ec9",
|
||||||
|
"@types/tapable@^1": "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4",
|
||||||
|
"@types/tapable@^1.0.5": "https://registry.yarnpkg.com/@types/tapable/-/tapable-1.0.7.tgz#545158342f949e8fd3bfd813224971ecddc3fac4",
|
||||||
|
"@types/uglify-js@*": "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.13.0.tgz#1cad8df1fb0b143c5aba08de5712ea9d1ff71124",
|
||||||
|
"@types/webpack-sources@*": "https://registry.yarnpkg.com/@types/webpack-sources/-/webpack-sources-2.1.0.tgz#8882b0bd62d1e0ce62f183d0d01b72e6e82e8c10",
|
||||||
|
"@types/webpack@^4.4.31": "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.29.tgz#2e66c1de8223c440366469415c50a47d97625773",
|
||||||
|
"@types/webpack@^4.41.8": "https://registry.yarnpkg.com/@types/webpack/-/webpack-4.41.29.tgz#2e66c1de8223c440366469415c50a47d97625773",
|
||||||
|
"@webassemblyjs/ast@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.0.tgz#a5aa679efdc9e51707a4207139da57920555961f",
|
||||||
|
"@webassemblyjs/floating-point-hex-parser@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.0.tgz#34d62052f453cd43101d72eab4966a022587947c",
|
||||||
|
"@webassemblyjs/helper-api-error@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.0.tgz#aaea8fb3b923f4aaa9b512ff541b013ffb68d2d4",
|
||||||
|
"@webassemblyjs/helper-buffer@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.0.tgz#d026c25d175e388a7dbda9694e91e743cbe9b642",
|
||||||
|
"@webassemblyjs/helper-numbers@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.0.tgz#7ab04172d54e312cc6ea4286d7d9fa27c88cd4f9",
|
||||||
|
"@webassemblyjs/helper-wasm-bytecode@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.0.tgz#85fdcda4129902fe86f81abf7e7236953ec5a4e1",
|
||||||
|
"@webassemblyjs/helper-wasm-section@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.0.tgz#9ce2cc89300262509c801b4af113d1ca25c1a75b",
|
||||||
|
"@webassemblyjs/ieee754@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.0.tgz#46975d583f9828f5d094ac210e219441c4e6f5cf",
|
||||||
|
"@webassemblyjs/leb128@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.0.tgz#f7353de1df38aa201cba9fb88b43f41f75ff403b",
|
||||||
|
"@webassemblyjs/utf8@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.0.tgz#86e48f959cf49e0e5091f069a709b862f5a2cadf",
|
||||||
|
"@webassemblyjs/wasm-edit@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.0.tgz#ee4a5c9f677046a210542ae63897094c2027cb78",
|
||||||
|
"@webassemblyjs/wasm-gen@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.0.tgz#3cdb35e70082d42a35166988dda64f24ceb97abe",
|
||||||
|
"@webassemblyjs/wasm-opt@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.0.tgz#1638ae188137f4bb031f568a413cd24d32f92978",
|
||||||
|
"@webassemblyjs/wasm-parser@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.0.tgz#3e680b8830d5b13d1ec86cc42f38f3d4a7700754",
|
||||||
|
"@webassemblyjs/wast-printer@1.11.0": "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.0.tgz#680d1f6a5365d6d401974a8e949e05474e1fab7e",
|
||||||
|
"@webpack-cli/configtest@^1.0.3": "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-1.0.3.tgz#204bcff87cda3ea4810881f7ea96e5f5321b87b9",
|
||||||
|
"@webpack-cli/info@^1.2.4": "https://registry.yarnpkg.com/@webpack-cli/info/-/info-1.2.4.tgz#7381fd41c9577b2d8f6c2594fad397ef49ad5573",
|
||||||
|
"@webpack-cli/serve@^1.4.0": "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-1.4.0.tgz#f84fd07bcacefe56ce762925798871092f0f228e",
|
||||||
|
"@xtuc/ieee754@^1.2.0": "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790",
|
||||||
|
"@xtuc/long@4.2.2": "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d",
|
||||||
|
"accepts@~1.3.4": "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd",
|
||||||
|
"accepts@~1.3.5": "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd",
|
||||||
|
"accepts@~1.3.7": "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd",
|
||||||
|
"acorn@^8.2.1": "https://registry.yarnpkg.com/acorn/-/acorn-8.3.0.tgz#1193f9b96c4e8232f00b11a9edff81b2c8b98b88",
|
||||||
|
"ajv-errors@^1.0.0": "https://registry.yarnpkg.com/ajv-errors/-/ajv-errors-1.0.1.tgz#f35986aceb91afadec4102fbd85014950cefa64d",
|
||||||
|
"ajv-keywords@^3.1.0": "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d",
|
||||||
|
"ajv-keywords@^3.5.2": "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d",
|
||||||
|
"ajv@^6.1.0": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
||||||
|
"ajv@^6.12.5": "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4",
|
||||||
|
"ansi-colors@^3.0.0": "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.4.tgz#e3a3da4bfbae6c86a9c285625de124a234026fbf",
|
||||||
|
"ansi-html@0.0.7": "https://registry.yarnpkg.com/ansi-html/-/ansi-html-0.0.7.tgz#813584021962a9e9e6fd039f940d12f56ca7859e",
|
||||||
|
"ansi-regex@^2.0.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df",
|
||||||
|
"ansi-regex@^4.1.0": "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997",
|
||||||
|
"ansi-styles@^3.2.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
||||||
|
"ansi-styles@^4.1.0": "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937",
|
||||||
|
"anymatch@^2.0.0": "https://registry.yarnpkg.com/anymatch/-/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb",
|
||||||
|
"anymatch@^3.0.0": "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716",
|
||||||
|
"arr-diff@^4.0.0": "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520",
|
||||||
|
"arr-flatten@^1.1.0": "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1",
|
||||||
|
"arr-union@^3.1.0": "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4",
|
||||||
|
"array-flatten@1.1.1": "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2",
|
||||||
|
"array-flatten@^2.1.0": "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099",
|
||||||
|
"array-union@^1.0.1": "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39",
|
||||||
|
"array-uniq@^1.0.1": "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6",
|
||||||
|
"array-unique@^0.3.2": "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428",
|
||||||
|
"assign-symbols@^1.0.0": "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367",
|
||||||
|
"async-each@^1.0.1": "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf",
|
||||||
|
"async-limiter@~1.0.0": "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd",
|
||||||
|
"async@^2.6.2": "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff",
|
||||||
|
"atob@^2.1.2": "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9",
|
||||||
|
"balanced-match@^1.0.0": "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee",
|
||||||
|
"base@^0.11.1": "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f",
|
||||||
|
"batch@0.6.1": "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16",
|
||||||
|
"big.js@^5.2.2": "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328",
|
||||||
|
"binary-extensions@^1.0.0": "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65",
|
||||||
|
"bindings@^1.5.0": "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df",
|
||||||
|
"body-parser@1.19.0": "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a",
|
||||||
|
"bonjour@^3.5.0": "https://registry.yarnpkg.com/bonjour/-/bonjour-3.5.0.tgz#8e890a183d8ee9a2393b3844c691a42bcf7bc9f5",
|
||||||
|
"boolbase@^1.0.0": "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e",
|
||||||
|
"boolbase@~1.0.0": "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e",
|
||||||
|
"brace-expansion@^1.1.7": "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
||||||
|
"braces@^2.3.1": "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729",
|
||||||
|
"braces@^2.3.2": "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729",
|
||||||
|
"braces@^3.0.1": "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107",
|
||||||
|
"browser-headers@^0.4.0": "https://registry.yarnpkg.com/browser-headers/-/browser-headers-0.4.1.tgz#4308a7ad3b240f4203dbb45acedb38dc2d65dd02",
|
||||||
|
"browserslist@^4.14.5": "https://registry.yarnpkg.com/browserslist/-/browserslist-4.16.6.tgz#d7901277a5a88e554ed305b183ec9b0c08f66fa2",
|
||||||
|
"buffer-from@^1.0.0": "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
|
||||||
|
"buffer-indexof@^1.0.0": "https://registry.yarnpkg.com/buffer-indexof/-/buffer-indexof-1.1.1.tgz#52fabcc6a606d1a00302802648ef68f639da268c",
|
||||||
|
"bytes@3.0.0": "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048",
|
||||||
|
"bytes@3.1.0": "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6",
|
||||||
|
"cache-base@^1.0.1": "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2",
|
||||||
|
"call-bind@^1.0.0": "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c",
|
||||||
|
"call-bind@^1.0.2": "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c",
|
||||||
|
"camel-case@^4.1.1": "https://registry.yarnpkg.com/camel-case/-/camel-case-4.1.2.tgz#9728072a954f805228225a6deea6b38461e1bd5a",
|
||||||
|
"camelcase@^5.0.0": "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320",
|
||||||
|
"caniuse-lite@^1.0.30001219": "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001233.tgz#b7cb4a377a4b12ed240d2fa5c792951a06e5f2c4",
|
||||||
|
"chalk@^4.1.0": "https://registry.yarnpkg.com/chalk/-/chalk-4.1.1.tgz#c80b3fab28bf6371e6863325eee67e618b77e6ad",
|
||||||
|
"chokidar@^2.1.8": "https://registry.yarnpkg.com/chokidar/-/chokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917",
|
||||||
|
"chrome-trace-event@^1.0.2": "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz#1015eced4741e15d06664a957dbbf50d041e26ac",
|
||||||
|
"class-utils@^0.3.5": "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463",
|
||||||
|
"clean-css@^4.2.3": "https://registry.yarnpkg.com/clean-css/-/clean-css-4.2.3.tgz#507b5de7d97b48ee53d84adb0160ff6216380f78",
|
||||||
|
"clean-webpack-plugin@^3.0.0": "https://registry.yarnpkg.com/clean-webpack-plugin/-/clean-webpack-plugin-3.0.0.tgz#a99d8ec34c1c628a4541567aa7b457446460c62b",
|
||||||
|
"cliui@^5.0.0": "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5",
|
||||||
|
"clone-deep@^4.0.1": "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387",
|
||||||
|
"collection-visit@^1.0.0": "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0",
|
||||||
|
"color-convert@^1.9.0": "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8",
|
||||||
|
"color-convert@^2.0.1": "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
|
||||||
|
"color-name@1.1.3": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25",
|
||||||
|
"color-name@~1.1.4": "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2",
|
||||||
|
"colorette@^1.2.1": "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94",
|
||||||
|
"colorette@^1.2.2": "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94",
|
||||||
|
"commander@^2.20.0": "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33",
|
||||||
|
"commander@^4.1.1": "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068",
|
||||||
|
"commander@^7.0.0": "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7",
|
||||||
|
"component-emitter@^1.2.1": "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0",
|
||||||
|
"compressible@~2.0.16": "https://registry.yarnpkg.com/compressible/-/compressible-2.0.18.tgz#af53cca6b070d4c3c0750fbd77286a6d7cc46fba",
|
||||||
|
"compression-webpack-plugin@^7.1.2": "https://registry.yarnpkg.com/compression-webpack-plugin/-/compression-webpack-plugin-7.1.2.tgz#f9a1ba84d4879693e29726f6884b382940876597",
|
||||||
|
"compression@^1.7.4": "https://registry.yarnpkg.com/compression/-/compression-1.7.4.tgz#95523eff170ca57c29a0ca41e6fe131f41e5bb8f",
|
||||||
|
"concat-map@0.0.1": "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
||||||
|
"connect-history-api-fallback@^1.6.0": "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc",
|
||||||
|
"content-disposition@0.5.3": "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd",
|
||||||
|
"content-type@~1.0.4": "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b",
|
||||||
|
"cookie-signature@1.0.6": "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c",
|
||||||
|
"cookie@0.4.0": "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba",
|
||||||
|
"copy-descriptor@^0.1.0": "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d",
|
||||||
|
"core-util-is@~1.0.0": "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7",
|
||||||
|
"cross-spawn@^6.0.0": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4",
|
||||||
|
"cross-spawn@^7.0.3": "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6",
|
||||||
|
"css-select@^2.0.2": "https://registry.yarnpkg.com/css-select/-/css-select-2.1.0.tgz#6a34653356635934a81baca68d0255432105dbef",
|
||||||
|
"css-what@^3.2.1": "https://registry.yarnpkg.com/css-what/-/css-what-3.4.2.tgz#ea7026fcb01777edbde52124e21f327e7ae950e4",
|
||||||
|
"csstype@^3.0.8": "https://registry.yarnpkg.com/csstype/-/csstype-3.0.8.tgz#d2266a792729fb227cd216fb572f43728e1ad340",
|
||||||
|
"debug@2.6.9": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
|
||||||
|
"debug@^2.2.0": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
|
||||||
|
"debug@^2.3.3": "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
|
||||||
|
"debug@^3.1.1": "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a",
|
||||||
|
"debug@^3.2.6": "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a",
|
||||||
|
"debug@^4.1.0": "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee",
|
||||||
|
"debug@^4.1.1": "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee",
|
||||||
|
"decamelize@^1.2.0": "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290",
|
||||||
|
"decode-uri-component@^0.2.0": "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545",
|
||||||
|
"deep-equal@^1.0.1": "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a",
|
||||||
|
"default-gateway@^4.2.0": "https://registry.yarnpkg.com/default-gateway/-/default-gateway-4.2.0.tgz#167104c7500c2115f6dd69b0a536bb8ed720552b",
|
||||||
|
"define-properties@^1.1.2": "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1",
|
||||||
|
"define-properties@^1.1.3": "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1",
|
||||||
|
"define-property@^0.2.5": "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116",
|
||||||
|
"define-property@^1.0.0": "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6",
|
||||||
|
"define-property@^2.0.2": "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d",
|
||||||
|
"del@^4.1.1": "https://registry.yarnpkg.com/del/-/del-4.1.1.tgz#9e8f117222ea44a31ff3a156c049b99052a9f0b4",
|
||||||
|
"depd@~1.1.2": "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9",
|
||||||
|
"destroy@~1.0.4": "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80",
|
||||||
|
"detect-node@^2.0.4": "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1",
|
||||||
|
"dns-equal@^1.0.0": "https://registry.yarnpkg.com/dns-equal/-/dns-equal-1.0.0.tgz#b39e7f1da6eb0a75ba9c17324b34753c47e0654d",
|
||||||
|
"dns-packet@^1.3.1": "https://registry.yarnpkg.com/dns-packet/-/dns-packet-1.3.4.tgz#e3455065824a2507ba886c55a89963bb107dec6f",
|
||||||
|
"dns-txt@^2.0.2": "https://registry.yarnpkg.com/dns-txt/-/dns-txt-2.0.2.tgz#b91d806f5d27188e4ab3e7d107d881a1cc4642b6",
|
||||||
|
"dom-converter@^0.2": "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768",
|
||||||
|
"dom-serializer@0": "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51",
|
||||||
|
"domelementtype@1": "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f",
|
||||||
|
"domelementtype@^1.3.1": "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f",
|
||||||
|
"domelementtype@^2.0.1": "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.2.0.tgz#9a0b6c2782ed6a1c7323d42267183df9bd8b1d57",
|
||||||
|
"domhandler@^2.3.0": "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803",
|
||||||
|
"domutils@^1.5.1": "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a",
|
||||||
|
"domutils@^1.7.0": "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a",
|
||||||
|
"dot-case@^3.0.4": "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751",
|
||||||
|
"ee-first@1.1.1": "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d",
|
||||||
|
"electron-to-chromium@^1.3.723": "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.744.tgz#34e0da7babb325e18b50d3a0214504b12045ca85",
|
||||||
|
"emoji-regex@^7.0.1": "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156",
|
||||||
|
"emojis-list@^3.0.0": "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78",
|
||||||
|
"encodeurl@~1.0.2": "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59",
|
||||||
|
"end-of-stream@^1.1.0": "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0",
|
||||||
|
"enhanced-resolve@^4.0.0": "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec",
|
||||||
|
"enhanced-resolve@^5.8.0": "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.8.2.tgz#15ddc779345cbb73e97c611cd00c01c1e7bf4d8b",
|
||||||
|
"entities@^1.1.1": "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56",
|
||||||
|
"entities@^2.0.0": "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55",
|
||||||
|
"envinfo@^7.7.3": "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475",
|
||||||
|
"errno@^0.1.3": "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f",
|
||||||
|
"es-abstract@^1.18.0-next.2": "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.18.3.tgz#25c4c3380a27aa203c44b2b685bba94da31b63e0",
|
||||||
|
"es-module-lexer@^0.4.0": "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.4.1.tgz#dda8c6a14d8f340a24e34331e0fab0cb50438e0e",
|
||||||
|
"es-to-primitive@^1.2.1": "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a",
|
||||||
|
"escalade@^3.1.1": "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40",
|
||||||
|
"escape-html@~1.0.3": "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988",
|
||||||
|
"eslint-scope@5.1.1": "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c",
|
||||||
|
"esrecurse@^4.3.0": "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921",
|
||||||
|
"estraverse@^4.1.1": "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
||||||
|
"estraverse@^5.2.0": "https://registry.yarnpkg.com/estraverse/-/estraverse-5.2.0.tgz#307df42547e6cc7324d3cf03c155d5cdb8c53880",
|
||||||
|
"etag@~1.8.1": "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887",
|
||||||
|
"eventemitter3@^4.0.0": "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f",
|
||||||
|
"events@^3.2.0": "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400",
|
||||||
|
"eventsource@^1.0.7": "https://registry.yarnpkg.com/eventsource/-/eventsource-1.1.0.tgz#00e8ca7c92109e94b0ddf32dac677d841028cfaf",
|
||||||
|
"execa@^1.0.0": "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8",
|
||||||
|
"execa@^5.0.0": "https://registry.yarnpkg.com/execa/-/execa-5.1.0.tgz#3ea50ee863d226bfa323528cce1684e7481dfe46",
|
||||||
|
"expand-brackets@^2.1.4": "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622",
|
||||||
|
"express@^4.17.1": "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134",
|
||||||
|
"extend-shallow@^2.0.1": "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f",
|
||||||
|
"extend-shallow@^3.0.0": "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8",
|
||||||
|
"extend-shallow@^3.0.2": "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8",
|
||||||
|
"extglob@^2.0.4": "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543",
|
||||||
|
"fast-deep-equal@^3.1.1": "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525",
|
||||||
|
"fast-json-stable-stringify@^2.0.0": "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
||||||
|
"fastest-levenshtein@^1.0.12": "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.12.tgz#9990f7d3a88cc5a9ffd1f1745745251700d497e2",
|
||||||
|
"faye-websocket@^0.11.3": "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.11.4.tgz#7f0d9275cfdd86a1c963dc8b65fcc451edcbb1da",
|
||||||
|
"file-uri-to-path@1.0.0": "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd",
|
||||||
|
"fill-range@^4.0.0": "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7",
|
||||||
|
"fill-range@^7.0.1": "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40",
|
||||||
|
"finalhandler@~1.1.2": "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d",
|
||||||
|
"find-up@^3.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73",
|
||||||
|
"find-up@^4.0.0": "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19",
|
||||||
|
"follow-redirects@^1.0.0": "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43",
|
||||||
|
"for-in@^1.0.2": "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80",
|
||||||
|
"forwarded@0.2.0": "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811",
|
||||||
|
"fragment-cache@^0.2.1": "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19",
|
||||||
|
"fresh@0.5.2": "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7",
|
||||||
|
"fs.realpath@^1.0.0": "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
|
||||||
|
"fsevents@^1.2.7": "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38",
|
||||||
|
"function-bind@^1.1.1": "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d",
|
||||||
|
"get-caller-file@^2.0.1": "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e",
|
||||||
|
"get-intrinsic@^1.0.2": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6",
|
||||||
|
"get-intrinsic@^1.1.1": "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6",
|
||||||
|
"get-stream@^4.0.0": "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5",
|
||||||
|
"get-stream@^6.0.0": "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7",
|
||||||
|
"get-value@^2.0.3": "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28",
|
||||||
|
"get-value@^2.0.6": "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28",
|
||||||
|
"glob-parent@^3.1.0": "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae",
|
||||||
|
"glob-to-regexp@^0.4.1": "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e",
|
||||||
|
"glob@^7.0.3": "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
||||||
|
"glob@^7.1.3": "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90",
|
||||||
|
"globby@^6.1.0": "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c",
|
||||||
|
"google-protobuf@^3.14.0": "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.17.2.tgz#7708eec9cf4a4dcdb624201f1ba1045994a6c22e",
|
||||||
|
"google-protobuf@^3.6.1": "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.17.2.tgz#7708eec9cf4a4dcdb624201f1ba1045994a6c22e",
|
||||||
|
"graceful-fs@^4.1.11": "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee",
|
||||||
|
"graceful-fs@^4.1.2": "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee",
|
||||||
|
"graceful-fs@^4.2.4": "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee",
|
||||||
|
"handle-thing@^2.0.0": "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e",
|
||||||
|
"has-bigints@^1.0.1": "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113",
|
||||||
|
"has-flag@^3.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd",
|
||||||
|
"has-flag@^4.0.0": "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b",
|
||||||
|
"has-symbols@^1.0.1": "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423",
|
||||||
|
"has-symbols@^1.0.2": "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423",
|
||||||
|
"has-value@^0.3.1": "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f",
|
||||||
|
"has-value@^1.0.0": "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177",
|
||||||
|
"has-values@^0.1.4": "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771",
|
||||||
|
"has-values@^1.0.0": "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f",
|
||||||
|
"has@^1.0.3": "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796",
|
||||||
|
"he@^1.2.0": "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f",
|
||||||
|
"hpack.js@^2.1.6": "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2",
|
||||||
|
"html-entities@^1.3.1": "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc",
|
||||||
|
"html-minifier-terser@^5.0.1": "https://registry.yarnpkg.com/html-minifier-terser/-/html-minifier-terser-5.1.1.tgz#922e96f1f3bb60832c2634b79884096389b1f054",
|
||||||
|
"html-webpack-plugin@^4.5.0": "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.5.2.tgz#76fc83fa1a0f12dd5f7da0404a54e2699666bc12",
|
||||||
|
"htmlparser2@^3.10.1": "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f",
|
||||||
|
"http-deceiver@^1.2.7": "https://registry.yarnpkg.com/http-deceiver/-/http-deceiver-1.2.7.tgz#fa7168944ab9a519d337cb0bec7284dc3e723d87",
|
||||||
|
"http-errors@1.7.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f",
|
||||||
|
"http-errors@~1.6.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.6.3.tgz#8b55680bb4be283a0b5bf4ea2e38580be1d9320d",
|
||||||
|
"http-errors@~1.7.2": "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06",
|
||||||
|
"http-parser-js@>=0.5.1": "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9",
|
||||||
|
"http-proxy-middleware@0.19.1": "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-0.19.1.tgz#183c7dc4aa1479150306498c210cdaf96080a43a",
|
||||||
|
"http-proxy@^1.17.0": "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549",
|
||||||
|
"human-signals@^2.1.0": "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0",
|
||||||
|
"iconv-lite@0.4.24": "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b",
|
||||||
|
"import-local@^2.0.0": "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d",
|
||||||
|
"import-local@^3.0.2": "https://registry.yarnpkg.com/import-local/-/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6",
|
||||||
|
"inflight@^1.0.4": "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9",
|
||||||
|
"inherits@2": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inherits@2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de",
|
||||||
|
"inherits@2.0.4": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inherits@^2.0.1": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inherits@^2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inherits@^2.0.4": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inherits@~2.0.3": "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"internal-ip@^4.3.0": "https://registry.yarnpkg.com/internal-ip/-/internal-ip-4.3.0.tgz#845452baad9d2ca3b69c635a137acb9a0dad0907",
|
||||||
|
"interpret@^2.2.0": "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9",
|
||||||
|
"ip-regex@^2.1.0": "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9",
|
||||||
|
"ip@^1.1.0": "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a",
|
||||||
|
"ip@^1.1.5": "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a",
|
||||||
|
"ipaddr.js@1.9.1": "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3",
|
||||||
|
"ipaddr.js@^1.9.0": "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3",
|
||||||
|
"is-absolute-url@^3.0.3": "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-3.0.3.tgz#96c6a22b6a23929b11ea0afb1836c36ad4a5d698",
|
||||||
|
"is-accessor-descriptor@^0.1.6": "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6",
|
||||||
|
"is-accessor-descriptor@^1.0.0": "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656",
|
||||||
|
"is-arguments@^1.0.4": "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.0.tgz#62353031dfbee07ceb34656a6bde59efecae8dd9",
|
||||||
|
"is-bigint@^1.0.1": "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.2.tgz#ffb381442503235ad245ea89e45b3dbff040ee5a",
|
||||||
|
"is-binary-path@^1.0.0": "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898",
|
||||||
|
"is-boolean-object@^1.1.0": "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.1.tgz#3c0878f035cb821228d350d2e1e36719716a3de8",
|
||||||
|
"is-buffer@^1.1.5": "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be",
|
||||||
|
"is-callable@^1.1.4": "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e",
|
||||||
|
"is-callable@^1.2.3": "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.3.tgz#8b1e0500b73a1d76c70487636f368e519de8db8e",
|
||||||
|
"is-core-module@^2.2.0": "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.4.0.tgz#8e9fc8e15027b011418026e98f0e6f4d86305cc1",
|
||||||
|
"is-data-descriptor@^0.1.4": "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56",
|
||||||
|
"is-data-descriptor@^1.0.0": "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7",
|
||||||
|
"is-date-object@^1.0.1": "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.4.tgz#550cfcc03afada05eea3dd30981c7b09551f73e5",
|
||||||
|
"is-descriptor@^0.1.0": "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca",
|
||||||
|
"is-descriptor@^1.0.0": "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec",
|
||||||
|
"is-descriptor@^1.0.2": "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec",
|
||||||
|
"is-extendable@^0.1.0": "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89",
|
||||||
|
"is-extendable@^0.1.1": "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89",
|
||||||
|
"is-extendable@^1.0.1": "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4",
|
||||||
|
"is-extglob@^2.1.0": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
|
||||||
|
"is-extglob@^2.1.1": "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
|
||||||
|
"is-fullwidth-code-point@^2.0.0": "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f",
|
||||||
|
"is-glob@^3.1.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-3.1.0.tgz#7ba5ae24217804ac70707b96922567486cc3e84a",
|
||||||
|
"is-glob@^4.0.0": "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
|
||||||
|
"is-negative-zero@^2.0.1": "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24",
|
||||||
|
"is-number-object@^1.0.4": "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.5.tgz#6edfaeed7950cff19afedce9fbfca9ee6dd289eb",
|
||||||
|
"is-number@^3.0.0": "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195",
|
||||||
|
"is-number@^7.0.0": "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b",
|
||||||
|
"is-path-cwd@^2.0.0": "https://registry.yarnpkg.com/is-path-cwd/-/is-path-cwd-2.2.0.tgz#67d43b82664a7b5191fd9119127eb300048a9fdb",
|
||||||
|
"is-path-in-cwd@^2.0.0": "https://registry.yarnpkg.com/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz#bfe2dca26c69f397265a4009963602935a053acb",
|
||||||
|
"is-path-inside@^2.1.0": "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-2.1.0.tgz#7c9810587d659a40d27bcdb4d5616eab059494b2",
|
||||||
|
"is-plain-object@^2.0.3": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677",
|
||||||
|
"is-plain-object@^2.0.4": "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677",
|
||||||
|
"is-regex@^1.0.4": "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f",
|
||||||
|
"is-regex@^1.1.3": "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.3.tgz#d029f9aff6448b93ebbe3f33dac71511fdcbef9f",
|
||||||
|
"is-stream@^1.1.0": "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44",
|
||||||
|
"is-stream@^2.0.0": "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3",
|
||||||
|
"is-string@^1.0.5": "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f",
|
||||||
|
"is-string@^1.0.6": "https://registry.yarnpkg.com/is-string/-/is-string-1.0.6.tgz#3fe5d5992fb0d93404f32584d4b0179a71b54a5f",
|
||||||
|
"is-symbol@^1.0.2": "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c",
|
||||||
|
"is-symbol@^1.0.3": "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c",
|
||||||
|
"is-windows@^1.0.2": "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d",
|
||||||
|
"is-wsl@^1.1.0": "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d",
|
||||||
|
"isarray@1.0.0": "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11",
|
||||||
|
"isarray@~1.0.0": "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11",
|
||||||
|
"isexe@^2.0.0": "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10",
|
||||||
|
"isobject@^2.0.0": "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89",
|
||||||
|
"isobject@^3.0.0": "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df",
|
||||||
|
"isobject@^3.0.1": "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df",
|
||||||
|
"jest-worker@^27.0.2": "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.0.2.tgz#4ebeb56cef48b3e7514552f80d0d80c0129f0b05",
|
||||||
|
"json-parse-better-errors@^1.0.2": "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9",
|
||||||
|
"json-schema-traverse@^0.4.1": "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660",
|
||||||
|
"json3@^3.3.3": "https://registry.yarnpkg.com/json3/-/json3-3.3.3.tgz#7fc10e375fc5ae42c4705a5cc0aa6f62be305b81",
|
||||||
|
"json5@^1.0.1": "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe",
|
||||||
|
"json5@^2.1.2": "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3",
|
||||||
|
"jsx-dom@^7.0.0-beta.0": "https://registry.yarnpkg.com/jsx-dom/-/jsx-dom-7.0.1.tgz#2147ac43825649bf6d545d4d861aab27aadd403b",
|
||||||
|
"killable@^1.0.1": "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892",
|
||||||
|
"kind-of@^3.0.2": "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^3.0.3": "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^3.2.0": "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^4.0.0": "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57",
|
||||||
|
"kind-of@^5.0.0": "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d",
|
||||||
|
"kind-of@^6.0.0": "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd",
|
||||||
|
"kind-of@^6.0.2": "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd",
|
||||||
|
"loader-runner@^4.2.0": "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.2.0.tgz#d7022380d66d14c5fb1d496b89864ebcfd478384",
|
||||||
|
"loader-utils@^1.2.3": "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613",
|
||||||
|
"loader-utils@^2.0.0": "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.0.tgz#e4cace5b816d425a166b5f097e10cd12b36064b0",
|
||||||
|
"locate-path@^3.0.0": "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e",
|
||||||
|
"locate-path@^5.0.0": "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0",
|
||||||
|
"lodash@^4.17.11": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
|
||||||
|
"lodash@^4.17.14": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
|
||||||
|
"lodash@^4.17.20": "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c",
|
||||||
|
"loglevel@^1.6.8": "https://registry.yarnpkg.com/loglevel/-/loglevel-1.7.1.tgz#005fde2f5e6e47068f935ff28573e125ef72f197",
|
||||||
|
"lower-case@^2.0.2": "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28",
|
||||||
|
"lru-cache@^6.0.0": "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94",
|
||||||
|
"map-cache@^0.2.2": "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf",
|
||||||
|
"map-visit@^1.0.0": "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f",
|
||||||
|
"media-typer@0.3.0": "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748",
|
||||||
|
"memory-fs@^0.4.1": "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.4.1.tgz#3a9a20b8462523e447cfbc7e8bb80ed667bfc552",
|
||||||
|
"memory-fs@^0.5.0": "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c",
|
||||||
|
"merge-descriptors@1.0.1": "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61",
|
||||||
|
"merge-stream@^2.0.0": "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60",
|
||||||
|
"methods@~1.1.2": "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee",
|
||||||
|
"micromatch@^3.1.10": "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23",
|
||||||
|
"micromatch@^3.1.4": "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23",
|
||||||
|
"micromatch@^4.0.0": "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9",
|
||||||
|
"mime-db@1.48.0": "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d",
|
||||||
|
"mime-db@>= 1.43.0 < 2": "https://registry.yarnpkg.com/mime-db/-/mime-db-1.48.0.tgz#e35b31045dd7eada3aaad537ed88a33afbef2d1d",
|
||||||
|
"mime-types@^2.1.27": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b",
|
||||||
|
"mime-types@~2.1.17": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b",
|
||||||
|
"mime-types@~2.1.24": "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.31.tgz#a00d76b74317c61f9c2db2218b8e9f8e9c5c9e6b",
|
||||||
|
"mime@1.6.0": "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1",
|
||||||
|
"mime@^2.4.4": "https://registry.yarnpkg.com/mime/-/mime-2.5.2.tgz#6e3dc6cc2b9510643830e5f19d5cb753da5eeabe",
|
||||||
|
"mimic-fn@^2.1.0": "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b",
|
||||||
|
"minimalistic-assert@^1.0.0": "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7",
|
||||||
|
"minimatch@^3.0.4": "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083",
|
||||||
|
"minimist@^1.2.0": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
|
||||||
|
"minimist@^1.2.5": "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
|
||||||
|
"mixin-deep@^1.2.0": "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566",
|
||||||
|
"mkdirp@^0.5.1": "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def",
|
||||||
|
"mkdirp@^0.5.5": "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def",
|
||||||
|
"ms@2.0.0": "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8",
|
||||||
|
"ms@2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a",
|
||||||
|
"ms@2.1.2": "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009",
|
||||||
|
"ms@^2.1.1": "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2",
|
||||||
|
"multicast-dns-service-types@^1.1.0": "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901",
|
||||||
|
"multicast-dns@^6.0.1": "https://registry.yarnpkg.com/multicast-dns/-/multicast-dns-6.2.3.tgz#a0ec7bd9055c4282f790c3c82f4e28db3b31b229",
|
||||||
|
"nan@^2.12.1": "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19",
|
||||||
|
"nanomatch@^1.2.9": "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119",
|
||||||
|
"negotiator@0.6.2": "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb",
|
||||||
|
"neo-async@^2.6.2": "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f",
|
||||||
|
"nice-try@^1.0.4": "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366",
|
||||||
|
"no-case@^3.0.4": "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d",
|
||||||
|
"node-forge@^0.10.0": "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3",
|
||||||
|
"node-releases@^1.1.71": "https://registry.yarnpkg.com/node-releases/-/node-releases-1.1.72.tgz#14802ab6b1039a79a0c7d662b610a5bbd76eacbe",
|
||||||
|
"normalize-path@^2.1.1": "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9",
|
||||||
|
"normalize-path@^3.0.0": "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65",
|
||||||
|
"npm-run-path@^2.0.0": "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f",
|
||||||
|
"npm-run-path@^4.0.1": "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea",
|
||||||
|
"nth-check@^1.0.2": "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c",
|
||||||
|
"object-assign@^4.0.1": "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863",
|
||||||
|
"object-copy@^0.1.0": "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c",
|
||||||
|
"object-inspect@^1.10.3": "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.10.3.tgz#c2aa7d2d09f50c99375704f7a0adf24c5782d369",
|
||||||
|
"object-is@^1.0.1": "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac",
|
||||||
|
"object-keys@^1.0.12": "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e",
|
||||||
|
"object-keys@^1.1.1": "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e",
|
||||||
|
"object-visit@^1.0.0": "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb",
|
||||||
|
"object.assign@^4.1.2": "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.2.tgz#0ed54a342eceb37b38ff76eb831a0e788cb63940",
|
||||||
|
"object.getownpropertydescriptors@^2.0.3": "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.2.tgz#1bd63aeacf0d5d2d2f31b5e393b03a7c601a23f7",
|
||||||
|
"object.pick@^1.3.0": "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747",
|
||||||
|
"obuf@^1.0.0": "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e",
|
||||||
|
"obuf@^1.1.2": "https://registry.yarnpkg.com/obuf/-/obuf-1.1.2.tgz#09bea3343d41859ebd446292d11c9d4db619084e",
|
||||||
|
"on-finished@~2.3.0": "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947",
|
||||||
|
"on-headers@~1.0.2": "https://registry.yarnpkg.com/on-headers/-/on-headers-1.0.2.tgz#772b0ae6aaa525c399e489adfad90c403eb3c28f",
|
||||||
|
"once@^1.3.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"once@^1.3.1": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"once@^1.4.0": "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"onetime@^5.1.2": "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e",
|
||||||
|
"opn@^5.5.0": "https://registry.yarnpkg.com/opn/-/opn-5.5.0.tgz#fc7164fab56d235904c51c3b27da6758ca3b9bfc",
|
||||||
|
"original@^1.0.0": "https://registry.yarnpkg.com/original/-/original-1.0.2.tgz#e442a61cffe1c5fd20a65f3261c26663b303f25f",
|
||||||
|
"p-finally@^1.0.0": "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae",
|
||||||
|
"p-limit@^2.0.0": "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1",
|
||||||
|
"p-limit@^2.2.0": "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1",
|
||||||
|
"p-limit@^3.1.0": "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b",
|
||||||
|
"p-locate@^3.0.0": "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4",
|
||||||
|
"p-locate@^4.1.0": "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07",
|
||||||
|
"p-map@^2.0.0": "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175",
|
||||||
|
"p-retry@^3.0.1": "https://registry.yarnpkg.com/p-retry/-/p-retry-3.0.1.tgz#316b4c8893e2c8dc1cfa891f406c4b422bebf328",
|
||||||
|
"p-try@^2.0.0": "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6",
|
||||||
|
"param-case@^3.0.3": "https://registry.yarnpkg.com/param-case/-/param-case-3.0.4.tgz#7d17fe4aa12bde34d4a77d91acfb6219caad01c5",
|
||||||
|
"parseurl@~1.3.2": "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4",
|
||||||
|
"parseurl@~1.3.3": "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4",
|
||||||
|
"pascal-case@^3.1.2": "https://registry.yarnpkg.com/pascal-case/-/pascal-case-3.1.2.tgz#b48e0ef2b98e205e7c1dae747d0b1508237660eb",
|
||||||
|
"pascalcase@^0.1.1": "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14",
|
||||||
|
"path-dirname@^1.0.0": "https://registry.yarnpkg.com/path-dirname/-/path-dirname-1.0.2.tgz#cc33d24d525e099a5388c0336c6e32b9160609e0",
|
||||||
|
"path-exists@^3.0.0": "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515",
|
||||||
|
"path-exists@^4.0.0": "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3",
|
||||||
|
"path-is-absolute@^1.0.0": "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
||||||
|
"path-is-inside@^1.0.2": "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53",
|
||||||
|
"path-key@^2.0.0": "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40",
|
||||||
|
"path-key@^2.0.1": "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40",
|
||||||
|
"path-key@^3.0.0": "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
||||||
|
"path-key@^3.1.0": "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
||||||
|
"path-parse@^1.0.6": "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735",
|
||||||
|
"path-to-regexp@0.1.7": "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c",
|
||||||
|
"picomatch@^2.0.4": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
|
||||||
|
"picomatch@^2.2.3": "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972",
|
||||||
|
"pify@^2.0.0": "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c",
|
||||||
|
"pify@^4.0.1": "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231",
|
||||||
|
"pinkie-promise@^2.0.0": "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa",
|
||||||
|
"pinkie@^2.0.0": "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870",
|
||||||
|
"pkg-dir@^3.0.0": "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-3.0.0.tgz#2749020f239ed990881b1f71210d51eb6523bea3",
|
||||||
|
"pkg-dir@^4.2.0": "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3",
|
||||||
|
"portfinder@^1.0.26": "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778",
|
||||||
|
"posix-character-classes@^0.1.0": "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab",
|
||||||
|
"pretty-error@^2.1.1": "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.2.tgz#be89f82d81b1c86ec8fdfbc385045882727f93b6",
|
||||||
|
"process-nextick-args@~2.0.0": "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2",
|
||||||
|
"proxy-addr@~2.0.5": "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025",
|
||||||
|
"prr@~1.0.1": "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476",
|
||||||
|
"pump@^3.0.0": "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64",
|
||||||
|
"punycode@1.3.2": "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d",
|
||||||
|
"punycode@^2.1.0": "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec",
|
||||||
|
"qs@6.7.0": "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc",
|
||||||
|
"querystring@0.2.0": "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620",
|
||||||
|
"querystringify@^2.1.1": "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6",
|
||||||
|
"randombytes@^2.1.0": "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a",
|
||||||
|
"range-parser@^1.2.1": "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031",
|
||||||
|
"range-parser@~1.2.1": "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031",
|
||||||
|
"raw-body@2.4.0": "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332",
|
||||||
|
"readable-stream@^2.0.1": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57",
|
||||||
|
"readable-stream@^2.0.2": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57",
|
||||||
|
"readable-stream@^3.0.6": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198",
|
||||||
|
"readable-stream@^3.1.1": "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198",
|
||||||
|
"readdirp@^2.2.1": "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525",
|
||||||
|
"rechoir@^0.7.0": "https://registry.yarnpkg.com/rechoir/-/rechoir-0.7.0.tgz#32650fd52c21ab252aa5d65b19310441c7e03aca",
|
||||||
|
"regex-not@^1.0.0": "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c",
|
||||||
|
"regex-not@^1.0.2": "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c",
|
||||||
|
"regexp.prototype.flags@^1.2.0": "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz#7ef352ae8d159e758c0eadca6f8fcb4eef07be26",
|
||||||
|
"relateurl@^0.2.7": "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9",
|
||||||
|
"remove-trailing-separator@^1.0.1": "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef",
|
||||||
|
"renderkid@^2.0.4": "https://registry.yarnpkg.com/renderkid/-/renderkid-2.0.5.tgz#483b1ac59c6601ab30a7a596a5965cabccfdd0a5",
|
||||||
|
"repeat-element@^1.1.2": "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9",
|
||||||
|
"repeat-string@^1.6.1": "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637",
|
||||||
|
"require-directory@^2.1.1": "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42",
|
||||||
|
"require-main-filename@^2.0.0": "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b",
|
||||||
|
"requires-port@^1.0.0": "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff",
|
||||||
|
"resolve-cwd@^2.0.0": "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a",
|
||||||
|
"resolve-cwd@^3.0.0": "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d",
|
||||||
|
"resolve-from@^3.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-3.0.0.tgz#b22c7af7d9d6881bc8b6e653335eebcb0a188748",
|
||||||
|
"resolve-from@^5.0.0": "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69",
|
||||||
|
"resolve-url@^0.2.1": "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a",
|
||||||
|
"resolve@^1.9.0": "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975",
|
||||||
|
"ret@~0.1.10": "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc",
|
||||||
|
"retry@^0.12.0": "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b",
|
||||||
|
"rimraf@^2.6.3": "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec",
|
||||||
|
"safe-buffer@5.1.2": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
|
||||||
|
"safe-buffer@>=5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
|
||||||
|
"safe-buffer@^5.0.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
|
||||||
|
"safe-buffer@^5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
|
||||||
|
"safe-buffer@~5.1.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
|
||||||
|
"safe-buffer@~5.1.1": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
|
||||||
|
"safe-buffer@~5.2.0": "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6",
|
||||||
|
"safe-regex@^1.1.0": "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e",
|
||||||
|
"safer-buffer@>= 2.1.2 < 3": "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
||||||
|
"schema-utils@^1.0.0": "https://registry.yarnpkg.com/schema-utils/-/schema-utils-1.0.0.tgz#0b79a93204d7b600d4b2850d1f66c2a34951c770",
|
||||||
|
"schema-utils@^3.0.0": "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.0.0.tgz#67502f6aa2b66a2d4032b4279a2944978a0913ef",
|
||||||
|
"select-hose@^2.0.0": "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca",
|
||||||
|
"selfsigned@^1.10.8": "https://registry.yarnpkg.com/selfsigned/-/selfsigned-1.10.11.tgz#24929cd906fe0f44b6d01fb23999a739537acbe9",
|
||||||
|
"semver@^5.5.0": "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7",
|
||||||
|
"semver@^6.3.0": "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^7.3.4": "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7",
|
||||||
|
"send@0.17.1": "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8",
|
||||||
|
"serialize-javascript@^5.0.1": "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4",
|
||||||
|
"serve-index@^1.9.1": "https://registry.yarnpkg.com/serve-index/-/serve-index-1.9.1.tgz#d3768d69b1e7d82e5ce050fff5b453bea12a9239",
|
||||||
|
"serve-static@1.14.1": "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9",
|
||||||
|
"set-blocking@^2.0.0": "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7",
|
||||||
|
"set-value@^2.0.0": "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b",
|
||||||
|
"set-value@^2.0.1": "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b",
|
||||||
|
"setprototypeof@1.1.0": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.0.tgz#d0bd85536887b6fe7c0d818cb962d9d91c54e656",
|
||||||
|
"setprototypeof@1.1.1": "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683",
|
||||||
|
"shallow-clone@^3.0.0": "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3",
|
||||||
|
"shebang-command@^1.2.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea",
|
||||||
|
"shebang-command@^2.0.0": "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea",
|
||||||
|
"shebang-regex@^1.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3",
|
||||||
|
"shebang-regex@^3.0.0": "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172",
|
||||||
|
"signal-exit@^3.0.0": "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c",
|
||||||
|
"signal-exit@^3.0.3": "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz#a1410c2edd8f077b08b4e253c8eacfcaf057461c",
|
||||||
|
"snapdragon-node@^2.0.1": "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b",
|
||||||
|
"snapdragon-util@^3.0.1": "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2",
|
||||||
|
"snapdragon@^0.8.1": "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d",
|
||||||
|
"sockjs-client@^1.5.0": "https://registry.yarnpkg.com/sockjs-client/-/sockjs-client-1.5.1.tgz#256908f6d5adfb94dabbdbd02c66362cca0f9ea6",
|
||||||
|
"sockjs@^0.3.21": "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.21.tgz#b34ffb98e796930b60a0cfa11904d6a339a7d417",
|
||||||
|
"source-list-map@^2.0.1": "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34",
|
||||||
|
"source-map-resolve@^0.5.0": "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a",
|
||||||
|
"source-map-support@~0.5.12": "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61",
|
||||||
|
"source-map-support@~0.5.19": "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61",
|
||||||
|
"source-map-url@^0.4.0": "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.1.tgz#0af66605a745a5a2f91cf1bbf8a7afbc283dec56",
|
||||||
|
"source-map@^0.5.6": "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc",
|
||||||
|
"source-map@^0.6.0": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@^0.6.1": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@^0.7.3": "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383",
|
||||||
|
"source-map@~0.6.0": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@~0.6.1": "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@~0.7.2": "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383",
|
||||||
|
"spdy-transport@^3.0.0": "https://registry.yarnpkg.com/spdy-transport/-/spdy-transport-3.0.0.tgz#00d4863a6400ad75df93361a1608605e5dcdcf31",
|
||||||
|
"spdy@^4.0.2": "https://registry.yarnpkg.com/spdy/-/spdy-4.0.2.tgz#b74f466203a3eda452c02492b91fb9e84a27677b",
|
||||||
|
"split-string@^3.0.1": "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2",
|
||||||
|
"split-string@^3.0.2": "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2",
|
||||||
|
"static-extend@^0.1.1": "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6",
|
||||||
|
"statuses@>= 1.4.0 < 2": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c",
|
||||||
|
"statuses@>= 1.5.0 < 2": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c",
|
||||||
|
"statuses@~1.5.0": "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c",
|
||||||
|
"string-width@^3.0.0": "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961",
|
||||||
|
"string-width@^3.1.0": "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961",
|
||||||
|
"string.prototype.trimend@^1.0.4": "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80",
|
||||||
|
"string.prototype.trimstart@^1.0.4": "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz#b36399af4ab2999b4c9c648bd7a3fb2bb26feeed",
|
||||||
|
"string_decoder@^1.1.1": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e",
|
||||||
|
"string_decoder@~1.1.1": "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8",
|
||||||
|
"strip-ansi@^3.0.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf",
|
||||||
|
"strip-ansi@^3.0.1": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf",
|
||||||
|
"strip-ansi@^5.0.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
|
||||||
|
"strip-ansi@^5.1.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
|
||||||
|
"strip-ansi@^5.2.0": "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
|
||||||
|
"strip-eof@^1.0.0": "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf",
|
||||||
|
"strip-final-newline@^2.0.0": "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad",
|
||||||
|
"supports-color@^6.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-6.1.0.tgz#0764abc69c63d5ac842dd4867e8d025e880df8f3",
|
||||||
|
"supports-color@^7.1.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da",
|
||||||
|
"supports-color@^8.0.0": "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c",
|
||||||
|
"tapable@^1.0.0": "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2",
|
||||||
|
"tapable@^1.1.3": "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2",
|
||||||
|
"tapable@^2.1.1": "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b",
|
||||||
|
"tapable@^2.2.0": "https://registry.yarnpkg.com/tapable/-/tapable-2.2.0.tgz#5c373d281d9c672848213d0e037d1c4165ab426b",
|
||||||
|
"terser-webpack-plugin@^5.1.1": "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.1.3.tgz#30033e955ca28b55664f1e4b30a1347e61aa23af",
|
||||||
|
"terser@^4.6.3": "https://registry.yarnpkg.com/terser/-/terser-4.8.0.tgz#63056343d7c70bb29f3af665865a46fe03a0df17",
|
||||||
|
"terser@^5.7.0": "https://registry.yarnpkg.com/terser/-/terser-5.7.0.tgz#a761eeec206bc87b605ab13029876ead938ae693",
|
||||||
|
"thunky@^1.0.2": "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d",
|
||||||
|
"to-object-path@^0.3.0": "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af",
|
||||||
|
"to-regex-range@^2.1.0": "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38",
|
||||||
|
"to-regex-range@^5.0.1": "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4",
|
||||||
|
"to-regex@^3.0.1": "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce",
|
||||||
|
"to-regex@^3.0.2": "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce",
|
||||||
|
"toidentifier@1.0.0": "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553",
|
||||||
|
"ts-loader@^8.0.13": "https://registry.yarnpkg.com/ts-loader/-/ts-loader-8.3.0.tgz#83360496d6f8004fab35825279132c93412edf33",
|
||||||
|
"ts-protoc-gen@^0.14.0": "https://registry.yarnpkg.com/ts-protoc-gen/-/ts-protoc-gen-0.14.0.tgz#a6f4c3fc37d1d449915551c18404fb7e9aa8fef6",
|
||||||
|
"tslib@^2.0.3": "https://registry.yarnpkg.com/tslib/-/tslib-2.2.0.tgz#fb2c475977e35e241311ede2693cee1ec6698f5c",
|
||||||
|
"type-is@~1.6.17": "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131",
|
||||||
|
"type-is@~1.6.18": "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131",
|
||||||
|
"typescript@^4.1.3": "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805",
|
||||||
|
"unbox-primitive@^1.0.1": "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.1.tgz#085e215625ec3162574dc8859abee78a59b14471",
|
||||||
|
"union-value@^1.0.0": "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847",
|
||||||
|
"unpipe@1.0.0": "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec",
|
||||||
|
"unpipe@~1.0.0": "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec",
|
||||||
|
"unset-value@^1.0.0": "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559",
|
||||||
|
"upath@^1.1.1": "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894",
|
||||||
|
"uri-js@^4.2.2": "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e",
|
||||||
|
"urix@^0.1.0": "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72",
|
||||||
|
"url-parse@^1.4.3": "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b",
|
||||||
|
"url-parse@^1.5.1": "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.1.tgz#d5fa9890af8a5e1f274a2c98376510f6425f6e3b",
|
||||||
|
"url@^0.11.0": "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1",
|
||||||
|
"use@^3.1.0": "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f",
|
||||||
|
"util-deprecate@^1.0.1": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf",
|
||||||
|
"util-deprecate@~1.0.1": "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf",
|
||||||
|
"util.promisify@1.0.0": "https://registry.yarnpkg.com/util.promisify/-/util.promisify-1.0.0.tgz#440f7165a459c9a16dc145eb8e72f35687097030",
|
||||||
|
"utila@~0.4": "https://registry.yarnpkg.com/utila/-/utila-0.4.0.tgz#8a16a05d445657a3aea5eecc5b12a4fa5379772c",
|
||||||
|
"utils-merge@1.0.1": "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713",
|
||||||
|
"uuid@^3.3.2": "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee",
|
||||||
|
"uuid@^3.4.0": "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee",
|
||||||
|
"v8-compile-cache@^2.2.0": "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz#2de19618c66dc247dcfb6f99338035d8245a2cee",
|
||||||
|
"vary@~1.1.2": "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc",
|
||||||
|
"watchpack@^2.2.0": "https://registry.yarnpkg.com/watchpack/-/watchpack-2.2.0.tgz#47d78f5415fe550ecd740f99fe2882323a58b1ce",
|
||||||
|
"wbuf@^1.1.0": "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df",
|
||||||
|
"wbuf@^1.7.3": "https://registry.yarnpkg.com/wbuf/-/wbuf-1.7.3.tgz#c1d8d149316d3ea852848895cb6a0bfe887b87df",
|
||||||
|
"webpack-cli@^4.3.1": "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-4.7.0.tgz#3195a777f1f802ecda732f6c95d24c0004bc5a35",
|
||||||
|
"webpack-dev-middleware@^3.7.2": "https://registry.yarnpkg.com/webpack-dev-middleware/-/webpack-dev-middleware-3.7.3.tgz#0639372b143262e2b84ab95d3b91a7597061c2c5",
|
||||||
|
"webpack-dev-server@^3.11.1": "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-3.11.2.tgz#695ebced76a4929f0d5de7fd73fafe185fe33708",
|
||||||
|
"webpack-log@^2.0.0": "https://registry.yarnpkg.com/webpack-log/-/webpack-log-2.0.0.tgz#5b7928e0637593f119d32f6227c1e0ac31e1b47f",
|
||||||
|
"webpack-merge@^5.7.3": "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.7.3.tgz#2a0754e1877a25a8bbab3d2475ca70a052708213",
|
||||||
|
"webpack-sources@^2.3.0": "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-2.3.0.tgz#9ed2de69b25143a4c18847586ad9eccb19278cfa",
|
||||||
|
"webpack@^5.11.1": "https://registry.yarnpkg.com/webpack/-/webpack-5.38.1.tgz#5224c7f24c18e729268d3e3bc97240d6e880258e",
|
||||||
|
"websocket-driver@>=0.5.1": "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760",
|
||||||
|
"websocket-driver@^0.7.4": "https://registry.yarnpkg.com/websocket-driver/-/websocket-driver-0.7.4.tgz#89ad5295bbf64b480abcba31e4953aca706f5760",
|
||||||
|
"websocket-extensions@>=0.1.1": "https://registry.yarnpkg.com/websocket-extensions/-/websocket-extensions-0.1.4.tgz#7f8473bc839dfd87608adb95d7eb075211578a42",
|
||||||
|
"which-boxed-primitive@^1.0.2": "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6",
|
||||||
|
"which-module@^2.0.0": "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a",
|
||||||
|
"which@^1.2.9": "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a",
|
||||||
|
"which@^2.0.1": "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1",
|
||||||
|
"wildcard@^2.0.0": "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.0.tgz#a77d20e5200c6faaac979e4b3aadc7b3dd7f8fec",
|
||||||
|
"wrap-ansi@^5.1.0": "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09",
|
||||||
|
"wrappy@1": "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
|
||||||
|
"ws@^6.2.1": "https://registry.yarnpkg.com/ws/-/ws-6.2.2.tgz#dd5cdbd57a9979916097652d78f1cc5faea0c32e",
|
||||||
|
"y18n@^4.0.0": "https://registry.yarnpkg.com/y18n/-/y18n-4.0.3.tgz#b5f259c82cd6e336921efd7bfd8bf560de9eeedf",
|
||||||
|
"yallist@^4.0.0": "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72",
|
||||||
|
"yargs-parser@^13.1.2": "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38",
|
||||||
|
"yargs@^13.3.2": "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd",
|
||||||
|
"yocto-queue@^0.1.0": "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"artifacts": {}
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
## 0.5.3 (2021-05-13)
|
||||||
|
|
||||||
|
- Fixed `stringifyStream()` and `stringifyInfo()` to work properly when replacer is an allowlist
|
||||||
|
- `parseChunked()`
|
||||||
|
- Fixed wrong parse error when chunks are splitted on a whitespace inside an object or array (#6, @alexei-vedder)
|
||||||
|
- Fixed corner cases when wrong placed or missed comma doesn't cause to parsing failure
|
||||||
|
|
||||||
|
## 0.5.2 (2020-12-26)
|
||||||
|
|
||||||
|
- Fixed `RangeError: Maximum call stack size exceeded` in `parseChunked()` on very long arrays (corner case)
|
||||||
|
|
||||||
|
## 0.5.1 (2020-12-18)
|
||||||
|
|
||||||
|
- Fixed `parseChunked()` crash when input has trailing whitespaces
|
||||||
|
|
||||||
|
## 0.5.0 (2020-12-05)
|
||||||
|
|
||||||
|
- Added support for Node.js 10
|
||||||
|
|
||||||
|
## 0.4.0 (2020-12-04)
|
||||||
|
|
||||||
|
- Added `parseChunked()` method
|
||||||
|
- Fixed `stringifyInfo()` to not throw when meet unknown value type
|
||||||
|
|
||||||
|
## 0.3.2 (2020-10-26)
|
||||||
|
|
||||||
|
- Added missed file for build purposes
|
||||||
|
|
||||||
|
## 0.3.1 (2020-10-26)
|
||||||
|
|
||||||
|
- Changed build setup to allow building by any bundler that supports `browser` property in `package.json`
|
||||||
|
- Exposed version
|
||||||
|
|
||||||
|
## 0.3.0 (2020-09-28)
|
||||||
|
|
||||||
|
- Renamed `info()` method into `stringifyInfo()`
|
||||||
|
- Fixed lib's distribution setup
|
||||||
|
|
||||||
|
## 0.2.0 (2020-09-28)
|
||||||
|
|
||||||
|
- Added `dist` version to package (`dist/json-ext.js` and `dist/json-ext.min.js`)
|
||||||
|
|
||||||
|
## 0.1.1 (2020-09-08)
|
||||||
|
|
||||||
|
- Fixed main entry point
|
||||||
|
|
||||||
|
## 0.1.0 (2020-09-08)
|
||||||
|
|
||||||
|
- Initial release
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2020 Roman Dvornov <rdvornov@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
|
@ -0,0 +1,256 @@
|
||||||
|
# json-ext
|
||||||
|
|
||||||
|
[![NPM version](https://img.shields.io/npm/v/@discoveryjs/json-ext.svg)](https://www.npmjs.com/package/@discoveryjs/json-ext)
|
||||||
|
[![Build Status](https://travis-ci.org/discoveryjs/json-ext.svg?branch=master)](https://travis-ci.org/discoveryjs/json-ext)
|
||||||
|
[![Coverage Status](https://coveralls.io/repos/github/discoveryjs/json-ext/badge.svg?branch=master)](https://coveralls.io/github/discoveryjs/json-ext?)
|
||||||
|
[![NPM Downloads](https://img.shields.io/npm/dm/@discoveryjs/json-ext.svg)](https://www.npmjs.com/package/@discoveryjs/json-ext)
|
||||||
|
|
||||||
|
A set of utilities that extend the use of JSON. Designed to be fast and memory efficient
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
- [x] `parseChunked()` – Parse JSON that comes by chunks (e.g. FS readable stream or fetch response stream)
|
||||||
|
- [x] `stringifyStream()` – Stringify stream (Node.js)
|
||||||
|
- [x] `stringifyInfo()` – Get estimated size and other facts of JSON.stringify() without converting a value to string
|
||||||
|
- [ ] **TBD** Support for circular references
|
||||||
|
- [ ] **TBD** Binary representation [branch](https://github.com/discoveryjs/json-ext/tree/binary)
|
||||||
|
- [ ] **TBD** WHATWG [Streams](https://streams.spec.whatwg.org/) support
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install @discoveryjs/json-ext
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
- [parseChunked(chunkEmitter)](#parsechunkedchunkemitter)
|
||||||
|
- [stringifyStream(value[, replacer[, space]])](#stringifystreamvalue-replacer-space)
|
||||||
|
- [stringifyInfo(value[, replacer[, space[, options]]])](#stringifyinfovalue-replacer-space-options)
|
||||||
|
- [Options](#options)
|
||||||
|
- [async](#async)
|
||||||
|
- [continueOnCircular](#continueoncircular)
|
||||||
|
- [version](#version)
|
||||||
|
|
||||||
|
### parseChunked(chunkEmitter)
|
||||||
|
|
||||||
|
Works the same as [`JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) but takes `chunkEmitter` instead of string and returns [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
|
||||||
|
|
||||||
|
> NOTE: `reviver` parameter is not supported yet, but will be added in next releases.
|
||||||
|
> NOTE: WHATWG streams aren't supported yet
|
||||||
|
|
||||||
|
When to use:
|
||||||
|
- It's required to avoid freezing the main thread during big JSON parsing, since this process can be distributed in time
|
||||||
|
- Huge JSON needs to be parsed (e.g. >500MB on Node.js)
|
||||||
|
- Needed to reduce memory pressure. `JSON.parse()` needs to receive the entire JSON before parsing it. With `parseChunked()` you may parse JSON as first bytes of it comes. This approach helps to avoid storing a huge string in the memory at a single time point and following GC.
|
||||||
|
|
||||||
|
[Benchmark](https://github.com/discoveryjs/json-ext/tree/master/benchmarks#parse-chunked)
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { parseChunked } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
// as a regular Promise
|
||||||
|
parseChunked(chunkEmitter)
|
||||||
|
.then(data => {
|
||||||
|
/* data is parsed JSON */
|
||||||
|
});
|
||||||
|
|
||||||
|
// using await (keep in mind that not every runtime has a support for top level await)
|
||||||
|
const data = await parseChunked(chunkEmitter);
|
||||||
|
```
|
||||||
|
|
||||||
|
Parameter `chunkEmitter` can be:
|
||||||
|
- [`ReadableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_readable_streams) (Node.js only)
|
||||||
|
```js
|
||||||
|
const fs = require('fs');
|
||||||
|
const { parseChunked } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
parseChunked(fs.createReadStream('path/to/file.json'))
|
||||||
|
```
|
||||||
|
- Generator, async generator or function that returns iterable (chunks). Chunk might be a `string`, `Uint8Array` or `Buffer` (Node.js only):
|
||||||
|
```js
|
||||||
|
const { parseChunked } = require('@discoveryjs/json-ext');
|
||||||
|
const encoder = new TextEncoder();
|
||||||
|
|
||||||
|
// generator
|
||||||
|
parseChunked(function*() {
|
||||||
|
yield '{ "hello":';
|
||||||
|
yield Buffer.from(' "wor'); // Node.js only
|
||||||
|
yield encoder.encode('ld" }'); // returns Uint8Array(5) [ 108, 100, 34, 32, 125 ]
|
||||||
|
});
|
||||||
|
|
||||||
|
// async generator
|
||||||
|
parseChunked(async function*() {
|
||||||
|
for await (const chunk of someAsyncSource) {
|
||||||
|
yield chunk;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// function that returns iterable
|
||||||
|
parseChunked(() => ['{ "hello":', ' "world"}'])
|
||||||
|
```
|
||||||
|
|
||||||
|
Using with [fetch()](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API):
|
||||||
|
|
||||||
|
```js
|
||||||
|
async function loadData(url) {
|
||||||
|
const response = await fetch(url);
|
||||||
|
const reader = response.body.getReader();
|
||||||
|
|
||||||
|
return parseChunked(async function*() {
|
||||||
|
while (true) {
|
||||||
|
const { done, value } = await reader.read();
|
||||||
|
|
||||||
|
if (done) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield value;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
loadData('https://example.com/data.json')
|
||||||
|
.then(data => {
|
||||||
|
/* data is parsed JSON */
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
### stringifyStream(value[, replacer[, space]])
|
||||||
|
|
||||||
|
Works the same as [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify), but returns an instance of [`ReadableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_readable_streams) instead of string.
|
||||||
|
|
||||||
|
> NOTE: WHATWG Streams aren't supported yet, so function available for Node.js only for now
|
||||||
|
|
||||||
|
Departs from JSON.stringify():
|
||||||
|
- Outputs `null` when `JSON.stringify()` returns `undefined` (since streams may not emit `undefined`)
|
||||||
|
- A promise is resolving and the resulting value is stringifying as a regular one
|
||||||
|
- A stream in non-object mode is piping to output as is
|
||||||
|
- A stream in object mode is piping to output as an array of objects
|
||||||
|
|
||||||
|
When to use:
|
||||||
|
- Huge JSON needs to be generated (e.g. >500MB on Node.js)
|
||||||
|
- Needed to reduce memory pressure. `JSON.stringify()` needs to generate the entire JSON before send or write it to somewhere. With `stringifyStream()` you may send a result to somewhere as first bytes of the result appears. This approach helps to avoid storing a huge string in the memory at a single time point.
|
||||||
|
- The object being serialized contains Promises or Streams (see Usage for examples)
|
||||||
|
|
||||||
|
[Benchmark](https://github.com/discoveryjs/json-ext/tree/master/benchmarks#stream-stringifying)
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { stringifyStream } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
// handle events
|
||||||
|
stringifyStream(data)
|
||||||
|
.on('data', chunk => console.log(chunk))
|
||||||
|
.on('error', error => consold.error(error))
|
||||||
|
.on('finish', () => console.log('DONE!'));
|
||||||
|
|
||||||
|
// pipe into a stream
|
||||||
|
stringifyStream(data)
|
||||||
|
.pipe(writableStream);
|
||||||
|
```
|
||||||
|
|
||||||
|
Using Promise or ReadableStream in serializing object:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const fs = require('fs');
|
||||||
|
const { stringifyStream } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
// output will be
|
||||||
|
// {"name":"example","willSerializeResolvedValue":42,"fromFile":[1, 2, 3],"at":{"any":{"level":"promise!"}}}
|
||||||
|
stringifyStream({
|
||||||
|
name: 'example',
|
||||||
|
willSerializeResolvedValue: Promise.resolve(42),
|
||||||
|
fromFile: fs.createReadStream('path/to/file.json'), // support file content is "[1, 2, 3]", it'll be inserted as it
|
||||||
|
at: {
|
||||||
|
any: {
|
||||||
|
level: new Promise(resolve => setTimeout(() => resolve('promise!'), 100))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
// in case several async requests are used in object, it's prefered
|
||||||
|
// to put fastest requests first, because in this case
|
||||||
|
stringifyStream({
|
||||||
|
foo: fetch('http://example.com/request_takes_2s').then(req => req.json()),
|
||||||
|
bar: fetch('http://example.com/request_takes_5s').then(req => req.json())
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
Using with [`WritableStream`](https://nodejs.org/dist/latest-v14.x/docs/api/stream.html#stream_writable_streams) (Node.js only):
|
||||||
|
|
||||||
|
```js
|
||||||
|
const fs = require('fs');
|
||||||
|
const { stringifyStream } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
// pipe into a console
|
||||||
|
stringifyStream(data)
|
||||||
|
.pipe(process.stdout);
|
||||||
|
|
||||||
|
// pipe into a file
|
||||||
|
stringifyStream(data)
|
||||||
|
.pipe(fs.createWriteStream('path/to/file.json'));
|
||||||
|
|
||||||
|
// wrapping into a Promise
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
stringifyStream(data)
|
||||||
|
.on('error', reject)
|
||||||
|
.pipe(stream)
|
||||||
|
.on('error', reject)
|
||||||
|
.on('finish', resolve);
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
### stringifyInfo(value[, replacer[, space[, options]]])
|
||||||
|
|
||||||
|
`value`, `replacer` and `space` arguments are the same as for `JSON.stringify()`.
|
||||||
|
|
||||||
|
Result is an object:
|
||||||
|
|
||||||
|
```js
|
||||||
|
{
|
||||||
|
minLength: Number, // minimal bytes when values is stringified
|
||||||
|
circular: [...], // list of circular references
|
||||||
|
duplicate: [...], // list of objects that occur more than once
|
||||||
|
async: [...] // list of async values, i.e. promises and streams
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const { stringifyInfo } = require('@discoveryjs/json-ext');
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
stringifyInfo({ test: true }).minLength
|
||||||
|
);
|
||||||
|
// > 13
|
||||||
|
// that equals '{"test":true}'.length
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Options
|
||||||
|
|
||||||
|
##### async
|
||||||
|
|
||||||
|
Type: `Boolean`
|
||||||
|
Default: `false`
|
||||||
|
|
||||||
|
Collect async values (promises and streams) or not.
|
||||||
|
|
||||||
|
##### continueOnCircular
|
||||||
|
|
||||||
|
Type: `Boolean`
|
||||||
|
Default: `false`
|
||||||
|
|
||||||
|
Stop collecting info for a value or not whenever circular reference is found. Setting option to `true` allows to find all circular references.
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
The version of library, e.g. `"0.3.1"`.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT
|
|
@ -0,0 +1,862 @@
|
||||||
|
(function (global, factory) {
|
||||||
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||||
|
typeof define === 'function' && define.amd ? define(factory) :
|
||||||
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.jsonExt = factory());
|
||||||
|
}(this, (function () { 'use strict';
|
||||||
|
|
||||||
|
var name = "@discoveryjs/json-ext";
|
||||||
|
var version = "0.5.3";
|
||||||
|
var description = "A set of utilities that extend the use of JSON";
|
||||||
|
var keywords = [
|
||||||
|
"json",
|
||||||
|
"utils",
|
||||||
|
"stream",
|
||||||
|
"async",
|
||||||
|
"promise",
|
||||||
|
"stringify",
|
||||||
|
"info"
|
||||||
|
];
|
||||||
|
var author = "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)";
|
||||||
|
var license = "MIT";
|
||||||
|
var repository = "discoveryjs/json-ext";
|
||||||
|
var main = "./src/index";
|
||||||
|
var browser = {
|
||||||
|
"./src/stringify-stream.js": "./src/stringify-stream-browser.js",
|
||||||
|
"./src/text-decoder.js": "./src/text-decoder-browser.js"
|
||||||
|
};
|
||||||
|
var scripts = {
|
||||||
|
test: "mocha --reporter progress",
|
||||||
|
lint: "eslint src test",
|
||||||
|
"lint-and-test": "npm run lint && npm test",
|
||||||
|
build: "rollup --config",
|
||||||
|
"test:all": "npm run test:src && npm run test:dist",
|
||||||
|
"test:src": "npm test",
|
||||||
|
"test:dist": "cross-env MODE=dist npm test && cross-env MODE=dist-min npm test",
|
||||||
|
"build-and-test": "npm run build && npm run test:dist",
|
||||||
|
coverage: "nyc npm test",
|
||||||
|
travis: "nyc npm run lint-and-test && npm run build-and-test && npm run coveralls",
|
||||||
|
coveralls: "nyc report --reporter=text-lcov | coveralls",
|
||||||
|
prepublishOnly: "npm run build"
|
||||||
|
};
|
||||||
|
var dependencies = {
|
||||||
|
};
|
||||||
|
var devDependencies = {
|
||||||
|
"@rollup/plugin-commonjs": "^15.1.0",
|
||||||
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
||||||
|
chalk: "^4.1.0",
|
||||||
|
coveralls: "^3.1.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
eslint: "^7.6.0",
|
||||||
|
mocha: "^8.1.1",
|
||||||
|
nyc: "^15.1.0",
|
||||||
|
rollup: "^2.28.2",
|
||||||
|
"rollup-plugin-terser": "^7.0.2"
|
||||||
|
};
|
||||||
|
var engines = {
|
||||||
|
node: ">=10.0.0"
|
||||||
|
};
|
||||||
|
var files = [
|
||||||
|
"dist",
|
||||||
|
"src"
|
||||||
|
];
|
||||||
|
var require$$0 = {
|
||||||
|
name: name,
|
||||||
|
version: version,
|
||||||
|
description: description,
|
||||||
|
keywords: keywords,
|
||||||
|
author: author,
|
||||||
|
license: license,
|
||||||
|
repository: repository,
|
||||||
|
main: main,
|
||||||
|
browser: browser,
|
||||||
|
scripts: scripts,
|
||||||
|
dependencies: dependencies,
|
||||||
|
devDependencies: devDependencies,
|
||||||
|
engines: engines,
|
||||||
|
files: files
|
||||||
|
};
|
||||||
|
|
||||||
|
const PrimitiveType = 1;
|
||||||
|
const ObjectType = 2;
|
||||||
|
const ArrayType = 3;
|
||||||
|
const PromiseType = 4;
|
||||||
|
const ReadableStringType = 5;
|
||||||
|
const ReadableObjectType = 6;
|
||||||
|
// https://tc39.es/ecma262/#table-json-single-character-escapes
|
||||||
|
const escapableCharCodeSubstitution$1 = { // JSON Single Character Escape Sequences
|
||||||
|
0x08: '\\b',
|
||||||
|
0x09: '\\t',
|
||||||
|
0x0a: '\\n',
|
||||||
|
0x0c: '\\f',
|
||||||
|
0x0d: '\\r',
|
||||||
|
0x22: '\\\"',
|
||||||
|
0x5c: '\\\\'
|
||||||
|
};
|
||||||
|
|
||||||
|
function isLeadingSurrogate$1(code) {
|
||||||
|
return code >= 0xD800 && code <= 0xDBFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTrailingSurrogate$1(code) {
|
||||||
|
return code >= 0xDC00 && code <= 0xDFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isReadableStream$1(value) {
|
||||||
|
return (
|
||||||
|
typeof value.pipe === 'function' &&
|
||||||
|
typeof value._read === 'function' &&
|
||||||
|
typeof value._readableState === 'object' && value._readableState !== null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function replaceValue$1(holder, key, value, replacer) {
|
||||||
|
if (value && typeof value.toJSON === 'function') {
|
||||||
|
value = value.toJSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replacer !== null) {
|
||||||
|
value = replacer.call(holder, String(key), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'function':
|
||||||
|
case 'symbol':
|
||||||
|
value = undefined;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'object':
|
||||||
|
if (value !== null) {
|
||||||
|
const cls = value.constructor;
|
||||||
|
if (cls === String || cls === Number || cls === Boolean) {
|
||||||
|
value = value.valueOf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTypeNative$1(value) {
|
||||||
|
if (value === null || typeof value !== 'object') {
|
||||||
|
return PrimitiveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return ArrayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ObjectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTypeAsync$1(value) {
|
||||||
|
if (value === null || typeof value !== 'object') {
|
||||||
|
return PrimitiveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof value.then === 'function') {
|
||||||
|
return PromiseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReadableStream$1(value)) {
|
||||||
|
return value._readableState.objectMode ? ReadableObjectType : ReadableStringType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return ArrayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ObjectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeReplacer$1(replacer) {
|
||||||
|
if (typeof replacer === 'function') {
|
||||||
|
return replacer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(replacer)) {
|
||||||
|
const allowlist = new Set(replacer
|
||||||
|
.map(item => {
|
||||||
|
const cls = item && item.constructor;
|
||||||
|
return cls === String || cls === Number ? String(item) : null;
|
||||||
|
})
|
||||||
|
.filter(item => typeof item === 'string')
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...allowlist];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeSpace$1(space) {
|
||||||
|
if (typeof space === 'number') {
|
||||||
|
if (!Number.isFinite(space) || space < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ' '.repeat(Math.min(space, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof space === 'string') {
|
||||||
|
return space.slice(0, 10) || false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var utils = {
|
||||||
|
escapableCharCodeSubstitution: escapableCharCodeSubstitution$1,
|
||||||
|
isLeadingSurrogate: isLeadingSurrogate$1,
|
||||||
|
isTrailingSurrogate: isTrailingSurrogate$1,
|
||||||
|
type: {
|
||||||
|
PRIMITIVE: PrimitiveType,
|
||||||
|
PROMISE: PromiseType,
|
||||||
|
ARRAY: ArrayType,
|
||||||
|
OBJECT: ObjectType,
|
||||||
|
STRING_STREAM: ReadableStringType,
|
||||||
|
OBJECT_STREAM: ReadableObjectType
|
||||||
|
},
|
||||||
|
|
||||||
|
isReadableStream: isReadableStream$1,
|
||||||
|
replaceValue: replaceValue$1,
|
||||||
|
getTypeNative: getTypeNative$1,
|
||||||
|
getTypeAsync: getTypeAsync$1,
|
||||||
|
normalizeReplacer: normalizeReplacer$1,
|
||||||
|
normalizeSpace: normalizeSpace$1
|
||||||
|
};
|
||||||
|
|
||||||
|
const {
|
||||||
|
normalizeReplacer,
|
||||||
|
normalizeSpace,
|
||||||
|
replaceValue,
|
||||||
|
getTypeNative,
|
||||||
|
getTypeAsync,
|
||||||
|
isLeadingSurrogate,
|
||||||
|
isTrailingSurrogate,
|
||||||
|
escapableCharCodeSubstitution,
|
||||||
|
type: {
|
||||||
|
PRIMITIVE,
|
||||||
|
OBJECT,
|
||||||
|
ARRAY,
|
||||||
|
PROMISE,
|
||||||
|
STRING_STREAM,
|
||||||
|
OBJECT_STREAM
|
||||||
|
}
|
||||||
|
} = utils;
|
||||||
|
const charLength2048 = Array.from({ length: 2048 }).map((_, code) => {
|
||||||
|
if (escapableCharCodeSubstitution.hasOwnProperty(code)) {
|
||||||
|
return 2; // \X
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code < 0x20) {
|
||||||
|
return 6; // \uXXXX
|
||||||
|
}
|
||||||
|
|
||||||
|
return code < 128 ? 1 : 2; // UTF8 bytes
|
||||||
|
});
|
||||||
|
|
||||||
|
function stringLength(str) {
|
||||||
|
let len = 0;
|
||||||
|
let prevLeadingSurrogate = false;
|
||||||
|
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
const code = str.charCodeAt(i);
|
||||||
|
|
||||||
|
if (code < 2048) {
|
||||||
|
len += charLength2048[code];
|
||||||
|
} else if (isLeadingSurrogate(code)) {
|
||||||
|
len += 6; // \uXXXX since no pair with trailing surrogate yet
|
||||||
|
prevLeadingSurrogate = true;
|
||||||
|
continue;
|
||||||
|
} else if (isTrailingSurrogate(code)) {
|
||||||
|
len = prevLeadingSurrogate
|
||||||
|
? len - 2 // surrogate pair (4 bytes), since we calculate prev leading surrogate as 6 bytes, substruct 2 bytes
|
||||||
|
: len + 6; // \uXXXX
|
||||||
|
} else {
|
||||||
|
len += 3; // code >= 2048 is 3 bytes length for UTF8
|
||||||
|
}
|
||||||
|
|
||||||
|
prevLeadingSurrogate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return len + 2; // +2 for quotes
|
||||||
|
}
|
||||||
|
|
||||||
|
function primitiveLength(value) {
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'string':
|
||||||
|
return stringLength(value);
|
||||||
|
|
||||||
|
case 'number':
|
||||||
|
return Number.isFinite(value) ? String(value).length : 4 /* null */;
|
||||||
|
|
||||||
|
case 'boolean':
|
||||||
|
return value ? 4 /* true */ : 5 /* false */;
|
||||||
|
|
||||||
|
case 'undefined':
|
||||||
|
case 'object':
|
||||||
|
return 4; /* null */
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function spaceLength(space) {
|
||||||
|
space = normalizeSpace(space);
|
||||||
|
return typeof space === 'string' ? space.length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
var stringifyInfo = function jsonStringifyInfo(value, replacer, space, options) {
|
||||||
|
function walk(holder, key, value) {
|
||||||
|
if (stop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = replaceValue(holder, key, value, replacer);
|
||||||
|
|
||||||
|
let type = getType(value);
|
||||||
|
|
||||||
|
// check for circular structure
|
||||||
|
if (type !== PRIMITIVE && stack.has(value)) {
|
||||||
|
circular.add(value);
|
||||||
|
length += 4; // treat as null
|
||||||
|
|
||||||
|
if (!options.continueOnCircular) {
|
||||||
|
stop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PRIMITIVE:
|
||||||
|
if (value !== undefined || Array.isArray(holder)) {
|
||||||
|
length += primitiveLength(value);
|
||||||
|
} else if (holder === root) {
|
||||||
|
length += 9; // FIXME: that's the length of undefined, should we normalize behaviour to convert it to null?
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OBJECT: {
|
||||||
|
if (visited.has(value)) {
|
||||||
|
duplicate.add(value);
|
||||||
|
length += visited.get(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const valueLength = length;
|
||||||
|
let entries = 0;
|
||||||
|
|
||||||
|
length += 2; // {}
|
||||||
|
|
||||||
|
stack.add(value);
|
||||||
|
|
||||||
|
for (const key in value) {
|
||||||
|
if (hasOwnProperty.call(value, key) && (allowlist === null || allowlist.has(key))) {
|
||||||
|
const prevLength = length;
|
||||||
|
walk(value, key, value[key]);
|
||||||
|
|
||||||
|
if (prevLength !== length) {
|
||||||
|
// value is printed
|
||||||
|
length += stringLength(key) + 1; // "key":
|
||||||
|
entries++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entries > 1) {
|
||||||
|
length += entries - 1; // commas
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.delete(value);
|
||||||
|
|
||||||
|
if (space > 0 && entries > 0) {
|
||||||
|
length += (1 + (stack.size + 1) * space + 1) * entries; // for each key-value: \n{space}
|
||||||
|
length += 1 + stack.size * space; // for }
|
||||||
|
}
|
||||||
|
|
||||||
|
visited.set(value, length - valueLength);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ARRAY: {
|
||||||
|
if (visited.has(value)) {
|
||||||
|
duplicate.add(value);
|
||||||
|
length += visited.get(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const valueLength = length;
|
||||||
|
|
||||||
|
length += 2; // []
|
||||||
|
|
||||||
|
stack.add(value);
|
||||||
|
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
walk(value, i, value[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.length > 1) {
|
||||||
|
length += value.length - 1; // commas
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.delete(value);
|
||||||
|
|
||||||
|
if (space > 0 && value.length > 0) {
|
||||||
|
length += (1 + (stack.size + 1) * space) * value.length; // for each element: \n{space}
|
||||||
|
length += 1 + stack.size * space; // for ]
|
||||||
|
}
|
||||||
|
|
||||||
|
visited.set(value, length - valueLength);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case PROMISE:
|
||||||
|
case STRING_STREAM:
|
||||||
|
async.add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OBJECT_STREAM:
|
||||||
|
length += 2; // []
|
||||||
|
async.add(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let allowlist = null;
|
||||||
|
replacer = normalizeReplacer(replacer);
|
||||||
|
|
||||||
|
if (Array.isArray(replacer)) {
|
||||||
|
allowlist = new Set(replacer);
|
||||||
|
replacer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
space = spaceLength(space);
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
|
const visited = new Map();
|
||||||
|
const stack = new Set();
|
||||||
|
const duplicate = new Set();
|
||||||
|
const circular = new Set();
|
||||||
|
const async = new Set();
|
||||||
|
const getType = options.async ? getTypeAsync : getTypeNative;
|
||||||
|
const root = { '': value };
|
||||||
|
let stop = false;
|
||||||
|
let length = 0;
|
||||||
|
|
||||||
|
walk(root, '', value);
|
||||||
|
|
||||||
|
return {
|
||||||
|
minLength: isNaN(length) ? Infinity : length,
|
||||||
|
circular: [...circular],
|
||||||
|
duplicate: [...duplicate],
|
||||||
|
async: [...async]
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var stringifyStreamBrowser = () => {
|
||||||
|
throw new Error('Method is not supported');
|
||||||
|
};
|
||||||
|
|
||||||
|
var textDecoderBrowser = TextDecoder;
|
||||||
|
|
||||||
|
const { isReadableStream } = utils;
|
||||||
|
|
||||||
|
|
||||||
|
const STACK_OBJECT = 1;
|
||||||
|
const STACK_ARRAY = 2;
|
||||||
|
const decoder = new textDecoderBrowser();
|
||||||
|
|
||||||
|
function isObject(value) {
|
||||||
|
return value !== null && typeof value === 'object';
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjustPosition(error, parser) {
|
||||||
|
if (error.name === 'SyntaxError' && parser.jsonParseOffset) {
|
||||||
|
error.message = error.message.replace(/at position (\d+)/, (_, pos) =>
|
||||||
|
'at position ' + (Number(pos) + parser.jsonParseOffset)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
function append(array, elements) {
|
||||||
|
// Note: Avoid to use array.push(...elements) since it may lead to
|
||||||
|
// "RangeError: Maximum call stack size exceeded" for a long arrays
|
||||||
|
const initialLength = array.length;
|
||||||
|
array.length += elements.length;
|
||||||
|
|
||||||
|
for (let i = 0; i < elements.length; i++) {
|
||||||
|
array[initialLength + i] = elements[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var parseChunked = function(chunkEmitter) {
|
||||||
|
let parser = new ChunkParser();
|
||||||
|
|
||||||
|
if (isObject(chunkEmitter) && isReadableStream(chunkEmitter)) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
chunkEmitter
|
||||||
|
.on('data', chunk => {
|
||||||
|
try {
|
||||||
|
parser.push(chunk);
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.on('error', (e) => {
|
||||||
|
parser = null;
|
||||||
|
reject(e);
|
||||||
|
})
|
||||||
|
.on('end', () => {
|
||||||
|
try {
|
||||||
|
resolve(parser.finish());
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
} finally {
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof chunkEmitter === 'function') {
|
||||||
|
const iterator = chunkEmitter();
|
||||||
|
|
||||||
|
if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator)) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
|
for await (const chunk of iterator) {
|
||||||
|
parser.push(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(parser.finish());
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
} finally {
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(
|
||||||
|
'Chunk emitter should be readable stream, generator, ' +
|
||||||
|
'async generator or function returning an iterable object'
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
class ChunkParser {
|
||||||
|
constructor() {
|
||||||
|
this.value = undefined;
|
||||||
|
this.valueStack = null;
|
||||||
|
|
||||||
|
this.stack = new Array(100);
|
||||||
|
this.lastFlushDepth = 0;
|
||||||
|
this.flushDepth = 0;
|
||||||
|
this.stateString = false;
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
this.pendingByteSeq = null;
|
||||||
|
this.pendingChunk = null;
|
||||||
|
this.chunkOffset = 0;
|
||||||
|
this.jsonParseOffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
parseAndAppend(fragment, wrap) {
|
||||||
|
// Append new entries or elements
|
||||||
|
if (this.stack[this.lastFlushDepth - 1] === STACK_OBJECT) {
|
||||||
|
if (wrap) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = '{' + fragment + '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this.valueStack.value, JSON.parse(fragment));
|
||||||
|
} else {
|
||||||
|
if (wrap) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = '[' + fragment + ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
append(this.valueStack.value, JSON.parse(fragment));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareAddition(fragment) {
|
||||||
|
const { value } = this.valueStack;
|
||||||
|
const expectComma = Array.isArray(value)
|
||||||
|
? value.length !== 0
|
||||||
|
: Object.keys(value).length !== 0;
|
||||||
|
|
||||||
|
if (expectComma) {
|
||||||
|
// Skip a comma at the beginning of fragment, otherwise it would
|
||||||
|
// fail to parse
|
||||||
|
if (fragment[0] === ',') {
|
||||||
|
this.jsonParseOffset++;
|
||||||
|
return fragment.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When value (an object or array) is not empty and a fragment
|
||||||
|
// doesn't start with a comma, a single valid fragment starting
|
||||||
|
// is a closing bracket. If it's not, a prefix is adding to fail
|
||||||
|
// parsing. Otherwise, the sequence of chunks can be successfully
|
||||||
|
// parsed, although it should not, e.g. ["[{}", "{}]"]
|
||||||
|
if (fragment[0] !== '}' && fragment[0] !== ']') {
|
||||||
|
this.jsonParseOffset -= 3;
|
||||||
|
return '[[]' + fragment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
flush(chunk, start, end) {
|
||||||
|
let fragment = chunk.slice(start, end);
|
||||||
|
|
||||||
|
// Save position correction an error in JSON.parse() if any
|
||||||
|
this.jsonParseOffset = this.chunkOffset + start;
|
||||||
|
|
||||||
|
// Prepend pending chunk if any
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
fragment = this.pendingChunk + fragment;
|
||||||
|
this.jsonParseOffset -= this.pendingChunk.length;
|
||||||
|
this.pendingChunk = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.flushDepth === this.lastFlushDepth) {
|
||||||
|
// Depth didn't changed, so it's a root value or entry/element set
|
||||||
|
if (this.flushDepth > 0) {
|
||||||
|
this.parseAndAppend(this.prepareAddition(fragment), true);
|
||||||
|
} else {
|
||||||
|
// That's an entire value on a top level
|
||||||
|
this.value = JSON.parse(fragment);
|
||||||
|
this.valueStack = {
|
||||||
|
value: this.value,
|
||||||
|
prev: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else if (this.flushDepth > this.lastFlushDepth) {
|
||||||
|
// Add missed closing brackets/parentheses
|
||||||
|
for (let i = this.flushDepth - 1; i >= this.lastFlushDepth; i--) {
|
||||||
|
fragment += this.stack[i] === STACK_OBJECT ? '}' : ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.lastFlushDepth === 0) {
|
||||||
|
// That's a root value
|
||||||
|
this.value = JSON.parse(fragment);
|
||||||
|
this.valueStack = {
|
||||||
|
value: this.value,
|
||||||
|
prev: null
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.parseAndAppend(this.prepareAddition(fragment), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move down to the depths to the last object/array, which is current now
|
||||||
|
for (let i = this.lastFlushDepth || 1; i < this.flushDepth; i++) {
|
||||||
|
let value = this.valueStack.value;
|
||||||
|
|
||||||
|
if (this.stack[i - 1] === STACK_OBJECT) {
|
||||||
|
// find last entry
|
||||||
|
let key;
|
||||||
|
// eslint-disable-next-line curly
|
||||||
|
for (key in value);
|
||||||
|
value = value[key];
|
||||||
|
} else {
|
||||||
|
// last element
|
||||||
|
value = value[value.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.valueStack = {
|
||||||
|
value,
|
||||||
|
prev: this.valueStack
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else /* this.flushDepth < this.lastFlushDepth */ {
|
||||||
|
fragment = this.prepareAddition(fragment);
|
||||||
|
|
||||||
|
// Add missed opening brackets/parentheses
|
||||||
|
for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = (this.stack[i] === STACK_OBJECT ? '{' : '[') + fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.parseAndAppend(fragment, false);
|
||||||
|
|
||||||
|
for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) {
|
||||||
|
this.valueStack = this.valueStack.prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastFlushDepth = this.flushDepth;
|
||||||
|
}
|
||||||
|
|
||||||
|
push(chunk) {
|
||||||
|
if (typeof chunk !== 'string') {
|
||||||
|
// Suppose chunk is Buffer or Uint8Array
|
||||||
|
|
||||||
|
// Prepend uncompleted byte sequence if any
|
||||||
|
if (this.pendingByteSeq !== null) {
|
||||||
|
const origRawChunk = chunk;
|
||||||
|
chunk = new Uint8Array(this.pendingByteSeq.length + origRawChunk.length);
|
||||||
|
chunk.set(this.pendingByteSeq);
|
||||||
|
chunk.set(origRawChunk, this.pendingByteSeq.length);
|
||||||
|
this.pendingByteSeq = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case Buffer/Uint8Array, an input is encoded in UTF8
|
||||||
|
// Seek for parts of uncompleted UTF8 symbol on the ending
|
||||||
|
// This makes sense only if we expect more chunks and last char is not multi-bytes
|
||||||
|
if (chunk[chunk.length - 1] > 127) {
|
||||||
|
for (let seqLength = 0; seqLength < chunk.length; seqLength++) {
|
||||||
|
const byte = chunk[chunk.length - 1 - seqLength];
|
||||||
|
|
||||||
|
// 10xxxxxx - 2nd, 3rd or 4th byte
|
||||||
|
// 110xxxxx – first byte of 2-byte sequence
|
||||||
|
// 1110xxxx - first byte of 3-byte sequence
|
||||||
|
// 11110xxx - first byte of 4-byte sequence
|
||||||
|
if (byte >> 6 === 3) {
|
||||||
|
seqLength++;
|
||||||
|
|
||||||
|
// If the sequence is really incomplete, then preserve it
|
||||||
|
// for the future chunk and cut off it from the current chunk
|
||||||
|
if ((seqLength !== 4 && byte >> 3 === 0b11110) ||
|
||||||
|
(seqLength !== 3 && byte >> 4 === 0b1110) ||
|
||||||
|
(seqLength !== 2 && byte >> 5 === 0b110)) {
|
||||||
|
this.pendingByteSeq = chunk.slice(chunk.length - seqLength);
|
||||||
|
chunk = chunk.slice(0, -seqLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert chunk to a string, since single decode per chunk
|
||||||
|
// is much effective than decode multiple small substrings
|
||||||
|
chunk = decoder.decode(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
const chunkLength = chunk.length;
|
||||||
|
let lastFlushPoint = 0;
|
||||||
|
let flushPoint = 0;
|
||||||
|
|
||||||
|
// Main scan loop
|
||||||
|
scan: for (let i = 0; i < chunkLength; i++) {
|
||||||
|
if (this.stateString) {
|
||||||
|
for (; i < chunkLength; i++) {
|
||||||
|
if (this.stateStringEscape) {
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
} else {
|
||||||
|
switch (chunk.charCodeAt(i)) {
|
||||||
|
case 0x22: /* " */
|
||||||
|
this.stateString = false;
|
||||||
|
continue scan;
|
||||||
|
|
||||||
|
case 0x5C: /* \ */
|
||||||
|
this.stateStringEscape = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (chunk.charCodeAt(i)) {
|
||||||
|
case 0x22: /* " */
|
||||||
|
this.stateString = true;
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x2C: /* , */
|
||||||
|
flushPoint = i;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x7B: /* { */
|
||||||
|
// Open an object
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.stack[this.flushDepth++] = STACK_OBJECT;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x5B: /* [ */
|
||||||
|
// Open an array
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.stack[this.flushDepth++] = STACK_ARRAY;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x5D: /* ] */
|
||||||
|
case 0x7D: /* } */
|
||||||
|
// Close an object or array
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.flushDepth--;
|
||||||
|
|
||||||
|
if (this.flushDepth < this.lastFlushDepth) {
|
||||||
|
this.flush(chunk, lastFlushPoint, flushPoint);
|
||||||
|
lastFlushPoint = flushPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x09: /* \t */
|
||||||
|
case 0x0A: /* \n */
|
||||||
|
case 0x0D: /* \r */
|
||||||
|
case 0x20: /* space */
|
||||||
|
// Move points forward when they points on current position and it's a whitespace
|
||||||
|
if (lastFlushPoint === i) {
|
||||||
|
lastFlushPoint++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flushPoint === i) {
|
||||||
|
flushPoint++;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flushPoint > lastFlushPoint) {
|
||||||
|
this.flush(chunk, lastFlushPoint, flushPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Produce pendingChunk if something left
|
||||||
|
if (flushPoint < chunkLength) {
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
// When there is already a pending chunk then no flush happened,
|
||||||
|
// appending entire chunk to pending one
|
||||||
|
this.pendingChunk += chunk;
|
||||||
|
} else {
|
||||||
|
// Create a pending chunk, it will start with non-whitespace since
|
||||||
|
// flushPoint was moved forward away from whitespaces on scan
|
||||||
|
this.pendingChunk = chunk.slice(flushPoint, chunkLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chunkOffset += chunkLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
finish() {
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
this.flush('', 0, 0);
|
||||||
|
this.pendingChunk = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var src = {
|
||||||
|
version: require$$0.version,
|
||||||
|
stringifyInfo: stringifyInfo,
|
||||||
|
stringifyStream: stringifyStreamBrowser,
|
||||||
|
parseChunked: parseChunked
|
||||||
|
};
|
||||||
|
|
||||||
|
return src;
|
||||||
|
|
||||||
|
})));
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
"name": "@discoveryjs/json-ext",
|
||||||
|
"version": "0.5.3",
|
||||||
|
"description": "A set of utilities that extend the use of JSON",
|
||||||
|
"keywords": [
|
||||||
|
"json",
|
||||||
|
"utils",
|
||||||
|
"stream",
|
||||||
|
"async",
|
||||||
|
"promise",
|
||||||
|
"stringify",
|
||||||
|
"info"
|
||||||
|
],
|
||||||
|
"author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
|
||||||
|
"license": "MIT",
|
||||||
|
"repository": "discoveryjs/json-ext",
|
||||||
|
"main": "./src/index",
|
||||||
|
"browser": {
|
||||||
|
"./src/stringify-stream.js": "./src/stringify-stream-browser.js",
|
||||||
|
"./src/text-decoder.js": "./src/text-decoder-browser.js"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "mocha --reporter progress",
|
||||||
|
"lint": "eslint src test",
|
||||||
|
"lint-and-test": "npm run lint && npm test",
|
||||||
|
"build": "rollup --config",
|
||||||
|
"test:all": "npm run test:src && npm run test:dist",
|
||||||
|
"test:src": "npm test",
|
||||||
|
"test:dist": "cross-env MODE=dist npm test && cross-env MODE=dist-min npm test",
|
||||||
|
"build-and-test": "npm run build && npm run test:dist",
|
||||||
|
"coverage": "nyc npm test",
|
||||||
|
"travis": "nyc npm run lint-and-test && npm run build-and-test && npm run coveralls",
|
||||||
|
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
||||||
|
"prepublishOnly": "npm run build"
|
||||||
|
},
|
||||||
|
"dependencies": {},
|
||||||
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-commonjs": "^15.1.0",
|
||||||
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
|
"@rollup/plugin-node-resolve": "^9.0.0",
|
||||||
|
"chalk": "^4.1.0",
|
||||||
|
"coveralls": "^3.1.0",
|
||||||
|
"cross-env": "^7.0.3",
|
||||||
|
"eslint": "^7.6.0",
|
||||||
|
"mocha": "^8.1.1",
|
||||||
|
"nyc": "^15.1.0",
|
||||||
|
"rollup": "^2.28.2",
|
||||||
|
"rollup-plugin-terser": "^7.0.2"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
module.exports = {
|
||||||
|
version: require('../package.json').version,
|
||||||
|
stringifyInfo: require('./stringify-info'),
|
||||||
|
stringifyStream: require('./stringify-stream'),
|
||||||
|
parseChunked: require('./parse-chunked')
|
||||||
|
};
|
|
@ -0,0 +1,384 @@
|
||||||
|
const { isReadableStream } = require('./utils');
|
||||||
|
const TextDecoder = require('./text-decoder');
|
||||||
|
|
||||||
|
const STACK_OBJECT = 1;
|
||||||
|
const STACK_ARRAY = 2;
|
||||||
|
const decoder = new TextDecoder();
|
||||||
|
|
||||||
|
function isObject(value) {
|
||||||
|
return value !== null && typeof value === 'object';
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjustPosition(error, parser) {
|
||||||
|
if (error.name === 'SyntaxError' && parser.jsonParseOffset) {
|
||||||
|
error.message = error.message.replace(/at position (\d+)/, (_, pos) =>
|
||||||
|
'at position ' + (Number(pos) + parser.jsonParseOffset)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return error;
|
||||||
|
}
|
||||||
|
|
||||||
|
function append(array, elements) {
|
||||||
|
// Note: Avoid to use array.push(...elements) since it may lead to
|
||||||
|
// "RangeError: Maximum call stack size exceeded" for a long arrays
|
||||||
|
const initialLength = array.length;
|
||||||
|
array.length += elements.length;
|
||||||
|
|
||||||
|
for (let i = 0; i < elements.length; i++) {
|
||||||
|
array[initialLength + i] = elements[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function(chunkEmitter) {
|
||||||
|
let parser = new ChunkParser();
|
||||||
|
|
||||||
|
if (isObject(chunkEmitter) && isReadableStream(chunkEmitter)) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
chunkEmitter
|
||||||
|
.on('data', chunk => {
|
||||||
|
try {
|
||||||
|
parser.push(chunk);
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.on('error', (e) => {
|
||||||
|
parser = null;
|
||||||
|
reject(e);
|
||||||
|
})
|
||||||
|
.on('end', () => {
|
||||||
|
try {
|
||||||
|
resolve(parser.finish());
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
} finally {
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof chunkEmitter === 'function') {
|
||||||
|
const iterator = chunkEmitter();
|
||||||
|
|
||||||
|
if (isObject(iterator) && (Symbol.iterator in iterator || Symbol.asyncIterator in iterator)) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
|
for await (const chunk of iterator) {
|
||||||
|
parser.push(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
resolve(parser.finish());
|
||||||
|
} catch (e) {
|
||||||
|
reject(adjustPosition(e, parser));
|
||||||
|
} finally {
|
||||||
|
parser = null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new Error(
|
||||||
|
'Chunk emitter should be readable stream, generator, ' +
|
||||||
|
'async generator or function returning an iterable object'
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
class ChunkParser {
|
||||||
|
constructor() {
|
||||||
|
this.value = undefined;
|
||||||
|
this.valueStack = null;
|
||||||
|
|
||||||
|
this.stack = new Array(100);
|
||||||
|
this.lastFlushDepth = 0;
|
||||||
|
this.flushDepth = 0;
|
||||||
|
this.stateString = false;
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
this.pendingByteSeq = null;
|
||||||
|
this.pendingChunk = null;
|
||||||
|
this.chunkOffset = 0;
|
||||||
|
this.jsonParseOffset = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
parseAndAppend(fragment, wrap) {
|
||||||
|
// Append new entries or elements
|
||||||
|
if (this.stack[this.lastFlushDepth - 1] === STACK_OBJECT) {
|
||||||
|
if (wrap) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = '{' + fragment + '}';
|
||||||
|
}
|
||||||
|
|
||||||
|
Object.assign(this.valueStack.value, JSON.parse(fragment));
|
||||||
|
} else {
|
||||||
|
if (wrap) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = '[' + fragment + ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
append(this.valueStack.value, JSON.parse(fragment));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prepareAddition(fragment) {
|
||||||
|
const { value } = this.valueStack;
|
||||||
|
const expectComma = Array.isArray(value)
|
||||||
|
? value.length !== 0
|
||||||
|
: Object.keys(value).length !== 0;
|
||||||
|
|
||||||
|
if (expectComma) {
|
||||||
|
// Skip a comma at the beginning of fragment, otherwise it would
|
||||||
|
// fail to parse
|
||||||
|
if (fragment[0] === ',') {
|
||||||
|
this.jsonParseOffset++;
|
||||||
|
return fragment.slice(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// When value (an object or array) is not empty and a fragment
|
||||||
|
// doesn't start with a comma, a single valid fragment starting
|
||||||
|
// is a closing bracket. If it's not, a prefix is adding to fail
|
||||||
|
// parsing. Otherwise, the sequence of chunks can be successfully
|
||||||
|
// parsed, although it should not, e.g. ["[{}", "{}]"]
|
||||||
|
if (fragment[0] !== '}' && fragment[0] !== ']') {
|
||||||
|
this.jsonParseOffset -= 3;
|
||||||
|
return '[[]' + fragment;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
flush(chunk, start, end) {
|
||||||
|
let fragment = chunk.slice(start, end);
|
||||||
|
|
||||||
|
// Save position correction an error in JSON.parse() if any
|
||||||
|
this.jsonParseOffset = this.chunkOffset + start;
|
||||||
|
|
||||||
|
// Prepend pending chunk if any
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
fragment = this.pendingChunk + fragment;
|
||||||
|
this.jsonParseOffset -= this.pendingChunk.length;
|
||||||
|
this.pendingChunk = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.flushDepth === this.lastFlushDepth) {
|
||||||
|
// Depth didn't changed, so it's a root value or entry/element set
|
||||||
|
if (this.flushDepth > 0) {
|
||||||
|
this.parseAndAppend(this.prepareAddition(fragment), true);
|
||||||
|
} else {
|
||||||
|
// That's an entire value on a top level
|
||||||
|
this.value = JSON.parse(fragment);
|
||||||
|
this.valueStack = {
|
||||||
|
value: this.value,
|
||||||
|
prev: null
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else if (this.flushDepth > this.lastFlushDepth) {
|
||||||
|
// Add missed closing brackets/parentheses
|
||||||
|
for (let i = this.flushDepth - 1; i >= this.lastFlushDepth; i--) {
|
||||||
|
fragment += this.stack[i] === STACK_OBJECT ? '}' : ']';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.lastFlushDepth === 0) {
|
||||||
|
// That's a root value
|
||||||
|
this.value = JSON.parse(fragment);
|
||||||
|
this.valueStack = {
|
||||||
|
value: this.value,
|
||||||
|
prev: null
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.parseAndAppend(this.prepareAddition(fragment), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Move down to the depths to the last object/array, which is current now
|
||||||
|
for (let i = this.lastFlushDepth || 1; i < this.flushDepth; i++) {
|
||||||
|
let value = this.valueStack.value;
|
||||||
|
|
||||||
|
if (this.stack[i - 1] === STACK_OBJECT) {
|
||||||
|
// find last entry
|
||||||
|
let key;
|
||||||
|
// eslint-disable-next-line curly
|
||||||
|
for (key in value);
|
||||||
|
value = value[key];
|
||||||
|
} else {
|
||||||
|
// last element
|
||||||
|
value = value[value.length - 1];
|
||||||
|
}
|
||||||
|
|
||||||
|
this.valueStack = {
|
||||||
|
value,
|
||||||
|
prev: this.valueStack
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else /* this.flushDepth < this.lastFlushDepth */ {
|
||||||
|
fragment = this.prepareAddition(fragment);
|
||||||
|
|
||||||
|
// Add missed opening brackets/parentheses
|
||||||
|
for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) {
|
||||||
|
this.jsonParseOffset--;
|
||||||
|
fragment = (this.stack[i] === STACK_OBJECT ? '{' : '[') + fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.parseAndAppend(fragment, false);
|
||||||
|
|
||||||
|
for (let i = this.lastFlushDepth - 1; i >= this.flushDepth; i--) {
|
||||||
|
this.valueStack = this.valueStack.prev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lastFlushDepth = this.flushDepth;
|
||||||
|
}
|
||||||
|
|
||||||
|
push(chunk) {
|
||||||
|
if (typeof chunk !== 'string') {
|
||||||
|
// Suppose chunk is Buffer or Uint8Array
|
||||||
|
|
||||||
|
// Prepend uncompleted byte sequence if any
|
||||||
|
if (this.pendingByteSeq !== null) {
|
||||||
|
const origRawChunk = chunk;
|
||||||
|
chunk = new Uint8Array(this.pendingByteSeq.length + origRawChunk.length);
|
||||||
|
chunk.set(this.pendingByteSeq);
|
||||||
|
chunk.set(origRawChunk, this.pendingByteSeq.length);
|
||||||
|
this.pendingByteSeq = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// In case Buffer/Uint8Array, an input is encoded in UTF8
|
||||||
|
// Seek for parts of uncompleted UTF8 symbol on the ending
|
||||||
|
// This makes sense only if we expect more chunks and last char is not multi-bytes
|
||||||
|
if (chunk[chunk.length - 1] > 127) {
|
||||||
|
for (let seqLength = 0; seqLength < chunk.length; seqLength++) {
|
||||||
|
const byte = chunk[chunk.length - 1 - seqLength];
|
||||||
|
|
||||||
|
// 10xxxxxx - 2nd, 3rd or 4th byte
|
||||||
|
// 110xxxxx – first byte of 2-byte sequence
|
||||||
|
// 1110xxxx - first byte of 3-byte sequence
|
||||||
|
// 11110xxx - first byte of 4-byte sequence
|
||||||
|
if (byte >> 6 === 3) {
|
||||||
|
seqLength++;
|
||||||
|
|
||||||
|
// If the sequence is really incomplete, then preserve it
|
||||||
|
// for the future chunk and cut off it from the current chunk
|
||||||
|
if ((seqLength !== 4 && byte >> 3 === 0b11110) ||
|
||||||
|
(seqLength !== 3 && byte >> 4 === 0b1110) ||
|
||||||
|
(seqLength !== 2 && byte >> 5 === 0b110)) {
|
||||||
|
this.pendingByteSeq = chunk.slice(chunk.length - seqLength);
|
||||||
|
chunk = chunk.slice(0, -seqLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Convert chunk to a string, since single decode per chunk
|
||||||
|
// is much effective than decode multiple small substrings
|
||||||
|
chunk = decoder.decode(chunk);
|
||||||
|
}
|
||||||
|
|
||||||
|
const chunkLength = chunk.length;
|
||||||
|
let lastFlushPoint = 0;
|
||||||
|
let flushPoint = 0;
|
||||||
|
|
||||||
|
// Main scan loop
|
||||||
|
scan: for (let i = 0; i < chunkLength; i++) {
|
||||||
|
if (this.stateString) {
|
||||||
|
for (; i < chunkLength; i++) {
|
||||||
|
if (this.stateStringEscape) {
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
} else {
|
||||||
|
switch (chunk.charCodeAt(i)) {
|
||||||
|
case 0x22: /* " */
|
||||||
|
this.stateString = false;
|
||||||
|
continue scan;
|
||||||
|
|
||||||
|
case 0x5C: /* \ */
|
||||||
|
this.stateStringEscape = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (chunk.charCodeAt(i)) {
|
||||||
|
case 0x22: /* " */
|
||||||
|
this.stateString = true;
|
||||||
|
this.stateStringEscape = false;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x2C: /* , */
|
||||||
|
flushPoint = i;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x7B: /* { */
|
||||||
|
// Open an object
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.stack[this.flushDepth++] = STACK_OBJECT;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x5B: /* [ */
|
||||||
|
// Open an array
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.stack[this.flushDepth++] = STACK_ARRAY;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x5D: /* ] */
|
||||||
|
case 0x7D: /* } */
|
||||||
|
// Close an object or array
|
||||||
|
flushPoint = i + 1;
|
||||||
|
this.flushDepth--;
|
||||||
|
|
||||||
|
if (this.flushDepth < this.lastFlushDepth) {
|
||||||
|
this.flush(chunk, lastFlushPoint, flushPoint);
|
||||||
|
lastFlushPoint = flushPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x09: /* \t */
|
||||||
|
case 0x0A: /* \n */
|
||||||
|
case 0x0D: /* \r */
|
||||||
|
case 0x20: /* space */
|
||||||
|
// Move points forward when they points on current position and it's a whitespace
|
||||||
|
if (lastFlushPoint === i) {
|
||||||
|
lastFlushPoint++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flushPoint === i) {
|
||||||
|
flushPoint++;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flushPoint > lastFlushPoint) {
|
||||||
|
this.flush(chunk, lastFlushPoint, flushPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Produce pendingChunk if something left
|
||||||
|
if (flushPoint < chunkLength) {
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
// When there is already a pending chunk then no flush happened,
|
||||||
|
// appending entire chunk to pending one
|
||||||
|
this.pendingChunk += chunk;
|
||||||
|
} else {
|
||||||
|
// Create a pending chunk, it will start with non-whitespace since
|
||||||
|
// flushPoint was moved forward away from whitespaces on scan
|
||||||
|
this.pendingChunk = chunk.slice(flushPoint, chunkLength);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.chunkOffset += chunkLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
finish() {
|
||||||
|
if (this.pendingChunk !== null) {
|
||||||
|
this.flush('', 0, 0);
|
||||||
|
this.pendingChunk = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,231 @@
|
||||||
|
const {
|
||||||
|
normalizeReplacer,
|
||||||
|
normalizeSpace,
|
||||||
|
replaceValue,
|
||||||
|
getTypeNative,
|
||||||
|
getTypeAsync,
|
||||||
|
isLeadingSurrogate,
|
||||||
|
isTrailingSurrogate,
|
||||||
|
escapableCharCodeSubstitution,
|
||||||
|
type: {
|
||||||
|
PRIMITIVE,
|
||||||
|
OBJECT,
|
||||||
|
ARRAY,
|
||||||
|
PROMISE,
|
||||||
|
STRING_STREAM,
|
||||||
|
OBJECT_STREAM
|
||||||
|
}
|
||||||
|
} = require('./utils');
|
||||||
|
const charLength2048 = Array.from({ length: 2048 }).map((_, code) => {
|
||||||
|
if (escapableCharCodeSubstitution.hasOwnProperty(code)) {
|
||||||
|
return 2; // \X
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code < 0x20) {
|
||||||
|
return 6; // \uXXXX
|
||||||
|
}
|
||||||
|
|
||||||
|
return code < 128 ? 1 : 2; // UTF8 bytes
|
||||||
|
});
|
||||||
|
|
||||||
|
function stringLength(str) {
|
||||||
|
let len = 0;
|
||||||
|
let prevLeadingSurrogate = false;
|
||||||
|
|
||||||
|
for (let i = 0; i < str.length; i++) {
|
||||||
|
const code = str.charCodeAt(i);
|
||||||
|
|
||||||
|
if (code < 2048) {
|
||||||
|
len += charLength2048[code];
|
||||||
|
} else if (isLeadingSurrogate(code)) {
|
||||||
|
len += 6; // \uXXXX since no pair with trailing surrogate yet
|
||||||
|
prevLeadingSurrogate = true;
|
||||||
|
continue;
|
||||||
|
} else if (isTrailingSurrogate(code)) {
|
||||||
|
len = prevLeadingSurrogate
|
||||||
|
? len - 2 // surrogate pair (4 bytes), since we calculate prev leading surrogate as 6 bytes, substruct 2 bytes
|
||||||
|
: len + 6; // \uXXXX
|
||||||
|
} else {
|
||||||
|
len += 3; // code >= 2048 is 3 bytes length for UTF8
|
||||||
|
}
|
||||||
|
|
||||||
|
prevLeadingSurrogate = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return len + 2; // +2 for quotes
|
||||||
|
}
|
||||||
|
|
||||||
|
function primitiveLength(value) {
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'string':
|
||||||
|
return stringLength(value);
|
||||||
|
|
||||||
|
case 'number':
|
||||||
|
return Number.isFinite(value) ? String(value).length : 4 /* null */;
|
||||||
|
|
||||||
|
case 'boolean':
|
||||||
|
return value ? 4 /* true */ : 5 /* false */;
|
||||||
|
|
||||||
|
case 'undefined':
|
||||||
|
case 'object':
|
||||||
|
return 4; /* null */
|
||||||
|
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function spaceLength(space) {
|
||||||
|
space = normalizeSpace(space);
|
||||||
|
return typeof space === 'string' ? space.length : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function jsonStringifyInfo(value, replacer, space, options) {
|
||||||
|
function walk(holder, key, value) {
|
||||||
|
if (stop) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
value = replaceValue(holder, key, value, replacer);
|
||||||
|
|
||||||
|
let type = getType(value);
|
||||||
|
|
||||||
|
// check for circular structure
|
||||||
|
if (type !== PRIMITIVE && stack.has(value)) {
|
||||||
|
circular.add(value);
|
||||||
|
length += 4; // treat as null
|
||||||
|
|
||||||
|
if (!options.continueOnCircular) {
|
||||||
|
stop = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PRIMITIVE:
|
||||||
|
if (value !== undefined || Array.isArray(holder)) {
|
||||||
|
length += primitiveLength(value);
|
||||||
|
} else if (holder === root) {
|
||||||
|
length += 9; // FIXME: that's the length of undefined, should we normalize behaviour to convert it to null?
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OBJECT: {
|
||||||
|
if (visited.has(value)) {
|
||||||
|
duplicate.add(value);
|
||||||
|
length += visited.get(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const valueLength = length;
|
||||||
|
let entries = 0;
|
||||||
|
|
||||||
|
length += 2; // {}
|
||||||
|
|
||||||
|
stack.add(value);
|
||||||
|
|
||||||
|
for (const key in value) {
|
||||||
|
if (hasOwnProperty.call(value, key) && (allowlist === null || allowlist.has(key))) {
|
||||||
|
const prevLength = length;
|
||||||
|
walk(value, key, value[key]);
|
||||||
|
|
||||||
|
if (prevLength !== length) {
|
||||||
|
// value is printed
|
||||||
|
length += stringLength(key) + 1; // "key":
|
||||||
|
entries++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entries > 1) {
|
||||||
|
length += entries - 1; // commas
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.delete(value);
|
||||||
|
|
||||||
|
if (space > 0 && entries > 0) {
|
||||||
|
length += (1 + (stack.size + 1) * space + 1) * entries; // for each key-value: \n{space}
|
||||||
|
length += 1 + stack.size * space; // for }
|
||||||
|
}
|
||||||
|
|
||||||
|
visited.set(value, length - valueLength);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case ARRAY: {
|
||||||
|
if (visited.has(value)) {
|
||||||
|
duplicate.add(value);
|
||||||
|
length += visited.get(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
const valueLength = length;
|
||||||
|
|
||||||
|
length += 2; // []
|
||||||
|
|
||||||
|
stack.add(value);
|
||||||
|
|
||||||
|
for (let i = 0; i < value.length; i++) {
|
||||||
|
walk(value, i, value[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.length > 1) {
|
||||||
|
length += value.length - 1; // commas
|
||||||
|
}
|
||||||
|
|
||||||
|
stack.delete(value);
|
||||||
|
|
||||||
|
if (space > 0 && value.length > 0) {
|
||||||
|
length += (1 + (stack.size + 1) * space) * value.length; // for each element: \n{space}
|
||||||
|
length += 1 + stack.size * space; // for ]
|
||||||
|
}
|
||||||
|
|
||||||
|
visited.set(value, length - valueLength);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case PROMISE:
|
||||||
|
case STRING_STREAM:
|
||||||
|
async.add(value);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OBJECT_STREAM:
|
||||||
|
length += 2; // []
|
||||||
|
async.add(value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let allowlist = null;
|
||||||
|
replacer = normalizeReplacer(replacer);
|
||||||
|
|
||||||
|
if (Array.isArray(replacer)) {
|
||||||
|
allowlist = new Set(replacer);
|
||||||
|
replacer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
space = spaceLength(space);
|
||||||
|
options = options || {};
|
||||||
|
|
||||||
|
const visited = new Map();
|
||||||
|
const stack = new Set();
|
||||||
|
const duplicate = new Set();
|
||||||
|
const circular = new Set();
|
||||||
|
const async = new Set();
|
||||||
|
const getType = options.async ? getTypeAsync : getTypeNative;
|
||||||
|
const root = { '': value };
|
||||||
|
let stop = false;
|
||||||
|
let length = 0;
|
||||||
|
|
||||||
|
walk(root, '', value);
|
||||||
|
|
||||||
|
return {
|
||||||
|
minLength: isNaN(length) ? Infinity : length,
|
||||||
|
circular: [...circular],
|
||||||
|
duplicate: [...duplicate],
|
||||||
|
async: [...async]
|
||||||
|
};
|
||||||
|
};
|
3
api/node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js
generated
vendored
Normal file
3
api/node_modules/@discoveryjs/json-ext/src/stringify-stream-browser.js
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = () => {
|
||||||
|
throw new Error('Method is not supported');
|
||||||
|
};
|
|
@ -0,0 +1,404 @@
|
||||||
|
const { Readable } = require('stream');
|
||||||
|
const {
|
||||||
|
normalizeReplacer,
|
||||||
|
normalizeSpace,
|
||||||
|
replaceValue,
|
||||||
|
getTypeAsync,
|
||||||
|
type: {
|
||||||
|
PRIMITIVE,
|
||||||
|
OBJECT,
|
||||||
|
ARRAY,
|
||||||
|
PROMISE,
|
||||||
|
STRING_STREAM,
|
||||||
|
OBJECT_STREAM
|
||||||
|
}
|
||||||
|
} = require('./utils');
|
||||||
|
const noop = () => {};
|
||||||
|
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||||
|
|
||||||
|
// TODO: Remove when drop support for Node.js 10
|
||||||
|
// Node.js 10 has no well-formed JSON.stringify()
|
||||||
|
// https://github.com/tc39/proposal-well-formed-stringify
|
||||||
|
// Adopted code from https://bugs.chromium.org/p/v8/issues/detail?id=7782#c12
|
||||||
|
const wellformedStringStringify = JSON.stringify('\ud800') === '"\\ud800"'
|
||||||
|
? JSON.stringify
|
||||||
|
: s => JSON.stringify(s).replace(
|
||||||
|
/\p{Surrogate}/gu,
|
||||||
|
m => `\\u${m.charCodeAt(0).toString(16)}`
|
||||||
|
);
|
||||||
|
|
||||||
|
function push() {
|
||||||
|
this.push(this._stack.value);
|
||||||
|
this.popStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
function pushPrimitive(value) {
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'string':
|
||||||
|
this.push(this.encodeString(value));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'number':
|
||||||
|
this.push(Number.isFinite(value) ? this.encodeNumber(value) : 'null');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'boolean':
|
||||||
|
this.push(value ? 'true' : 'false');
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'undefined':
|
||||||
|
case 'object': // typeof null === 'object'
|
||||||
|
this.push('null');
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
this.destroy(new TypeError(`Do not know how to serialize a ${value.constructor && value.constructor.name || typeof value}`));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function processObjectEntry(key) {
|
||||||
|
const current = this._stack;
|
||||||
|
|
||||||
|
if (!current.first) {
|
||||||
|
current.first = true;
|
||||||
|
} else {
|
||||||
|
this.push(',');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.space) {
|
||||||
|
this.push(`\n${this.space.repeat(this._depth)}${this.encodeString(key)}: `);
|
||||||
|
} else {
|
||||||
|
this.push(this.encodeString(key) + ':');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function processObject() {
|
||||||
|
const current = this._stack;
|
||||||
|
|
||||||
|
// when no keys left, remove obj from stack
|
||||||
|
if (current.index === current.keys.length) {
|
||||||
|
if (this.space && current.first) {
|
||||||
|
this.push(`\n${this.space.repeat(this._depth - 1)}}`);
|
||||||
|
} else {
|
||||||
|
this.push('}');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popStack();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const key = current.keys[current.index];
|
||||||
|
|
||||||
|
this.processValue(current.value, key, current.value[key], processObjectEntry);
|
||||||
|
current.index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
function processArrayItem(index) {
|
||||||
|
if (index !== 0) {
|
||||||
|
this.push(',');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.space) {
|
||||||
|
this.push(`\n${this.space.repeat(this._depth)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function processArray() {
|
||||||
|
const current = this._stack;
|
||||||
|
|
||||||
|
if (current.index === current.value.length) {
|
||||||
|
if (this.space && current.index > 0) {
|
||||||
|
this.push(`\n${this.space.repeat(this._depth - 1)}]`);
|
||||||
|
} else {
|
||||||
|
this.push(']');
|
||||||
|
}
|
||||||
|
|
||||||
|
this.popStack();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.processValue(current.value, current.index, current.value[current.index], processArrayItem);
|
||||||
|
current.index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
function createStreamReader(fn) {
|
||||||
|
return function() {
|
||||||
|
const current = this._stack;
|
||||||
|
const data = current.value.read(this._readSize);
|
||||||
|
|
||||||
|
if (data !== null) {
|
||||||
|
current.first = false;
|
||||||
|
fn.call(this, data, current);
|
||||||
|
} else {
|
||||||
|
if (current.first && !current.value._readableState.reading) {
|
||||||
|
this.popStack();
|
||||||
|
} else {
|
||||||
|
current.first = true;
|
||||||
|
current.awaiting = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const processReadableObject = createStreamReader(function(data, current) {
|
||||||
|
this.processValue(current.value, current.index, data, processArrayItem);
|
||||||
|
current.index++;
|
||||||
|
});
|
||||||
|
|
||||||
|
const processReadableString = createStreamReader(function(data) {
|
||||||
|
this.push(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
class JsonStringifyStream extends Readable {
|
||||||
|
constructor(value, replacer, space) {
|
||||||
|
super({
|
||||||
|
autoDestroy: true
|
||||||
|
});
|
||||||
|
|
||||||
|
this.getKeys = Object.keys;
|
||||||
|
this.replacer = normalizeReplacer(replacer);
|
||||||
|
|
||||||
|
if (Array.isArray(this.replacer)) {
|
||||||
|
const allowlist = this.replacer;
|
||||||
|
|
||||||
|
this.getKeys = (value) => allowlist.filter(key => hasOwnProperty.call(value, key));
|
||||||
|
this.replacer = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.space = normalizeSpace(space);
|
||||||
|
this._depth = 0;
|
||||||
|
|
||||||
|
this.error = null;
|
||||||
|
this._processing = false;
|
||||||
|
this._ended = false;
|
||||||
|
|
||||||
|
this._readSize = 0;
|
||||||
|
this._buffer = '';
|
||||||
|
|
||||||
|
this._stack = null;
|
||||||
|
this._visited = new WeakSet();
|
||||||
|
|
||||||
|
this.pushStack({
|
||||||
|
handler: () => {
|
||||||
|
this.popStack();
|
||||||
|
this.processValue({ '': value }, '', value, noop);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
encodeString(value) {
|
||||||
|
if (/[^\x20-\uD799]|[\x22\x5c]/.test(value)) {
|
||||||
|
return wellformedStringStringify(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '"' + value + '"';
|
||||||
|
}
|
||||||
|
|
||||||
|
encodeNumber(value) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
processValue(holder, key, value, callback) {
|
||||||
|
value = replaceValue(holder, key, value, this.replacer);
|
||||||
|
|
||||||
|
let type = getTypeAsync(value);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case PRIMITIVE:
|
||||||
|
if (callback !== processObjectEntry || value !== undefined) {
|
||||||
|
callback.call(this, key);
|
||||||
|
pushPrimitive.call(this, value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case OBJECT:
|
||||||
|
callback.call(this, key);
|
||||||
|
|
||||||
|
// check for circular structure
|
||||||
|
if (this._visited.has(value)) {
|
||||||
|
return this.destroy(new TypeError('Converting circular structure to JSON'));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._visited.add(value);
|
||||||
|
this._depth++;
|
||||||
|
this.push('{');
|
||||||
|
this.pushStack({
|
||||||
|
handler: processObject,
|
||||||
|
value,
|
||||||
|
index: 0,
|
||||||
|
first: false,
|
||||||
|
keys: this.getKeys(value)
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ARRAY:
|
||||||
|
callback.call(this, key);
|
||||||
|
|
||||||
|
// check for circular structure
|
||||||
|
if (this._visited.has(value)) {
|
||||||
|
return this.destroy(new TypeError('Converting circular structure to JSON'));
|
||||||
|
}
|
||||||
|
|
||||||
|
this._visited.add(value);
|
||||||
|
|
||||||
|
this.push('[');
|
||||||
|
this.pushStack({
|
||||||
|
handler: processArray,
|
||||||
|
value,
|
||||||
|
index: 0
|
||||||
|
});
|
||||||
|
this._depth++;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PROMISE:
|
||||||
|
this.pushStack({
|
||||||
|
handler: noop,
|
||||||
|
awaiting: true
|
||||||
|
});
|
||||||
|
|
||||||
|
Promise.resolve(value)
|
||||||
|
.then(resolved => {
|
||||||
|
this.popStack();
|
||||||
|
this.processValue(holder, key, resolved, callback);
|
||||||
|
this.processStack();
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
this.destroy(error);
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case STRING_STREAM:
|
||||||
|
case OBJECT_STREAM:
|
||||||
|
callback.call(this, key);
|
||||||
|
|
||||||
|
// TODO: Remove when drop support for Node.js 10
|
||||||
|
// Used `_readableState.endEmitted` as fallback, since Node.js 10 has no `readableEnded` getter
|
||||||
|
if (value.readableEnded || value._readableState.endEmitted) {
|
||||||
|
return this.destroy(new Error('Readable Stream has ended before it was serialized. All stream data have been lost'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.readableFlowing) {
|
||||||
|
return this.destroy(new Error('Readable Stream is in flowing mode, data may have been lost. Trying to pause stream.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type === OBJECT_STREAM) {
|
||||||
|
this.push('[');
|
||||||
|
this.pushStack({
|
||||||
|
handler: push,
|
||||||
|
value: this.space ? '\n' + this.space.repeat(this._depth) + ']' : ']'
|
||||||
|
});
|
||||||
|
this._depth++;
|
||||||
|
}
|
||||||
|
|
||||||
|
const self = this.pushStack({
|
||||||
|
handler: type === OBJECT_STREAM ? processReadableObject : processReadableString,
|
||||||
|
value,
|
||||||
|
index: 0,
|
||||||
|
first: false,
|
||||||
|
awaiting: !value.readable || value.readableLength === 0
|
||||||
|
});
|
||||||
|
const continueProcessing = () => {
|
||||||
|
if (self.awaiting) {
|
||||||
|
self.awaiting = false;
|
||||||
|
this.processStack();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
value.once('error', error => this.destroy(error));
|
||||||
|
value.once('end', continueProcessing);
|
||||||
|
value.on('readable', continueProcessing);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pushStack(node) {
|
||||||
|
node.prev = this._stack;
|
||||||
|
return this._stack = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
popStack() {
|
||||||
|
const { handler, value } = this._stack;
|
||||||
|
|
||||||
|
if (handler === processObject || handler === processArray || handler === processReadableObject) {
|
||||||
|
this._visited.delete(value);
|
||||||
|
this._depth--;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._stack = this._stack.prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
processStack() {
|
||||||
|
if (this._processing || this._ended) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this._processing = true;
|
||||||
|
|
||||||
|
while (this._stack !== null && !this._stack.awaiting) {
|
||||||
|
this._stack.handler.call(this);
|
||||||
|
|
||||||
|
if (!this._processing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this._processing = false;
|
||||||
|
} catch (error) {
|
||||||
|
this.destroy(error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._stack === null && !this._ended) {
|
||||||
|
this._finish();
|
||||||
|
this.push(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
push(data) {
|
||||||
|
if (data !== null) {
|
||||||
|
this._buffer += data;
|
||||||
|
|
||||||
|
// check buffer overflow
|
||||||
|
if (this._buffer.length < this._readSize) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// flush buffer
|
||||||
|
data = this._buffer;
|
||||||
|
this._buffer = '';
|
||||||
|
this._processing = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
super.push(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
_read(size) {
|
||||||
|
// start processing
|
||||||
|
this._readSize = size || this.readableHighWaterMark;
|
||||||
|
this.processStack();
|
||||||
|
}
|
||||||
|
|
||||||
|
_finish() {
|
||||||
|
this._ended = true;
|
||||||
|
this._processing = false;
|
||||||
|
this._stack = null;
|
||||||
|
this._visited = null;
|
||||||
|
|
||||||
|
if (this._buffer && this._buffer.length) {
|
||||||
|
super.push(this._buffer); // flush buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
this._buffer = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
_destroy(error, cb) {
|
||||||
|
this.error = this.error || error;
|
||||||
|
this._finish();
|
||||||
|
cb(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = function createJsonStringifyStream(value, replacer, space) {
|
||||||
|
return new JsonStringifyStream(value, replacer, space);
|
||||||
|
};
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = TextDecoder;
|
|
@ -0,0 +1 @@
|
||||||
|
module.exports = require('util').TextDecoder;
|
|
@ -0,0 +1,149 @@
|
||||||
|
const PrimitiveType = 1;
|
||||||
|
const ObjectType = 2;
|
||||||
|
const ArrayType = 3;
|
||||||
|
const PromiseType = 4;
|
||||||
|
const ReadableStringType = 5;
|
||||||
|
const ReadableObjectType = 6;
|
||||||
|
// https://tc39.es/ecma262/#table-json-single-character-escapes
|
||||||
|
const escapableCharCodeSubstitution = { // JSON Single Character Escape Sequences
|
||||||
|
0x08: '\\b',
|
||||||
|
0x09: '\\t',
|
||||||
|
0x0a: '\\n',
|
||||||
|
0x0c: '\\f',
|
||||||
|
0x0d: '\\r',
|
||||||
|
0x22: '\\\"',
|
||||||
|
0x5c: '\\\\'
|
||||||
|
};
|
||||||
|
|
||||||
|
function isLeadingSurrogate(code) {
|
||||||
|
return code >= 0xD800 && code <= 0xDBFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTrailingSurrogate(code) {
|
||||||
|
return code >= 0xDC00 && code <= 0xDFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isReadableStream(value) {
|
||||||
|
return (
|
||||||
|
typeof value.pipe === 'function' &&
|
||||||
|
typeof value._read === 'function' &&
|
||||||
|
typeof value._readableState === 'object' && value._readableState !== null
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function replaceValue(holder, key, value, replacer) {
|
||||||
|
if (value && typeof value.toJSON === 'function') {
|
||||||
|
value = value.toJSON();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replacer !== null) {
|
||||||
|
value = replacer.call(holder, String(key), value);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (typeof value) {
|
||||||
|
case 'function':
|
||||||
|
case 'symbol':
|
||||||
|
value = undefined;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'object':
|
||||||
|
if (value !== null) {
|
||||||
|
const cls = value.constructor;
|
||||||
|
if (cls === String || cls === Number || cls === Boolean) {
|
||||||
|
value = value.valueOf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTypeNative(value) {
|
||||||
|
if (value === null || typeof value !== 'object') {
|
||||||
|
return PrimitiveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return ArrayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ObjectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getTypeAsync(value) {
|
||||||
|
if (value === null || typeof value !== 'object') {
|
||||||
|
return PrimitiveType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof value.then === 'function') {
|
||||||
|
return PromiseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isReadableStream(value)) {
|
||||||
|
return value._readableState.objectMode ? ReadableObjectType : ReadableStringType;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
return ArrayType;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ObjectType;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeReplacer(replacer) {
|
||||||
|
if (typeof replacer === 'function') {
|
||||||
|
return replacer;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Array.isArray(replacer)) {
|
||||||
|
const allowlist = new Set(replacer
|
||||||
|
.map(item => {
|
||||||
|
const cls = item && item.constructor;
|
||||||
|
return cls === String || cls === Number ? String(item) : null;
|
||||||
|
})
|
||||||
|
.filter(item => typeof item === 'string')
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...allowlist];
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeSpace(space) {
|
||||||
|
if (typeof space === 'number') {
|
||||||
|
if (!Number.isFinite(space) || space < 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ' '.repeat(Math.min(space, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof space === 'string') {
|
||||||
|
return space.slice(0, 10) || false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
escapableCharCodeSubstitution,
|
||||||
|
isLeadingSurrogate,
|
||||||
|
isTrailingSurrogate,
|
||||||
|
type: {
|
||||||
|
PRIMITIVE: PrimitiveType,
|
||||||
|
PROMISE: PromiseType,
|
||||||
|
ARRAY: ArrayType,
|
||||||
|
OBJECT: ObjectType,
|
||||||
|
STRING_STREAM: ReadableStringType,
|
||||||
|
OBJECT_STREAM: ReadableObjectType
|
||||||
|
},
|
||||||
|
|
||||||
|
isReadableStream,
|
||||||
|
replaceValue,
|
||||||
|
getTypeNative,
|
||||||
|
getTypeAsync,
|
||||||
|
normalizeReplacer,
|
||||||
|
normalizeSpace
|
||||||
|
};
|
|
@ -0,0 +1,94 @@
|
||||||
|
# @improbable-eng/grpc-web
|
||||||
|
> Library for making gRPC-Web requests from a browser
|
||||||
|
|
||||||
|
This library is intended for both JavaScript and TypeScript usage from a web browser or NodeJS (see [Usage with NodeJS](#usage-with-nodejs)).
|
||||||
|
|
||||||
|
*Note: This only works if the server supports [gRPC-Web](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md)*
|
||||||
|
|
||||||
|
A Golang gRPC-Web middleware and a Golang-based gRPC-Web proxy are [available here](https://github.com/improbable-eng/grpc-web).
|
||||||
|
|
||||||
|
Please see the full [gRPC-Web README](https://github.com/improbable-eng/grpc-web) for known limitations.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
`@improbable-eng/grpc-web` has peer dependencies of `google-protobuf` and `@types/google-protobuf`.
|
||||||
|
|
||||||
|
`npm install google-protobuf @types/google-protobuf @improbable-eng/grpc-web --save`
|
||||||
|
|
||||||
|
## Example Project
|
||||||
|
|
||||||
|
There is an [example project available here](https://github.com/improbable-eng/grpc-web/tree/master/client/grpc-web-react-example)
|
||||||
|
|
||||||
|
## Usage Overview
|
||||||
|
* Use [`ts-protoc-gen`](https://www.npmjs.com/package/ts-protoc-gen) with [`protoc`](https://github.com/google/protobuf) to generate `.js` and `.d.ts` files for your request and response classes. `ts-protoc-gen` can also generate gRPC service definitions with the `service=true` argument.
|
||||||
|
* [Go to code generation docs](docs/code-generation.md)
|
||||||
|
* Make a request using [`unary()`](docs/unary.md), [`invoke()`](docs/invoke.md) or [`client()`](docs/client.md)
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import {grpc} from "@improbable-eng/grpc-web";
|
||||||
|
|
||||||
|
// Import code-generated data structures.
|
||||||
|
import {BookService} from "./generated/proto/examplecom/library/book_service_pb_service";
|
||||||
|
import {GetBookRequest} from "./generated/proto/examplecom/library/book_service_pb";
|
||||||
|
|
||||||
|
const getBookRequest = new GetBookRequest();
|
||||||
|
getBookRequest.setIsbn(60929871);
|
||||||
|
grpc.unary(BookService.GetBook, {
|
||||||
|
request: getBookRequest,
|
||||||
|
host: host,
|
||||||
|
onEnd: res => {
|
||||||
|
const { status, statusMessage, headers, message, trailers } = res;
|
||||||
|
if (status === grpc.Code.OK && message) {
|
||||||
|
console.log("all ok. got book: ", message.toObject());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
* Requests can be aborted/cancelled before they complete:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const request = grpc.unary(BookService.GetBook, { ... });
|
||||||
|
request.cancel();
|
||||||
|
```
|
||||||
|
|
||||||
|
## Available Request Functions
|
||||||
|
|
||||||
|
There are three functions for making gRPC requests:
|
||||||
|
|
||||||
|
### [`grpc.unary`](docs/unary.md)
|
||||||
|
This is a convenience function for making requests that consist of a single request message and single response message. It can only be used with unary methods.
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
rpc GetBook(GetBookRequest) returns (Book) {}
|
||||||
|
```
|
||||||
|
|
||||||
|
### [`grpc.invoke`](docs/invoke.md)
|
||||||
|
This is a convenience function for making requests that consist of a single request message and a stream of response messages (server-streaming). It can also be used with unary methods.
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
rpc GetBook(GetBookRequest) returns (Book) {}
|
||||||
|
rpc QueryBooks(QueryBooksRequest) returns (stream Book) {}
|
||||||
|
```
|
||||||
|
|
||||||
|
### [`grpc.client`](docs/client.md)
|
||||||
|
`grpc.client` returns a client. Dependant upon [transport compatibility](docs/transport.md) this client is capable of sending multiple request messages (client-streaming) and receiving multiple response messages (server-streaming). It can be used with any type of method, but will enforce limiting the sending of messages for unary methods.
|
||||||
|
|
||||||
|
```protobuf
|
||||||
|
rpc GetBook(GetBookRequest) returns (Book) {}
|
||||||
|
rpc QueryBooks(QueryBooksRequest) returns (stream Book) {}
|
||||||
|
rpc LogReadPages(stream PageRead) returns (google.protobuf.Empty) {}
|
||||||
|
rpc ListenForBooks(stream QueryBooksRequest) returns (stream Book) {}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage with NodeJS
|
||||||
|
Refer to [grpc-web-node-http-transport](https://www.npmjs.com/package/@improbable-eng/grpc-web-node-http-transport).
|
||||||
|
|
||||||
|
## All Docs
|
||||||
|
|
||||||
|
* [unary()](docs/unary.md)
|
||||||
|
* [invoke()](docs/invoke.md)
|
||||||
|
* [client()](docs/client.md)
|
||||||
|
* [Code Generation](docs/code-generation.md)
|
||||||
|
* [Concepts](docs/concepts.md)
|
||||||
|
* [Transport](docs/transport.md)
|
File diff suppressed because one or more lines are too long
1
api/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.umd.js
generated
vendored
Normal file
1
api/node_modules/@improbable-eng/grpc-web/dist/grpc-web-client.umd.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
17
api/node_modules/@improbable-eng/grpc-web/dist/typings/ChunkParser.d.ts
generated
vendored
Normal file
17
api/node_modules/@improbable-eng/grpc-web/dist/typings/ChunkParser.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { Metadata } from "./metadata";
|
||||||
|
export declare function decodeASCII(input: Uint8Array): string;
|
||||||
|
export declare function encodeASCII(input: string): Uint8Array;
|
||||||
|
export declare enum ChunkType {
|
||||||
|
MESSAGE = 1,
|
||||||
|
TRAILERS = 2
|
||||||
|
}
|
||||||
|
export declare type Chunk = {
|
||||||
|
chunkType: ChunkType;
|
||||||
|
trailers?: Metadata;
|
||||||
|
data?: Uint8Array;
|
||||||
|
};
|
||||||
|
export declare class ChunkParser {
|
||||||
|
buffer: Uint8Array | null;
|
||||||
|
position: number;
|
||||||
|
parse(bytes: Uint8Array, flush?: boolean): Chunk[];
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
export declare enum Code {
|
||||||
|
OK = 0,
|
||||||
|
Canceled = 1,
|
||||||
|
Unknown = 2,
|
||||||
|
InvalidArgument = 3,
|
||||||
|
DeadlineExceeded = 4,
|
||||||
|
NotFound = 5,
|
||||||
|
AlreadyExists = 6,
|
||||||
|
PermissionDenied = 7,
|
||||||
|
ResourceExhausted = 8,
|
||||||
|
FailedPrecondition = 9,
|
||||||
|
Aborted = 10,
|
||||||
|
OutOfRange = 11,
|
||||||
|
Unimplemented = 12,
|
||||||
|
Internal = 13,
|
||||||
|
Unavailable = 14,
|
||||||
|
DataLoss = 15,
|
||||||
|
Unauthenticated = 16
|
||||||
|
}
|
||||||
|
export declare function httpStatusToCode(httpStatus: number): Code;
|
22
api/node_modules/@improbable-eng/grpc-web/dist/typings/client.d.ts
generated
vendored
Normal file
22
api/node_modules/@improbable-eng/grpc-web/dist/typings/client.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import { Metadata } from "./metadata";
|
||||||
|
import { Code } from "./Code";
|
||||||
|
import { TransportFactory } from "./transports/Transport";
|
||||||
|
import { MethodDefinition } from "./service";
|
||||||
|
import { ProtobufMessage } from "./message";
|
||||||
|
export interface RpcOptions {
|
||||||
|
transport?: TransportFactory;
|
||||||
|
debug?: boolean;
|
||||||
|
}
|
||||||
|
export interface ClientRpcOptions extends RpcOptions {
|
||||||
|
host: string;
|
||||||
|
}
|
||||||
|
export interface Client<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> {
|
||||||
|
start(metadata?: Metadata.ConstructorArg): void;
|
||||||
|
send(message: TRequest): void;
|
||||||
|
finishSend(): void;
|
||||||
|
close(): void;
|
||||||
|
onHeaders(callback: (headers: Metadata) => void): void;
|
||||||
|
onMessage(callback: (message: TResponse) => void): void;
|
||||||
|
onEnd(callback: (code: Code, message: string, trailers: Metadata) => void): void;
|
||||||
|
}
|
||||||
|
export declare function client<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage, M extends MethodDefinition<TRequest, TResponse>>(methodDescriptor: M, props: ClientRpcOptions): Client<TRequest, TResponse>;
|
|
@ -0,0 +1 @@
|
||||||
|
export declare function debug(...args: any[]): void;
|
|
@ -0,0 +1 @@
|
||||||
|
export default function detach(cb: () => void): void;
|
|
@ -0,0 +1,60 @@
|
||||||
|
import { BrowserHeaders } from "browser-headers";
|
||||||
|
import * as impTransport from "./transports/Transport";
|
||||||
|
import * as impTransportFetch from "./transports/http/fetch";
|
||||||
|
import * as impTransportWebSocket from "./transports/websocket/websocket";
|
||||||
|
import * as impTransportXhr from "./transports/http/xhr";
|
||||||
|
import * as impTransportHttp from "./transports/http/http";
|
||||||
|
import * as impCode from "./Code";
|
||||||
|
import * as impInvoke from "./invoke";
|
||||||
|
import * as impUnary from "./unary";
|
||||||
|
import * as impClient from "./client";
|
||||||
|
import * as impService from "./service";
|
||||||
|
import * as impMessage from "./message";
|
||||||
|
export declare namespace grpc {
|
||||||
|
interface ProtobufMessageClass<T extends ProtobufMessage> extends impMessage.ProtobufMessageClass<T> {
|
||||||
|
}
|
||||||
|
interface ProtobufMessage extends impMessage.ProtobufMessage {
|
||||||
|
}
|
||||||
|
interface Transport extends impTransport.Transport {
|
||||||
|
}
|
||||||
|
interface TransportOptions extends impTransport.TransportOptions {
|
||||||
|
}
|
||||||
|
interface TransportFactory extends impTransport.TransportFactory {
|
||||||
|
}
|
||||||
|
const setDefaultTransport: typeof impTransport.setDefaultTransportFactory;
|
||||||
|
const CrossBrowserHttpTransport: typeof impTransportHttp.CrossBrowserHttpTransport;
|
||||||
|
interface CrossBrowserHttpTransportInit extends impTransportHttp.CrossBrowserHttpTransportInit {
|
||||||
|
}
|
||||||
|
const FetchReadableStreamTransport: typeof impTransportFetch.FetchReadableStreamTransport;
|
||||||
|
interface FetchReadableStreamInit extends impTransportFetch.FetchTransportInit {
|
||||||
|
}
|
||||||
|
const XhrTransport: typeof impTransportXhr.XhrTransport;
|
||||||
|
interface XhrTransportInit extends impTransportXhr.XhrTransportInit {
|
||||||
|
}
|
||||||
|
const WebsocketTransport: typeof impTransportWebSocket.WebsocketTransport;
|
||||||
|
interface UnaryMethodDefinition<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends impService.UnaryMethodDefinition<TRequest, TResponse> {
|
||||||
|
}
|
||||||
|
interface MethodDefinition<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends impService.MethodDefinition<TRequest, TResponse> {
|
||||||
|
}
|
||||||
|
interface ServiceDefinition extends impService.ServiceDefinition {
|
||||||
|
}
|
||||||
|
export import Code = impCode.Code;
|
||||||
|
export import Metadata = BrowserHeaders;
|
||||||
|
interface Client<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends impClient.Client<TRequest, TResponse> {
|
||||||
|
}
|
||||||
|
function client<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage, M extends MethodDefinition<TRequest, TResponse>>(methodDescriptor: M, props: ClientRpcOptions): Client<TRequest, TResponse>;
|
||||||
|
interface RpcOptions extends impClient.RpcOptions {
|
||||||
|
}
|
||||||
|
interface ClientRpcOptions extends impClient.ClientRpcOptions {
|
||||||
|
}
|
||||||
|
const invoke: typeof impInvoke.invoke;
|
||||||
|
interface Request extends impInvoke.Request {
|
||||||
|
}
|
||||||
|
interface InvokeRpcOptions<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends impInvoke.InvokeRpcOptions<TRequest, TResponse> {
|
||||||
|
}
|
||||||
|
const unary: typeof impUnary.unary;
|
||||||
|
interface UnaryOutput<TResponse extends ProtobufMessage> extends impUnary.UnaryOutput<TResponse> {
|
||||||
|
}
|
||||||
|
interface UnaryRpcOptions<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends impUnary.UnaryRpcOptions<TRequest, TResponse> {
|
||||||
|
}
|
||||||
|
}
|
17
api/node_modules/@improbable-eng/grpc-web/dist/typings/invoke.d.ts
generated
vendored
Normal file
17
api/node_modules/@improbable-eng/grpc-web/dist/typings/invoke.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
import { Code } from "./Code";
|
||||||
|
import { MethodDefinition } from "./service";
|
||||||
|
import { Metadata } from "./metadata";
|
||||||
|
import { RpcOptions } from "./client";
|
||||||
|
import { ProtobufMessage } from "./message";
|
||||||
|
export interface Request {
|
||||||
|
close: () => void;
|
||||||
|
}
|
||||||
|
export interface InvokeRpcOptions<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends RpcOptions {
|
||||||
|
host: string;
|
||||||
|
request: TRequest;
|
||||||
|
metadata?: Metadata.ConstructorArg;
|
||||||
|
onHeaders?: (headers: Metadata) => void;
|
||||||
|
onMessage?: (res: TResponse) => void;
|
||||||
|
onEnd: (code: Code, message: string, trailers: Metadata) => void;
|
||||||
|
}
|
||||||
|
export declare function invoke<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage, M extends MethodDefinition<TRequest, TResponse>>(methodDescriptor: M, props: InvokeRpcOptions<TRequest, TResponse>): Request;
|
8
api/node_modules/@improbable-eng/grpc-web/dist/typings/message.d.ts
generated
vendored
Normal file
8
api/node_modules/@improbable-eng/grpc-web/dist/typings/message.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
export interface ProtobufMessageClass<T extends ProtobufMessage> {
|
||||||
|
new (): T;
|
||||||
|
deserializeBinary(bytes: Uint8Array): T;
|
||||||
|
}
|
||||||
|
export interface ProtobufMessage {
|
||||||
|
toObject(): {};
|
||||||
|
serializeBinary(): Uint8Array;
|
||||||
|
}
|
2
api/node_modules/@improbable-eng/grpc-web/dist/typings/metadata.d.ts
generated
vendored
Normal file
2
api/node_modules/@improbable-eng/grpc-web/dist/typings/metadata.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { BrowserHeaders } from "browser-headers";
|
||||||
|
export { BrowserHeaders as Metadata };
|
16
api/node_modules/@improbable-eng/grpc-web/dist/typings/service.d.ts
generated
vendored
Normal file
16
api/node_modules/@improbable-eng/grpc-web/dist/typings/service.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { ProtobufMessage, ProtobufMessageClass } from "./message";
|
||||||
|
export interface ServiceDefinition {
|
||||||
|
serviceName: string;
|
||||||
|
}
|
||||||
|
export interface MethodDefinition<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> {
|
||||||
|
methodName: string;
|
||||||
|
service: ServiceDefinition;
|
||||||
|
requestStream: boolean;
|
||||||
|
responseStream: boolean;
|
||||||
|
requestType: ProtobufMessageClass<TRequest>;
|
||||||
|
responseType: ProtobufMessageClass<TResponse>;
|
||||||
|
}
|
||||||
|
export interface UnaryMethodDefinition<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends MethodDefinition<TRequest, TResponse> {
|
||||||
|
requestStream: false;
|
||||||
|
responseStream: false;
|
||||||
|
}
|
22
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/Transport.d.ts
generated
vendored
Normal file
22
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/Transport.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import { Metadata } from "../metadata";
|
||||||
|
import { MethodDefinition } from "../service";
|
||||||
|
import { ProtobufMessage } from "../message";
|
||||||
|
export interface Transport {
|
||||||
|
sendMessage(msgBytes: Uint8Array): void;
|
||||||
|
finishSend(): void;
|
||||||
|
cancel(): void;
|
||||||
|
start(metadata: Metadata): void;
|
||||||
|
}
|
||||||
|
export declare function setDefaultTransportFactory(t: TransportFactory): void;
|
||||||
|
export declare function makeDefaultTransport(options: TransportOptions): Transport;
|
||||||
|
export interface TransportOptions {
|
||||||
|
methodDefinition: MethodDefinition<ProtobufMessage, ProtobufMessage>;
|
||||||
|
debug: boolean;
|
||||||
|
url: string;
|
||||||
|
onHeaders: (headers: Metadata, status: number) => void;
|
||||||
|
onChunk: (chunkBytes: Uint8Array, flush?: boolean) => void;
|
||||||
|
onEnd: (err?: Error) => void;
|
||||||
|
}
|
||||||
|
export interface TransportFactory {
|
||||||
|
(options: TransportOptions): Transport;
|
||||||
|
}
|
6
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/fetch.d.ts
generated
vendored
Normal file
6
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/fetch.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import { TransportFactory } from "../Transport";
|
||||||
|
declare type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
||||||
|
export declare type FetchTransportInit = Omit<RequestInit, "headers" | "method" | "body" | "signal">;
|
||||||
|
export declare function FetchReadableStreamTransport(init: FetchTransportInit): TransportFactory;
|
||||||
|
export declare function detectFetchSupport(): boolean;
|
||||||
|
export {};
|
5
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/http.d.ts
generated
vendored
Normal file
5
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/http.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { TransportFactory } from "../Transport";
|
||||||
|
export interface CrossBrowserHttpTransportInit {
|
||||||
|
withCredentials?: boolean;
|
||||||
|
}
|
||||||
|
export declare function CrossBrowserHttpTransport(init: CrossBrowserHttpTransportInit): TransportFactory;
|
27
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/xhr.d.ts
generated
vendored
Normal file
27
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/xhr.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
import { Metadata } from "../../metadata";
|
||||||
|
import { Transport, TransportFactory, TransportOptions } from "../Transport";
|
||||||
|
export interface XhrTransportInit {
|
||||||
|
withCredentials?: boolean;
|
||||||
|
}
|
||||||
|
export declare function XhrTransport(init: XhrTransportInit): TransportFactory;
|
||||||
|
export declare class XHR implements Transport {
|
||||||
|
options: TransportOptions;
|
||||||
|
init: XhrTransportInit;
|
||||||
|
xhr: XMLHttpRequest;
|
||||||
|
metadata: Metadata;
|
||||||
|
index: 0;
|
||||||
|
constructor(transportOptions: TransportOptions, init: XhrTransportInit);
|
||||||
|
onProgressEvent(): void;
|
||||||
|
onLoadEvent(): void;
|
||||||
|
onStateChange(): void;
|
||||||
|
sendMessage(msgBytes: Uint8Array): void;
|
||||||
|
finishSend(): void;
|
||||||
|
start(metadata: Metadata): void;
|
||||||
|
protected configureXhr(): void;
|
||||||
|
cancel(): void;
|
||||||
|
}
|
||||||
|
export declare class MozChunkedArrayBufferXHR extends XHR {
|
||||||
|
protected configureXhr(): void;
|
||||||
|
onProgressEvent(): void;
|
||||||
|
}
|
||||||
|
export declare function stringToArrayBuffer(str: string): Uint8Array;
|
3
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/xhrUtil.d.ts
generated
vendored
Normal file
3
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/http/xhrUtil.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
export declare function xhrSupportsResponseType(type: string): boolean;
|
||||||
|
export declare function detectMozXHRSupport(): boolean;
|
||||||
|
export declare function detectXHROverrideMimeTypeSupport(): boolean;
|
2
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/websocket/websocket.d.ts
generated
vendored
Normal file
2
api/node_modules/@improbable-eng/grpc-web/dist/typings/transports/websocket/websocket.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
import { TransportFactory } from "../Transport";
|
||||||
|
export declare function WebsocketTransport(): TransportFactory;
|
|
@ -0,0 +1,20 @@
|
||||||
|
import { Metadata } from "./metadata";
|
||||||
|
import { Code } from "./Code";
|
||||||
|
import { UnaryMethodDefinition } from "./service";
|
||||||
|
import { Request } from "./invoke";
|
||||||
|
import { RpcOptions } from "./client";
|
||||||
|
import { ProtobufMessage } from "./message";
|
||||||
|
export interface UnaryOutput<TResponse> {
|
||||||
|
status: Code;
|
||||||
|
statusMessage: string;
|
||||||
|
headers: Metadata;
|
||||||
|
message: TResponse | null;
|
||||||
|
trailers: Metadata;
|
||||||
|
}
|
||||||
|
export interface UnaryRpcOptions<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage> extends RpcOptions {
|
||||||
|
host: string;
|
||||||
|
request: TRequest;
|
||||||
|
metadata?: Metadata.ConstructorArg;
|
||||||
|
onEnd: (output: UnaryOutput<TResponse>) => void;
|
||||||
|
}
|
||||||
|
export declare function unary<TRequest extends ProtobufMessage, TResponse extends ProtobufMessage, M extends UnaryMethodDefinition<TRequest, TResponse>>(methodDescriptor: M, props: UnaryRpcOptions<TRequest, TResponse>): Request;
|
|
@ -0,0 +1,2 @@
|
||||||
|
import { ProtobufMessage } from "./message";
|
||||||
|
export declare function frameRequest(request: ProtobufMessage): Uint8Array;
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
"name": "@improbable-eng/grpc-web",
|
||||||
|
"version": "0.13.0",
|
||||||
|
"description": "gRPC-Web client for browsers (JS/TS)",
|
||||||
|
"main": "dist/grpc-web-client.js",
|
||||||
|
"browser": "dist/grpc-web-client.umd.js",
|
||||||
|
"types": "dist/typings/index.d.ts",
|
||||||
|
"scripts": {
|
||||||
|
"clean": "rm -rf dist",
|
||||||
|
"postbootstrap": "npm run lib:build",
|
||||||
|
"lib:build": "npm run clean && webpack"
|
||||||
|
},
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"author": "Improbable",
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "github.com/improbable-eng/grpc-web"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"grpc",
|
||||||
|
"grpc-web",
|
||||||
|
"protobuf",
|
||||||
|
"typescript",
|
||||||
|
"ts"
|
||||||
|
],
|
||||||
|
"files": [
|
||||||
|
"dist"
|
||||||
|
],
|
||||||
|
"peerDependencies": {
|
||||||
|
"google-protobuf": "^3.2.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"browser-headers": "^0.4.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/google-protobuf": "^3.2.5",
|
||||||
|
"@types/node": "^7.0.5",
|
||||||
|
"google-protobuf": "^3.2.0",
|
||||||
|
"ts-loader": "^6.0.1",
|
||||||
|
"typescript": "3.5.1",
|
||||||
|
"webpack": "^4.29.3",
|
||||||
|
"webpack-cli": "^3.2.3"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Installation
|
||||||
|
> `npm install --save @types/eslint-scope`
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
This package contains type definitions for eslint-scope (http://github.com/eslint/eslint-scope).
|
||||||
|
|
||||||
|
# Details
|
||||||
|
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-scope
|
||||||
|
|
||||||
|
Additional Details
|
||||||
|
* Last updated: Sun, 18 Feb 2018 01:53:11 GMT
|
||||||
|
* Dependencies: eslint, estree
|
||||||
|
* Global values: none
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
These definitions were written by Toru Nagashima <https://github.com/mysticatea>.
|
|
@ -0,0 +1,64 @@
|
||||||
|
// Type definitions for eslint-scope 3.7
|
||||||
|
// Project: http://github.com/eslint/eslint-scope
|
||||||
|
// Definitions by: Toru Nagashima <https://github.com/mysticatea>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
// TypeScript Version: 2.2
|
||||||
|
import * as eslint from "eslint";
|
||||||
|
import * as estree from "estree";
|
||||||
|
|
||||||
|
export const version: string;
|
||||||
|
|
||||||
|
export class ScopeManager implements eslint.Scope.ScopeManager {
|
||||||
|
scopes: Scope[];
|
||||||
|
globalScope: Scope;
|
||||||
|
acquire(node: {}, inner?: boolean): Scope | null;
|
||||||
|
getDeclaredVariables(node: {}): Variable[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Scope implements eslint.Scope.Scope {
|
||||||
|
type: "block" | "catch" | "class" | "for" | "function" | "function-expression-name" | "global" | "module" | "switch" | "with" | "TDZ";
|
||||||
|
isStrict: boolean;
|
||||||
|
upper: Scope | null;
|
||||||
|
childScopes: Scope[];
|
||||||
|
variableScope: Scope;
|
||||||
|
block: estree.Node;
|
||||||
|
variables: Variable[];
|
||||||
|
set: Map<string, Variable>;
|
||||||
|
references: Reference[];
|
||||||
|
through: Reference[];
|
||||||
|
functionExpressionScope: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Variable implements eslint.Scope.Variable {
|
||||||
|
name: string;
|
||||||
|
identifiers: estree.Identifier[];
|
||||||
|
references: Reference[];
|
||||||
|
defs: eslint.Scope.Definition[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Reference implements eslint.Scope.Reference {
|
||||||
|
identifier: estree.Identifier;
|
||||||
|
from: Scope;
|
||||||
|
resolved: Variable | null;
|
||||||
|
writeExpr: estree.Node | null;
|
||||||
|
init: boolean;
|
||||||
|
|
||||||
|
isWrite(): boolean;
|
||||||
|
isRead(): boolean;
|
||||||
|
isWriteOnly(): boolean;
|
||||||
|
isReadOnly(): boolean;
|
||||||
|
isReadWrite(): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AnalysisOptions {
|
||||||
|
optimistic?: boolean;
|
||||||
|
directive?: boolean;
|
||||||
|
ignoreEval?: boolean;
|
||||||
|
nodejsScope?: boolean;
|
||||||
|
impliedStrict?: boolean;
|
||||||
|
fallback?: string | ((node: {}) => string[]);
|
||||||
|
sourceType?: "script" | "module";
|
||||||
|
ecmaVersion?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function analyze(ast: {}, options?: AnalysisOptions): ScopeManager;
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"name": "@types/eslint-scope",
|
||||||
|
"version": "3.7.0",
|
||||||
|
"description": "TypeScript definitions for eslint-scope",
|
||||||
|
"license": "MIT",
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Toru Nagashima",
|
||||||
|
"url": "https://github.com/mysticatea",
|
||||||
|
"githubUsername": "mysticatea"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"main": "",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||||
|
},
|
||||||
|
"scripts": {},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/eslint": "*",
|
||||||
|
"@types/estree": "*"
|
||||||
|
},
|
||||||
|
"typesPublisherContentHash": "0ea662a443d13a5db1cae5afc89fd2aec8155d09ddec7b1a5ba0c6ab4be4cc54",
|
||||||
|
"typeScriptVersion": "2.2"
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Installation
|
||||||
|
> `npm install --save @types/eslint`
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
This package contains type definitions for eslint (https://eslint.org).
|
||||||
|
|
||||||
|
# Details
|
||||||
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint.
|
||||||
|
|
||||||
|
### Additional Details
|
||||||
|
* Last updated: Tue, 01 Jun 2021 21:31:54 GMT
|
||||||
|
* Dependencies: [@types/json-schema](https://npmjs.com/package/@types/json-schema), [@types/estree](https://npmjs.com/package/@types/estree)
|
||||||
|
* Global values: none
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
These definitions were written by [Pierre-Marie Dartus](https://github.com/pmdartus), [Jed Fox](https://github.com/j-f1), [Saad Quadri](https://github.com/saadq), [Jason Kwok](https://github.com/JasonHK), [Brad Zacher](https://github.com/bradzacher), and [JounQin](https://github.com/JounQin).
|
|
@ -0,0 +1,3 @@
|
||||||
|
type Prepend<Tuple extends any[], Addend> = ((_: Addend, ..._1: Tuple) => any) extends (..._: infer Result) => any
|
||||||
|
? Result
|
||||||
|
: never;
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,11 @@
|
||||||
|
/**
|
||||||
|
* support to use `import * as rule form 'eslint/lib/rules/no-unused-expressions'`
|
||||||
|
* it would be very verbose and redundant to declare all rules files
|
||||||
|
*/
|
||||||
|
// tslint:disable-next-line: no-single-declare-module no-declare-current-package
|
||||||
|
declare module "eslint/lib/rules/*" {
|
||||||
|
// tslint:disable-next-line: no-self-import
|
||||||
|
import { Rule } from "eslint";
|
||||||
|
const Rule: Rule.RuleModule;
|
||||||
|
export = Rule;
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
{
|
||||||
|
"name": "@types/eslint",
|
||||||
|
"version": "7.2.13",
|
||||||
|
"description": "TypeScript definitions for eslint",
|
||||||
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint",
|
||||||
|
"license": "MIT",
|
||||||
|
"contributors": [
|
||||||
|
{
|
||||||
|
"name": "Pierre-Marie Dartus",
|
||||||
|
"url": "https://github.com/pmdartus",
|
||||||
|
"githubUsername": "pmdartus"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jed Fox",
|
||||||
|
"url": "https://github.com/j-f1",
|
||||||
|
"githubUsername": "j-f1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Saad Quadri",
|
||||||
|
"url": "https://github.com/saadq",
|
||||||
|
"githubUsername": "saadq"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jason Kwok",
|
||||||
|
"url": "https://github.com/JasonHK",
|
||||||
|
"githubUsername": "JasonHK"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Brad Zacher",
|
||||||
|
"url": "https://github.com/bradzacher",
|
||||||
|
"githubUsername": "bradzacher"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "JounQin",
|
||||||
|
"url": "https://github.com/JounQin",
|
||||||
|
"githubUsername": "JounQin"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"main": "",
|
||||||
|
"types": "index.d.ts",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||||
|
"directory": "types/eslint"
|
||||||
|
},
|
||||||
|
"scripts": {},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/estree": "*",
|
||||||
|
"@types/json-schema": "*"
|
||||||
|
},
|
||||||
|
"typesPublisherContentHash": "72e22eab0ed876b82bb3671e338db1dce1d167cd46bde44964712aa7a51c0252",
|
||||||
|
"typeScriptVersion": "3.6"
|
||||||
|
}
|
|
@ -0,0 +1,931 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface BestPractices extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to enforce getter and setter pairs in objects.
|
||||||
|
*
|
||||||
|
* @since 0.22.0
|
||||||
|
* @see https://eslint.org/docs/rules/accessor-pairs
|
||||||
|
*/
|
||||||
|
"accessor-pairs": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
setWithoutGet: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
getWithoutSet: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce `return` statements in callbacks of array methods.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-1
|
||||||
|
* @see https://eslint.org/docs/rules/array-callback-return
|
||||||
|
*/
|
||||||
|
"array-callback-return": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowImplicit: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce the use of variables within the scope they are defined.
|
||||||
|
*
|
||||||
|
* @since 0.1.0
|
||||||
|
* @see https://eslint.org/docs/rules/block-scoped-var
|
||||||
|
*/
|
||||||
|
"block-scoped-var": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce that class methods utilize `this`.
|
||||||
|
*
|
||||||
|
* @since 3.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/class-methods-use-this
|
||||||
|
*/
|
||||||
|
"class-methods-use-this": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
exceptMethods: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce a maximum cyclomatic complexity allowed in a program.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/complexity
|
||||||
|
*/
|
||||||
|
complexity: Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
| Partial<{
|
||||||
|
/**
|
||||||
|
* @default 20
|
||||||
|
*/
|
||||||
|
max: number;
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @default 20
|
||||||
|
*/
|
||||||
|
maximum: number;
|
||||||
|
}>
|
||||||
|
| number,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `return` statements to either always or never specify values.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/consistent-return
|
||||||
|
*/
|
||||||
|
"consistent-return": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
treatUndefinedAsUnspecified: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce consistent brace style for all control statements.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/curly
|
||||||
|
*/
|
||||||
|
curly: Linter.RuleEntry<["all" | "multi" | "multi-line" | "multi-or-nest" | "consistent"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `default` cases in `switch` statements.
|
||||||
|
*
|
||||||
|
* @since 0.6.0
|
||||||
|
* @see https://eslint.org/docs/rules/default-case
|
||||||
|
*/
|
||||||
|
"default-case": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default '^no default$'
|
||||||
|
*/
|
||||||
|
commentPattern: string;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce consistent newlines before and after dots.
|
||||||
|
*
|
||||||
|
* @since 0.21.0
|
||||||
|
* @see https://eslint.org/docs/rules/dot-location
|
||||||
|
*/
|
||||||
|
"dot-location": Linter.RuleEntry<["object" | "property"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce dot notation whenever possible.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/dot-notation
|
||||||
|
*/
|
||||||
|
"dot-notation": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
allowKeywords: boolean;
|
||||||
|
allowPattern: string;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require the use of `===` and `!==`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/eqeqeq
|
||||||
|
*/
|
||||||
|
eqeqeq:
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"always",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default 'always'
|
||||||
|
*/
|
||||||
|
null: "always" | "never" | "ignore";
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<["smart" | "allow-null"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `for-in` loops to include an `if` statement.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/guard-for-in
|
||||||
|
*/
|
||||||
|
"guard-for-in": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce a maximum number of classes per file.
|
||||||
|
*
|
||||||
|
* @since 5.0.0-alpha.3
|
||||||
|
* @see https://eslint.org/docs/rules/max-classes-per-file
|
||||||
|
*/
|
||||||
|
"max-classes-per-file": Linter.RuleEntry<[number]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `alert`, `confirm`, and `prompt`.
|
||||||
|
*
|
||||||
|
* @since 0.0.5
|
||||||
|
* @see https://eslint.org/docs/rules/no-alert
|
||||||
|
*/
|
||||||
|
"no-alert": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `arguments.caller` or `arguments.callee`.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-caller
|
||||||
|
*/
|
||||||
|
"no-caller": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow lexical declarations in case clauses.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-case-declarations
|
||||||
|
*/
|
||||||
|
"no-case-declarations": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow division operators explicitly at the beginning of regular expressions.
|
||||||
|
*
|
||||||
|
* @since 0.1.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-div-regex
|
||||||
|
*/
|
||||||
|
"no-div-regex": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `else` blocks after `return` statements in `if` statements.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-else-return
|
||||||
|
*/
|
||||||
|
"no-else-return": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
allowElseIf: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow empty functions.
|
||||||
|
*
|
||||||
|
* @since 2.0.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-empty-function
|
||||||
|
*/
|
||||||
|
"no-empty-function": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default []
|
||||||
|
*/
|
||||||
|
allow: Array<
|
||||||
|
| "functions"
|
||||||
|
| "arrowFunctions"
|
||||||
|
| "generatorFunctions"
|
||||||
|
| "methods"
|
||||||
|
| "generatorMethods"
|
||||||
|
| "getters"
|
||||||
|
| "setters"
|
||||||
|
| "constructors"
|
||||||
|
>;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow empty destructuring patterns.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.7.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-empty-pattern
|
||||||
|
*/
|
||||||
|
"no-empty-pattern": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `null` comparisons without type-checking operators.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-eq-null
|
||||||
|
*/
|
||||||
|
"no-eq-null": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `eval()`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/no-eval
|
||||||
|
*/
|
||||||
|
"no-eval": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowIndirect: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow extending native types.
|
||||||
|
*
|
||||||
|
* @since 0.1.4
|
||||||
|
* @see https://eslint.org/docs/rules/no-extend-native
|
||||||
|
*/
|
||||||
|
"no-extend-native": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
exceptions: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary calls to `.bind()`.
|
||||||
|
*
|
||||||
|
* @since 0.8.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-extra-bind
|
||||||
|
*/
|
||||||
|
"no-extra-bind": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary labels.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-rc.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-extra-label
|
||||||
|
*/
|
||||||
|
"no-extra-label": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow fallthrough of `case` statements.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/no-fallthrough
|
||||||
|
*/
|
||||||
|
"no-fallthrough": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default 'falls?\s?through'
|
||||||
|
*/
|
||||||
|
commentPattern: string;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow leading or trailing decimal points in numeric literals.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-floating-decimal
|
||||||
|
*/
|
||||||
|
"no-floating-decimal": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow assignments to native objects or read-only global variables.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-global-assign
|
||||||
|
*/
|
||||||
|
"no-global-assign": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
exceptions: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow shorthand type conversions.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-2
|
||||||
|
* @see https://eslint.org/docs/rules/no-implicit-coercion
|
||||||
|
*/
|
||||||
|
"no-implicit-coercion": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
boolean: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
number: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
string: boolean;
|
||||||
|
/**
|
||||||
|
* @default []
|
||||||
|
*/
|
||||||
|
allow: Array<"~" | "!!" | "+" | "*">;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow variable and `function` declarations in the global scope.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-1
|
||||||
|
* @see https://eslint.org/docs/rules/no-implicit-globals
|
||||||
|
*/
|
||||||
|
"no-implicit-globals": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `eval()`-like methods.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/no-implied-eval
|
||||||
|
*/
|
||||||
|
"no-implied-eval": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `this` keywords outside of classes or class-like objects.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-2
|
||||||
|
* @see https://eslint.org/docs/rules/no-invalid-this
|
||||||
|
*/
|
||||||
|
"no-invalid-this": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of the `__iterator__` property.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-iterator
|
||||||
|
*/
|
||||||
|
"no-iterator": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow labeled statements.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-labels
|
||||||
|
*/
|
||||||
|
"no-labels": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowLoop: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowSwitch: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary nested blocks.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-lone-blocks
|
||||||
|
*/
|
||||||
|
"no-lone-blocks": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow function declarations that contain unsafe references inside loop statements.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-loop-func
|
||||||
|
*/
|
||||||
|
"no-loop-func": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow magic numbers.
|
||||||
|
*
|
||||||
|
* @since 1.7.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-magic-numbers
|
||||||
|
*/
|
||||||
|
"no-magic-numbers": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default []
|
||||||
|
*/
|
||||||
|
ignore: number[];
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreArrayIndexes: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
enforceConst: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
detectObjects: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow multiple spaces.
|
||||||
|
*
|
||||||
|
* @since 0.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-multi-spaces
|
||||||
|
*/
|
||||||
|
"no-multi-spaces": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreEOLComments: boolean;
|
||||||
|
/**
|
||||||
|
* @default { Property: true }
|
||||||
|
*/
|
||||||
|
exceptions: Record<string, boolean>;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow multiline strings.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-multi-str
|
||||||
|
*/
|
||||||
|
"no-multi-str": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `new` operators outside of assignments or comparisons.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/no-new
|
||||||
|
*/
|
||||||
|
"no-new": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `new` operators with the `Function` object.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/no-new-func
|
||||||
|
*/
|
||||||
|
"no-new-func": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `new` operators with the `String`, `Number`, and `Boolean` objects.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-new-wrappers
|
||||||
|
*/
|
||||||
|
"no-new-wrappers": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow octal literals.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-octal
|
||||||
|
*/
|
||||||
|
"no-octal": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow octal escape sequences in string literals.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-octal-escape
|
||||||
|
*/
|
||||||
|
"no-octal-escape": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassigning `function` parameters.
|
||||||
|
*
|
||||||
|
* @since 0.18.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-param-reassign
|
||||||
|
*/
|
||||||
|
"no-param-reassign": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
props: boolean;
|
||||||
|
/**
|
||||||
|
* @default []
|
||||||
|
*/
|
||||||
|
ignorePropertyModificationsFor: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of the `__proto__` property.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-proto
|
||||||
|
*/
|
||||||
|
"no-proto": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow variable redeclaration.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-redeclare
|
||||||
|
*/
|
||||||
|
"no-redeclare": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
builtinGlobals: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow certain properties on certain objects.
|
||||||
|
*
|
||||||
|
* @since 3.5.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-restricted-properties
|
||||||
|
*/
|
||||||
|
"no-restricted-properties": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
...Array<
|
||||||
|
| {
|
||||||
|
object: string;
|
||||||
|
property?: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
property: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
>
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow assignment operators in `return` statements.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-return-assign
|
||||||
|
*/
|
||||||
|
"no-return-assign": Linter.RuleEntry<["except-parens" | "always"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary `return await`.
|
||||||
|
*
|
||||||
|
* @since 3.10.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-return-await
|
||||||
|
*/
|
||||||
|
"no-return-await": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `javascript:` urls.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-script-url
|
||||||
|
*/
|
||||||
|
"no-script-url": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow assignments where both sides are exactly the same.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-rc.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-self-assign
|
||||||
|
*/
|
||||||
|
"no-self-assign": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow comparisons where both sides are exactly the same.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-self-compare
|
||||||
|
*/
|
||||||
|
"no-self-compare": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow comma operators.
|
||||||
|
*
|
||||||
|
* @since 0.5.1
|
||||||
|
* @see https://eslint.org/docs/rules/no-sequences
|
||||||
|
*/
|
||||||
|
"no-sequences": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow throwing literals as exceptions.
|
||||||
|
*
|
||||||
|
* @since 0.15.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-throw-literal
|
||||||
|
*/
|
||||||
|
"no-throw-literal": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unmodified loop conditions.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-2
|
||||||
|
* @see https://eslint.org/docs/rules/no-unmodified-loop-condition
|
||||||
|
*/
|
||||||
|
"no-unmodified-loop-condition": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unused expressions.
|
||||||
|
*
|
||||||
|
* @since 0.1.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-unused-expressions
|
||||||
|
*/
|
||||||
|
"no-unused-expressions": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowShortCircuit: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowTernary: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowTaggedTemplates: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unused labels.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-rc.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-unused-labels
|
||||||
|
*/
|
||||||
|
"no-unused-labels": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary calls to `.call()` and `.apply()`.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-call
|
||||||
|
*/
|
||||||
|
"no-useless-call": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary `catch` clauses.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 5.11.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-catch
|
||||||
|
*/
|
||||||
|
"no-useless-catch": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary concatenation of literals or template literals.
|
||||||
|
*
|
||||||
|
* @since 1.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-concat
|
||||||
|
*/
|
||||||
|
"no-useless-concat": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary escape characters.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.5.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-escape
|
||||||
|
*/
|
||||||
|
"no-useless-escape": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow redundant return statements.
|
||||||
|
*
|
||||||
|
* @since 3.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-return
|
||||||
|
*/
|
||||||
|
"no-useless-return": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `void` operators.
|
||||||
|
*
|
||||||
|
* @since 0.8.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-void
|
||||||
|
*/
|
||||||
|
"no-void": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow specified warning terms in comments.
|
||||||
|
*
|
||||||
|
* @since 0.4.4
|
||||||
|
* @see https://eslint.org/docs/rules/no-warning-comments
|
||||||
|
*/
|
||||||
|
"no-warning-comments": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @default ["todo", "fixme", "xxx"]
|
||||||
|
*/
|
||||||
|
terms: string[];
|
||||||
|
/**
|
||||||
|
* @default 'start'
|
||||||
|
*/
|
||||||
|
location: "start" | "anywhere";
|
||||||
|
},
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `with` statements.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/no-with
|
||||||
|
*/
|
||||||
|
"no-with": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce using named capture group in regular expression.
|
||||||
|
*
|
||||||
|
* @since 5.15.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-named-capture-group
|
||||||
|
*/
|
||||||
|
"prefer-named-capture-group": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require using Error objects as Promise rejection reasons.
|
||||||
|
*
|
||||||
|
* @since 3.14.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-promise-reject-errors
|
||||||
|
*/
|
||||||
|
"prefer-promise-reject-errors": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowEmptyReject: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce the consistent use of the radix argument when using `parseInt()`.
|
||||||
|
*
|
||||||
|
* @since 0.0.7
|
||||||
|
* @see https://eslint.org/docs/rules/radix
|
||||||
|
*/
|
||||||
|
radix: Linter.RuleEntry<["always" | "as-needed"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow async functions which have no `await` expression.
|
||||||
|
*
|
||||||
|
* @since 3.11.0
|
||||||
|
* @see https://eslint.org/docs/rules/require-await
|
||||||
|
*/
|
||||||
|
"require-await": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce the use of `u` flag on RegExp.
|
||||||
|
*
|
||||||
|
* @since 5.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/require-unicode-regexp
|
||||||
|
*/
|
||||||
|
"require-unicode-regexp": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `var` declarations be placed at the top of their containing scope.
|
||||||
|
*
|
||||||
|
* @since 0.8.0
|
||||||
|
* @see https://eslint.org/docs/rules/vars-on-top
|
||||||
|
*/
|
||||||
|
"vars-on-top": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require parentheses around immediate `function` invocations.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/wrap-iife
|
||||||
|
*/
|
||||||
|
"wrap-iife": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"outside" | "inside" | "any",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
functionPrototypeMethods: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow “Yoda” conditions.
|
||||||
|
*
|
||||||
|
* @since 0.7.1
|
||||||
|
* @see https://eslint.org/docs/rules/yoda
|
||||||
|
*/
|
||||||
|
yoda:
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"never",
|
||||||
|
Partial<{
|
||||||
|
exceptRange: boolean;
|
||||||
|
onlyEquality: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<["always"]>;
|
||||||
|
}
|
|
@ -0,0 +1,267 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface Deprecated extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to enforce consistent indentation.
|
||||||
|
*
|
||||||
|
* @since 4.0.0-alpha.0
|
||||||
|
* @deprecated since 4.0.0, use [`indent`](https://eslint.org/docs/rules/indent) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/indent-legacy
|
||||||
|
*/
|
||||||
|
"indent-legacy": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
number | "tab",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default 0
|
||||||
|
*/
|
||||||
|
SwitchCase: number;
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
VariableDeclarator:
|
||||||
|
| Partial<{
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
var: number | "first";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
let: number | "first";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
const: number | "first";
|
||||||
|
}>
|
||||||
|
| number
|
||||||
|
| "first";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
outerIIFEBody: number;
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
MemberExpression: number | "off";
|
||||||
|
/**
|
||||||
|
* @default { parameters: 1, body: 1 }
|
||||||
|
*/
|
||||||
|
FunctionDeclaration: Partial<{
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
parameters: number | "first" | "off";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
body: number;
|
||||||
|
}>;
|
||||||
|
/**
|
||||||
|
* @default { parameters: 1, body: 1 }
|
||||||
|
*/
|
||||||
|
FunctionExpression: Partial<{
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
parameters: number | "first" | "off";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
body: number;
|
||||||
|
}>;
|
||||||
|
/**
|
||||||
|
* @default { arguments: 1 }
|
||||||
|
*/
|
||||||
|
CallExpression: Partial<{
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
arguments: number | "first" | "off";
|
||||||
|
}>;
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
ArrayExpression: number | "first" | "off";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
ObjectExpression: number | "first" | "off";
|
||||||
|
/**
|
||||||
|
* @default 1
|
||||||
|
*/
|
||||||
|
ImportDeclaration: number | "first" | "off";
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
flatTernaryExpressions: boolean;
|
||||||
|
ignoredNodes: string[];
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreComments: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow newlines around directives.
|
||||||
|
*
|
||||||
|
* @since 3.5.0
|
||||||
|
* @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/lines-around-directive
|
||||||
|
*/
|
||||||
|
"lines-around-directive": Linter.RuleEntry<["always" | "never"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow an empty line after variable declarations.
|
||||||
|
*
|
||||||
|
* @since 0.18.0
|
||||||
|
* @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/newline-after-var
|
||||||
|
*/
|
||||||
|
"newline-after-var": Linter.RuleEntry<["always" | "never"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require an empty line before `return` statements.
|
||||||
|
*
|
||||||
|
* @since 2.3.0
|
||||||
|
* @deprecated since 4.0.0, use [`padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/newline-before-return
|
||||||
|
*/
|
||||||
|
"newline-before-return": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow shadowing of variables inside of `catch`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @deprecated since 5.1.0, use [`no-shadow`](https://eslint.org/docs/rules/no-shadow) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/no-catch-shadow
|
||||||
|
*/
|
||||||
|
"no-catch-shadow": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassignment of native objects.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @deprecated since 3.3.0, use [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/no-native-reassign
|
||||||
|
*/
|
||||||
|
"no-native-reassign": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
exceptions: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow negating the left operand in `in` expressions.
|
||||||
|
*
|
||||||
|
* @since 0.1.2
|
||||||
|
* @deprecated since 3.3.0, use [`no-unsafe-negation`](https://eslint.org/docs/rules/no-unsafe-negation) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/no-negated-in-lhs
|
||||||
|
*/
|
||||||
|
"no-negated-in-lhs": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow spacing between function identifiers and their applications.
|
||||||
|
*
|
||||||
|
* @since 0.1.2
|
||||||
|
* @deprecated since 3.3.0, use [`func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) instead.
|
||||||
|
* @see https://eslint.org/docs/rules/no-spaced-func
|
||||||
|
*/
|
||||||
|
"no-spaced-func": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to suggest using `Reflect` methods where applicable.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-2
|
||||||
|
* @deprecated since 3.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-reflect
|
||||||
|
*/
|
||||||
|
"prefer-reflect": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
exceptions: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require JSDoc comments.
|
||||||
|
*
|
||||||
|
* @since 1.4.0
|
||||||
|
* @deprecated since 5.10.0
|
||||||
|
* @see https://eslint.org/docs/rules/require-jsdoc
|
||||||
|
*/
|
||||||
|
"require-jsdoc": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
require: Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
FunctionDeclaration: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
MethodDefinition: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ClassDeclaration: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ArrowFunctionExpression: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
FunctionExpression: boolean;
|
||||||
|
}>;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce valid JSDoc comments.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @deprecated since 5.10.0
|
||||||
|
* @see https://eslint.org/docs/rules/valid-jsdoc
|
||||||
|
*/
|
||||||
|
"valid-jsdoc": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
prefer: Record<string, string>;
|
||||||
|
preferType: Record<string, string>;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
requireReturn: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
requireReturnType: boolean;
|
||||||
|
/**
|
||||||
|
* @remarks
|
||||||
|
* Also accept for regular expression pattern
|
||||||
|
*/
|
||||||
|
matchDescription: string;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
requireParamDescription: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
requireReturnDescription: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
requireParamType: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
}
|
|
@ -0,0 +1,502 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface ECMAScript6 extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to require braces around arrow function bodies.
|
||||||
|
*
|
||||||
|
* @since 1.8.0
|
||||||
|
* @see https://eslint.org/docs/rules/arrow-body-style
|
||||||
|
*/
|
||||||
|
"arrow-body-style":
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"as-needed",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
requireReturnForObjectLiteral: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<["always" | "never"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require parentheses around arrow function arguments.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/arrow-parens
|
||||||
|
*/
|
||||||
|
"arrow-parens":
|
||||||
|
| Linter.RuleEntry<["always"]>
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"as-needed",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
requireForBlockBody: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce consistent spacing before and after the arrow in arrow functions.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/arrow-spacing
|
||||||
|
*/
|
||||||
|
"arrow-spacing": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `super()` calls in constructors.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.24.0
|
||||||
|
* @see https://eslint.org/docs/rules/constructor-super
|
||||||
|
*/
|
||||||
|
"constructor-super": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce consistent spacing around `*` operators in generator functions.
|
||||||
|
*
|
||||||
|
* @since 0.17.0
|
||||||
|
* @see https://eslint.org/docs/rules/generator-star-spacing
|
||||||
|
*/
|
||||||
|
"generator-star-spacing": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
| Partial<{
|
||||||
|
before: boolean;
|
||||||
|
after: boolean;
|
||||||
|
named:
|
||||||
|
| Partial<{
|
||||||
|
before: boolean;
|
||||||
|
after: boolean;
|
||||||
|
}>
|
||||||
|
| "before"
|
||||||
|
| "after"
|
||||||
|
| "both"
|
||||||
|
| "neither";
|
||||||
|
anonymous:
|
||||||
|
| Partial<{
|
||||||
|
before: boolean;
|
||||||
|
after: boolean;
|
||||||
|
}>
|
||||||
|
| "before"
|
||||||
|
| "after"
|
||||||
|
| "both"
|
||||||
|
| "neither";
|
||||||
|
method:
|
||||||
|
| Partial<{
|
||||||
|
before: boolean;
|
||||||
|
after: boolean;
|
||||||
|
}>
|
||||||
|
| "before"
|
||||||
|
| "after"
|
||||||
|
| "both"
|
||||||
|
| "neither";
|
||||||
|
}>
|
||||||
|
| "before"
|
||||||
|
| "after"
|
||||||
|
| "both"
|
||||||
|
| "neither",
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassigning class members.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/no-class-assign
|
||||||
|
*/
|
||||||
|
"no-class-assign": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow arrow functions where they could be confused with comparisons.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-2
|
||||||
|
* @see https://eslint.org/docs/rules/no-confusing-arrow
|
||||||
|
*/
|
||||||
|
"no-confusing-arrow": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
allowParens: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassigning `const` variables.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/no-const-assign
|
||||||
|
*/
|
||||||
|
"no-const-assign": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow duplicate class members.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-dupe-class-members
|
||||||
|
*/
|
||||||
|
"no-dupe-class-members": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow duplicate module imports.
|
||||||
|
*
|
||||||
|
* @since 2.5.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-duplicate-import
|
||||||
|
*/
|
||||||
|
"no-duplicate-import": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
includeExports: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `new` operators with the `Symbol` object.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-beta.1
|
||||||
|
* @see https://eslint.org/docs/rules/no-new-symbol
|
||||||
|
*/
|
||||||
|
"no-new-symbol": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow specified modules when loaded by `import`.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-1
|
||||||
|
* @see https://eslint.org/docs/rules/no-restricted-imports
|
||||||
|
*/
|
||||||
|
"no-restricted-imports": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
...Array<
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
importNames?: string[];
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
| Partial<{
|
||||||
|
paths: Array<
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
importNames?: string[];
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
patterns: string[];
|
||||||
|
}>
|
||||||
|
>
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `this`/`super` before calling `super()` in constructors.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.24.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-this-before-super
|
||||||
|
*/
|
||||||
|
"no-this-before-super": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary computed property keys in object literals.
|
||||||
|
*
|
||||||
|
* @since 2.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-computed-key
|
||||||
|
*/
|
||||||
|
"no-useless-computed-key": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary constructors.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-beta.1
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-constructor
|
||||||
|
*/
|
||||||
|
"no-useless-constructor": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow renaming import, export, and destructured assignments to the same name.
|
||||||
|
*
|
||||||
|
* @since 2.11.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-useless-rename
|
||||||
|
*/
|
||||||
|
"no-useless-rename": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreImport: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreExport: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreDestructuring: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `let` or `const` instead of `var`.
|
||||||
|
*
|
||||||
|
* @since 0.12.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-var
|
||||||
|
*/
|
||||||
|
"no-var": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow method and property shorthand syntax for object literals.
|
||||||
|
*
|
||||||
|
* @since 0.20.0
|
||||||
|
* @see https://eslint.org/docs/rules/object-shorthand
|
||||||
|
*/
|
||||||
|
"object-shorthand":
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"always" | "methods",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
avoidQuotes: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreConstructors: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
avoidExplicitReturnArrows: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"properties",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
avoidQuotes: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require using arrow functions for callbacks.
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-arrow-callback
|
||||||
|
*/
|
||||||
|
"prefer-arrow-callback": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowNamedFunctions: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
allowUnboundThis: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `const` declarations for variables that are never reassigned after declared.
|
||||||
|
*
|
||||||
|
* @since 0.23.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-const
|
||||||
|
*/
|
||||||
|
"prefer-const": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default 'any'
|
||||||
|
*/
|
||||||
|
destructuring: "any" | "all";
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreReadBeforeAssign: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require destructuring from arrays and/or objects.
|
||||||
|
*
|
||||||
|
* @since 3.13.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-destructuring
|
||||||
|
*/
|
||||||
|
"prefer-destructuring": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<
|
||||||
|
| {
|
||||||
|
VariableDeclarator: Partial<{
|
||||||
|
array: boolean;
|
||||||
|
object: boolean;
|
||||||
|
}>;
|
||||||
|
AssignmentExpression: Partial<{
|
||||||
|
array: boolean;
|
||||||
|
object: boolean;
|
||||||
|
}>;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
array: boolean;
|
||||||
|
object: boolean;
|
||||||
|
}
|
||||||
|
>,
|
||||||
|
Partial<{
|
||||||
|
enforceForRenamedProperties: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals.
|
||||||
|
*
|
||||||
|
* @since 3.5.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-numeric-literals
|
||||||
|
*/
|
||||||
|
"prefer-numeric-literals": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require rest parameters instead of `arguments`.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-1
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-rest-params
|
||||||
|
*/
|
||||||
|
"prefer-rest-params": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require spread operators instead of `.apply()`.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-spread
|
||||||
|
*/
|
||||||
|
"prefer-spread": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require template literals instead of string concatenation.
|
||||||
|
*
|
||||||
|
* @since 1.2.0
|
||||||
|
* @see https://eslint.org/docs/rules/prefer-template
|
||||||
|
*/
|
||||||
|
"prefer-template": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require generator functions to contain `yield`.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/require-yield
|
||||||
|
*/
|
||||||
|
"require-yield": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce spacing between rest and spread operators and their expressions.
|
||||||
|
*
|
||||||
|
* @since 2.12.0
|
||||||
|
* @see https://eslint.org/docs/rules/rest-spread-spacing
|
||||||
|
*/
|
||||||
|
"rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce sorted import declarations within modules.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-beta.1
|
||||||
|
* @see https://eslint.org/docs/rules/sort-imports
|
||||||
|
*/
|
||||||
|
"sort-imports": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreCase: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreDeclarationSort: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreMemberSort: boolean;
|
||||||
|
/**
|
||||||
|
* @default ['none', 'all', 'multiple', 'single']
|
||||||
|
*/
|
||||||
|
memberSyntaxSortOrder: Array<"none" | "all" | "multiple" | "single">;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require symbol descriptions.
|
||||||
|
*
|
||||||
|
* @since 3.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/symbol-description
|
||||||
|
*/
|
||||||
|
"symbol-description": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow spacing around embedded expressions of template strings.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-rc.0
|
||||||
|
* @see https://eslint.org/docs/rules/template-curly-spacing
|
||||||
|
*/
|
||||||
|
"template-curly-spacing": Linter.RuleEntry<["never" | "always"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow spacing around the `*` in `yield*` expressions.
|
||||||
|
*
|
||||||
|
* @since 2.0.0-alpha-1
|
||||||
|
* @see https://eslint.org/docs/rules/yield-star-spacing
|
||||||
|
*/
|
||||||
|
"yield-star-spacing": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
| Partial<{
|
||||||
|
before: boolean;
|
||||||
|
after: boolean;
|
||||||
|
}>
|
||||||
|
| "before"
|
||||||
|
| "after"
|
||||||
|
| "both"
|
||||||
|
| "neither",
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
import { BestPractices } from "./best-practices";
|
||||||
|
import { Deprecated } from "./deprecated";
|
||||||
|
import { ECMAScript6 } from "./ecmascript-6";
|
||||||
|
import { NodeJSAndCommonJS } from "./node-commonjs";
|
||||||
|
import { PossibleErrors } from "./possible-errors";
|
||||||
|
import { StrictMode } from "./strict-mode";
|
||||||
|
import { StylisticIssues } from "./stylistic-issues";
|
||||||
|
import { Variables } from "./variables";
|
||||||
|
|
||||||
|
export interface ESLintRules
|
||||||
|
extends Linter.RulesRecord,
|
||||||
|
PossibleErrors,
|
||||||
|
BestPractices,
|
||||||
|
StrictMode,
|
||||||
|
Variables,
|
||||||
|
NodeJSAndCommonJS,
|
||||||
|
StylisticIssues,
|
||||||
|
ECMAScript6,
|
||||||
|
Deprecated {}
|
|
@ -0,0 +1,133 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface NodeJSAndCommonJS extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to require `return` statements after callbacks.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/callback-return
|
||||||
|
*/
|
||||||
|
"callback-return": Linter.RuleEntry<[string[]]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require `require()` calls to be placed at top-level module scope.
|
||||||
|
*
|
||||||
|
* @since 1.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/global-require
|
||||||
|
*/
|
||||||
|
"global-require": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require error handling in callbacks.
|
||||||
|
*
|
||||||
|
* @since 0.4.5
|
||||||
|
* @see https://eslint.org/docs/rules/handle-callback-err
|
||||||
|
*/
|
||||||
|
"handle-callback-err": Linter.RuleEntry<[string]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow use of the `Buffer()` constructor.
|
||||||
|
*
|
||||||
|
* @since 4.0.0-alpha.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-buffer-constructor
|
||||||
|
*/
|
||||||
|
"no-buffer-constructor": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `require` calls to be mixed with regular variable declarations.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-mixed-requires
|
||||||
|
*/
|
||||||
|
"no-mixed-requires": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
grouping: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowCall: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `new` operators with calls to `require`.
|
||||||
|
*
|
||||||
|
* @since 0.6.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-new-require
|
||||||
|
*/
|
||||||
|
"no-new-require": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow string concatenation when using `__dirname` and `__filename`.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-path-concat
|
||||||
|
*/
|
||||||
|
"no-path-concat": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `process.env`.
|
||||||
|
*
|
||||||
|
* @since 0.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-process-env
|
||||||
|
*/
|
||||||
|
"no-process-env": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `process.exit()`.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-process-exit
|
||||||
|
*/
|
||||||
|
"no-process-exit": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow specified modules when loaded by `require`.
|
||||||
|
*
|
||||||
|
* @since 0.6.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-restricted-modules
|
||||||
|
*/
|
||||||
|
"no-restricted-modules": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
...Array<
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
| Partial<{
|
||||||
|
paths: Array<
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
patterns: string[];
|
||||||
|
}>
|
||||||
|
>
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow synchronous methods.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-sync
|
||||||
|
*/
|
||||||
|
"no-sync": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowAtRootLevel: boolean;
|
||||||
|
},
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
}
|
|
@ -0,0 +1,484 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface PossibleErrors extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to enforce `for` loop update clause moving the counter in the right direction.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 4.0.0-beta.0
|
||||||
|
* @see https://eslint.org/docs/rules/for-direction
|
||||||
|
*/
|
||||||
|
"for-direction": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce `return` statements in getters.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 4.2.0
|
||||||
|
* @see https://eslint.org/docs/rules/getter-return
|
||||||
|
*/
|
||||||
|
"getter-return": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowImplicit: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow using an async function as a `Promise` executor.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 5.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-async-promise-executor
|
||||||
|
*/
|
||||||
|
"no-async-promise-executor": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow `await` inside of loops.
|
||||||
|
*
|
||||||
|
* @since 3.12.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-await-in-loop
|
||||||
|
*/
|
||||||
|
"no-await-in-loop": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow comparing against `-0`.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 3.17.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-compare-neg-zero
|
||||||
|
*/
|
||||||
|
"no-compare-neg-zero": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow assignment operators in conditional statements.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-cond-assign
|
||||||
|
*/
|
||||||
|
"no-cond-assign": Linter.RuleEntry<["except-parens" | "always"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `console`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/no-console
|
||||||
|
*/
|
||||||
|
"no-console": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
allow: Array<keyof Console>;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow constant expressions in conditions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.4.1
|
||||||
|
* @see https://eslint.org/docs/rules/no-constant-condition
|
||||||
|
*/
|
||||||
|
"no-constant-condition": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
checkLoops: boolean;
|
||||||
|
},
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow control characters in regular expressions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.1.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-control-regex
|
||||||
|
*/
|
||||||
|
"no-control-regex": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `debugger`.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/no-debugger
|
||||||
|
*/
|
||||||
|
"no-debugger": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow duplicate arguments in `function` definitions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.16.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-dupe-args
|
||||||
|
*/
|
||||||
|
"no-dupe-args": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow duplicate keys in object literals.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-dupe-keys
|
||||||
|
*/
|
||||||
|
"no-dupe-keys": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow a duplicate case label.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.17.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-duplicate-case
|
||||||
|
*/
|
||||||
|
"no-duplicate-case": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow empty block statements.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.2
|
||||||
|
* @see https://eslint.org/docs/rules/no-empty
|
||||||
|
*/
|
||||||
|
"no-empty": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
allowEmptyCatch: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow empty character classes in regular expressions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.22.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-empty-character-class
|
||||||
|
*/
|
||||||
|
"no-empty-character-class": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassigning exceptions in `catch` clauses.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-ex-assign
|
||||||
|
*/
|
||||||
|
"no-ex-assign": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary boolean casts.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-extra-boolean-cast
|
||||||
|
*/
|
||||||
|
"no-extra-boolean-cast": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary parentheses.
|
||||||
|
*
|
||||||
|
* @since 0.1.4
|
||||||
|
* @see https://eslint.org/docs/rules/no-extra-parens
|
||||||
|
*/
|
||||||
|
"no-extra-parens":
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"all",
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true,
|
||||||
|
*/
|
||||||
|
conditionalAssign: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
returnAssign: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
nestedBinaryExpressions: boolean;
|
||||||
|
/**
|
||||||
|
* @default 'none'
|
||||||
|
*/
|
||||||
|
ignoreJSX: "none" | "all" | "multi-line" | "single-line";
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
enforceForArrowConditionals: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>
|
||||||
|
| Linter.RuleEntry<["functions"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unnecessary semicolons.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-extra-semi
|
||||||
|
*/
|
||||||
|
"no-extra-semi": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow reassigning `function` declarations.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-func-assign
|
||||||
|
*/
|
||||||
|
"no-func-assign": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow variable or `function` declarations in nested blocks.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.6.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-inner-declarations
|
||||||
|
*/
|
||||||
|
"no-inner-declarations": Linter.RuleEntry<["functions" | "both"]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow invalid regular expression strings in `RegExp` constructors.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.1.4
|
||||||
|
* @see https://eslint.org/docs/rules/no-invalid-regexp
|
||||||
|
*/
|
||||||
|
"no-invalid-regexp": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
allowConstructorFlags: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow irregular whitespace.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-irregular-whitespace
|
||||||
|
*/
|
||||||
|
"no-irregular-whitespace": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
skipStrings: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
skipComments: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
skipRegExps: boolean;
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
skipTemplates: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow characters which are made with multiple code points in character class syntax.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 5.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-misleading-character-class
|
||||||
|
*/
|
||||||
|
"no-misleading-character-class": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow calling global object properties as functions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-obj-calls
|
||||||
|
*/
|
||||||
|
"no-obj-calls": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow use of `Object.prototypes` builtins directly.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.11.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-prototype-builtins
|
||||||
|
*/
|
||||||
|
"no-prototype-builtins": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow multiple spaces in regular expressions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-regex-spaces
|
||||||
|
*/
|
||||||
|
"no-regex-spaces": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow sparse arrays.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.4.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-sparse-arrays
|
||||||
|
*/
|
||||||
|
"no-sparse-arrays": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow template literal placeholder syntax in regular strings.
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-template-curly-in-string
|
||||||
|
*/
|
||||||
|
"no-template-curly-in-string": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow confusing multiline expressions.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.24.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-unexpected-multiline
|
||||||
|
*/
|
||||||
|
"no-unexpected-multiline": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unreachable code after `return`, `throw`, `continue`, and `break` statements.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-unreachable
|
||||||
|
*/
|
||||||
|
"no-unreachable": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow control flow statements in `finally` blocks.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 2.9.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-unsafe-finally
|
||||||
|
*/
|
||||||
|
"no-unsafe-finally": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow negating the left operand of relational operators.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 3.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-unsafe-negation
|
||||||
|
*/
|
||||||
|
"no-unsafe-negation": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow assignments that can lead to race conditions due to usage of `await` or `yield`.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 5.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/require-atomic-updates
|
||||||
|
*/
|
||||||
|
"require-atomic-updates": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to require calls to `isNaN()` when checking for `NaN`.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/use-isnan
|
||||||
|
*/
|
||||||
|
"use-isnan": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to enforce comparing `typeof` expressions against valid strings.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.5.0
|
||||||
|
* @see https://eslint.org/docs/rules/valid-typeof
|
||||||
|
*/
|
||||||
|
"valid-typeof": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
requireStringLiterals: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface StrictMode extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow strict mode directives.
|
||||||
|
*
|
||||||
|
* @since 0.1.0
|
||||||
|
* @see https://eslint.org/docs/rules/strict
|
||||||
|
*/
|
||||||
|
strict: Linter.RuleEntry<["safe" | "global" | "function" | "never"]>;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,187 @@
|
||||||
|
import { Linter } from "../index";
|
||||||
|
|
||||||
|
export interface Variables extends Linter.RulesRecord {
|
||||||
|
/**
|
||||||
|
* Rule to require or disallow initialization in variable declarations.
|
||||||
|
*
|
||||||
|
* @since 1.0.0-rc-1
|
||||||
|
* @see https://eslint.org/docs/rules/init-declarations
|
||||||
|
*/
|
||||||
|
"init-declarations":
|
||||||
|
| Linter.RuleEntry<["always"]>
|
||||||
|
| Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
"never",
|
||||||
|
Partial<{
|
||||||
|
ignoreForLoopInit: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow deleting variables.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-delete-var
|
||||||
|
*/
|
||||||
|
"no-delete-var": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow labels that share a name with a variable.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-label-var
|
||||||
|
*/
|
||||||
|
"no-label-var": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow specified global variables.
|
||||||
|
*
|
||||||
|
* @since 2.3.0
|
||||||
|
* @see https://eslint.org/docs/rules/no-restricted-globals
|
||||||
|
*/
|
||||||
|
"no-restricted-globals": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
...Array<
|
||||||
|
| string
|
||||||
|
| {
|
||||||
|
name: string;
|
||||||
|
message?: string;
|
||||||
|
}
|
||||||
|
>
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow variable declarations from shadowing variables declared in the outer scope.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-shadow
|
||||||
|
*/
|
||||||
|
"no-shadow": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
builtinGlobals: boolean;
|
||||||
|
/**
|
||||||
|
* @default 'functions'
|
||||||
|
*/
|
||||||
|
hoist: "functions" | "all" | "never";
|
||||||
|
allow: string[];
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow identifiers from shadowing restricted names.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.1.4
|
||||||
|
* @see https://eslint.org/docs/rules/no-shadow-restricted-names
|
||||||
|
*/
|
||||||
|
"no-shadow-restricted-names": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of undeclared variables unless mentioned in `global` comments.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-undef
|
||||||
|
*/
|
||||||
|
"no-undef": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
typeof: boolean;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow initializing variables to `undefined`.
|
||||||
|
*
|
||||||
|
* @since 0.0.6
|
||||||
|
* @see https://eslint.org/docs/rules/no-undef-init
|
||||||
|
*/
|
||||||
|
"no-undef-init": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of `undefined` as an identifier.
|
||||||
|
*
|
||||||
|
* @since 0.7.1
|
||||||
|
* @see https://eslint.org/docs/rules/no-undefined
|
||||||
|
*/
|
||||||
|
"no-undefined": Linter.RuleEntry<[]>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow unused variables.
|
||||||
|
*
|
||||||
|
* @remarks
|
||||||
|
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-unused-vars
|
||||||
|
*/
|
||||||
|
"no-unused-vars": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
Partial<{
|
||||||
|
/**
|
||||||
|
* @default 'all'
|
||||||
|
*/
|
||||||
|
vars: "all" | "local";
|
||||||
|
varsIgnorePattern: string;
|
||||||
|
/**
|
||||||
|
* @default 'after-used'
|
||||||
|
*/
|
||||||
|
args: "after-used" | "all" | "none";
|
||||||
|
/**
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
ignoreRestSiblings: boolean;
|
||||||
|
argsIgnorePattern: string;
|
||||||
|
/**
|
||||||
|
* @default 'none'
|
||||||
|
*/
|
||||||
|
caughtErrors: "none" | "all";
|
||||||
|
caughtErrorsIgnorePattern: string;
|
||||||
|
}>,
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule to disallow the use of variables before they are defined.
|
||||||
|
*
|
||||||
|
* @since 0.0.9
|
||||||
|
* @see https://eslint.org/docs/rules/no-use-before-define
|
||||||
|
*/
|
||||||
|
"no-use-before-define": Linter.RuleEntry<
|
||||||
|
[
|
||||||
|
| Partial<{
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
functions: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
classes: boolean;
|
||||||
|
/**
|
||||||
|
* @default true
|
||||||
|
*/
|
||||||
|
variables: boolean;
|
||||||
|
}>
|
||||||
|
| "nofunc",
|
||||||
|
]
|
||||||
|
>;
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Microsoft Corporation.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE
|
|
@ -0,0 +1,16 @@
|
||||||
|
# Installation
|
||||||
|
> `npm install --save @types/estree`
|
||||||
|
|
||||||
|
# Summary
|
||||||
|
This package contains type definitions for ESTree AST specification (https://github.com/estree/estree).
|
||||||
|
|
||||||
|
# Details
|
||||||
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree.
|
||||||
|
|
||||||
|
### Additional Details
|
||||||
|
* Last updated: Wed, 02 Jun 2021 05:31:29 GMT
|
||||||
|
* Dependencies: none
|
||||||
|
* Global values: none
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
These definitions were written by [RReverser](https://github.com/RReverser).
|
|
@ -0,0 +1,174 @@
|
||||||
|
// Type definitions for ESTree AST extensions for Facebook Flow
|
||||||
|
// Project: https://github.com/estree/estree
|
||||||
|
// Definitions by: RReverser <https://github.com/RReverser>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
declare namespace ESTree {
|
||||||
|
interface FlowTypeAnnotation extends Node {}
|
||||||
|
|
||||||
|
interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {}
|
||||||
|
|
||||||
|
interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {}
|
||||||
|
|
||||||
|
interface FlowDeclaration extends Declaration {}
|
||||||
|
|
||||||
|
interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
|
||||||
|
interface ArrayTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
elementType: FlowTypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||||
|
|
||||||
|
interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
|
||||||
|
interface ClassImplements extends Node {
|
||||||
|
id: Identifier;
|
||||||
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ClassProperty {
|
||||||
|
key: Expression;
|
||||||
|
value?: Expression | null;
|
||||||
|
typeAnnotation?: TypeAnnotation | null;
|
||||||
|
computed: boolean;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeclareClass extends FlowDeclaration {
|
||||||
|
id: Identifier;
|
||||||
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
|
body: ObjectTypeAnnotation;
|
||||||
|
extends: Array<InterfaceExtends>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeclareFunction extends FlowDeclaration {
|
||||||
|
id: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeclareModule extends FlowDeclaration {
|
||||||
|
id: Literal | Identifier;
|
||||||
|
body: BlockStatement;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DeclareVariable extends FlowDeclaration {
|
||||||
|
id: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FunctionTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
params: Array<FunctionTypeParam>;
|
||||||
|
returnType: FlowTypeAnnotation;
|
||||||
|
rest?: FunctionTypeParam | null;
|
||||||
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FunctionTypeParam {
|
||||||
|
name: Identifier;
|
||||||
|
typeAnnotation: FlowTypeAnnotation;
|
||||||
|
optional: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface GenericTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
id: Identifier | QualifiedTypeIdentifier;
|
||||||
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InterfaceExtends extends Node {
|
||||||
|
id: Identifier | QualifiedTypeIdentifier;
|
||||||
|
typeParameters?: TypeParameterInstantiation | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface InterfaceDeclaration extends FlowDeclaration {
|
||||||
|
id: Identifier;
|
||||||
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
|
extends: Array<InterfaceExtends>;
|
||||||
|
body: ObjectTypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IntersectionTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
types: Array<FlowTypeAnnotation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
|
||||||
|
interface NullableTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
typeAnnotation: TypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||||
|
|
||||||
|
interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
|
||||||
|
interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||||
|
|
||||||
|
interface StringTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
|
||||||
|
interface TupleTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
types: Array<FlowTypeAnnotation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeofTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
argument: FlowTypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeAlias extends FlowDeclaration {
|
||||||
|
id: Identifier;
|
||||||
|
typeParameters?: TypeParameterDeclaration | null;
|
||||||
|
right: FlowTypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeAnnotation extends Node {
|
||||||
|
typeAnnotation: FlowTypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeCastExpression extends Expression {
|
||||||
|
expression: Expression;
|
||||||
|
typeAnnotation: TypeAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeParameterDeclaration extends Node {
|
||||||
|
params: Array<Identifier>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface TypeParameterInstantiation extends Node {
|
||||||
|
params: Array<FlowTypeAnnotation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ObjectTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
properties: Array<ObjectTypeProperty>;
|
||||||
|
indexers: Array<ObjectTypeIndexer>;
|
||||||
|
callProperties: Array<ObjectTypeCallProperty>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ObjectTypeCallProperty extends Node {
|
||||||
|
value: FunctionTypeAnnotation;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ObjectTypeIndexer extends Node {
|
||||||
|
id: Identifier;
|
||||||
|
key: FlowTypeAnnotation;
|
||||||
|
value: FlowTypeAnnotation;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ObjectTypeProperty extends Node {
|
||||||
|
key: Expression;
|
||||||
|
value: FlowTypeAnnotation;
|
||||||
|
optional: boolean;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface QualifiedTypeIdentifier extends Node {
|
||||||
|
qualification: Identifier | QualifiedTypeIdentifier;
|
||||||
|
id: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UnionTypeAnnotation extends FlowTypeAnnotation {
|
||||||
|
types: Array<FlowTypeAnnotation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||||
|
}
|
|
@ -0,0 +1,590 @@
|
||||||
|
// Type definitions for ESTree AST specification
|
||||||
|
// Project: https://github.com/estree/estree
|
||||||
|
// Definitions by: RReverser <https://github.com/RReverser>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
// This definition file follows a somewhat unusual format. ESTree allows
|
||||||
|
// runtime type checks based on the `type` parameter. In order to explain this
|
||||||
|
// to typescript we want to use discriminated union types:
|
||||||
|
// https://github.com/Microsoft/TypeScript/pull/9163
|
||||||
|
//
|
||||||
|
// For ESTree this is a bit tricky because the high level interfaces like
|
||||||
|
// Node or Function are pulling double duty. We want to pass common fields down
|
||||||
|
// to the interfaces that extend them (like Identifier or
|
||||||
|
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
||||||
|
// common fields on them. So we've split the high level interfaces into two
|
||||||
|
// types, a base type which passes down inherited fields, and a type union of
|
||||||
|
// all types which extend the base type. Only the type union is exported, and
|
||||||
|
// the union is how other types refer to the collection of inheriting types.
|
||||||
|
//
|
||||||
|
// This makes the definitions file here somewhat more difficult to maintain,
|
||||||
|
// but it has the notable advantage of making ESTree much easier to use as
|
||||||
|
// an end user.
|
||||||
|
|
||||||
|
interface BaseNodeWithoutComments {
|
||||||
|
// Every leaf interface that extends BaseNode must specify a type property.
|
||||||
|
// The type property should be a string literal. For example, Identifier
|
||||||
|
// has: `type: "Identifier"`
|
||||||
|
type: string;
|
||||||
|
loc?: SourceLocation | null;
|
||||||
|
range?: [number, number];
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BaseNode extends BaseNodeWithoutComments {
|
||||||
|
leadingComments?: Array<Comment>;
|
||||||
|
trailingComments?: Array<Comment>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Node =
|
||||||
|
Identifier | Literal | Program | Function | SwitchCase | CatchClause |
|
||||||
|
VariableDeclarator | Statement | Expression | PrivateIdentifier | Property | PropertyDefinition |
|
||||||
|
AssignmentProperty | Super | TemplateElement | SpreadElement | Pattern |
|
||||||
|
ClassBody | Class | MethodDefinition | ModuleDeclaration | ModuleSpecifier;
|
||||||
|
|
||||||
|
export interface Comment extends BaseNodeWithoutComments {
|
||||||
|
type: "Line" | "Block";
|
||||||
|
value: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SourceLocation {
|
||||||
|
source?: string | null;
|
||||||
|
start: Position;
|
||||||
|
end: Position;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Position {
|
||||||
|
/** >= 1 */
|
||||||
|
line: number;
|
||||||
|
/** >= 0 */
|
||||||
|
column: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Program extends BaseNode {
|
||||||
|
type: "Program";
|
||||||
|
sourceType: "script" | "module";
|
||||||
|
body: Array<Directive | Statement | ModuleDeclaration>;
|
||||||
|
comments?: Array<Comment>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Directive extends BaseNode {
|
||||||
|
type: "ExpressionStatement";
|
||||||
|
expression: Literal;
|
||||||
|
directive: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BaseFunction extends BaseNode {
|
||||||
|
params: Array<Pattern>;
|
||||||
|
generator?: boolean;
|
||||||
|
async?: boolean;
|
||||||
|
// The body is either BlockStatement or Expression because arrow functions
|
||||||
|
// can have a body that's either. FunctionDeclarations and
|
||||||
|
// FunctionExpressions have only BlockStatement bodies.
|
||||||
|
body: BlockStatement | Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Function =
|
||||||
|
FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
||||||
|
|
||||||
|
export type Statement =
|
||||||
|
ExpressionStatement | BlockStatement | EmptyStatement |
|
||||||
|
DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement |
|
||||||
|
BreakStatement | ContinueStatement | IfStatement | SwitchStatement |
|
||||||
|
ThrowStatement | TryStatement | WhileStatement | DoWhileStatement |
|
||||||
|
ForStatement | ForInStatement | ForOfStatement | Declaration;
|
||||||
|
|
||||||
|
interface BaseStatement extends BaseNode { }
|
||||||
|
|
||||||
|
export interface EmptyStatement extends BaseStatement {
|
||||||
|
type: "EmptyStatement";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BlockStatement extends BaseStatement {
|
||||||
|
type: "BlockStatement";
|
||||||
|
body: Array<Statement>;
|
||||||
|
innerComments?: Array<Comment>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExpressionStatement extends BaseStatement {
|
||||||
|
type: "ExpressionStatement";
|
||||||
|
expression: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IfStatement extends BaseStatement {
|
||||||
|
type: "IfStatement";
|
||||||
|
test: Expression;
|
||||||
|
consequent: Statement;
|
||||||
|
alternate?: Statement | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LabeledStatement extends BaseStatement {
|
||||||
|
type: "LabeledStatement";
|
||||||
|
label: Identifier;
|
||||||
|
body: Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BreakStatement extends BaseStatement {
|
||||||
|
type: "BreakStatement";
|
||||||
|
label?: Identifier | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ContinueStatement extends BaseStatement {
|
||||||
|
type: "ContinueStatement";
|
||||||
|
label?: Identifier | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WithStatement extends BaseStatement {
|
||||||
|
type: "WithStatement";
|
||||||
|
object: Expression;
|
||||||
|
body: Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SwitchStatement extends BaseStatement {
|
||||||
|
type: "SwitchStatement";
|
||||||
|
discriminant: Expression;
|
||||||
|
cases: Array<SwitchCase>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ReturnStatement extends BaseStatement {
|
||||||
|
type: "ReturnStatement";
|
||||||
|
argument?: Expression | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ThrowStatement extends BaseStatement {
|
||||||
|
type: "ThrowStatement";
|
||||||
|
argument: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TryStatement extends BaseStatement {
|
||||||
|
type: "TryStatement";
|
||||||
|
block: BlockStatement;
|
||||||
|
handler?: CatchClause | null;
|
||||||
|
finalizer?: BlockStatement | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WhileStatement extends BaseStatement {
|
||||||
|
type: "WhileStatement";
|
||||||
|
test: Expression;
|
||||||
|
body: Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DoWhileStatement extends BaseStatement {
|
||||||
|
type: "DoWhileStatement";
|
||||||
|
body: Statement;
|
||||||
|
test: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ForStatement extends BaseStatement {
|
||||||
|
type: "ForStatement";
|
||||||
|
init?: VariableDeclaration | Expression | null;
|
||||||
|
test?: Expression | null;
|
||||||
|
update?: Expression | null;
|
||||||
|
body: Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BaseForXStatement extends BaseStatement {
|
||||||
|
left: VariableDeclaration | Pattern;
|
||||||
|
right: Expression;
|
||||||
|
body: Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ForInStatement extends BaseForXStatement {
|
||||||
|
type: "ForInStatement";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface DebuggerStatement extends BaseStatement {
|
||||||
|
type: "DebuggerStatement";
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Declaration =
|
||||||
|
FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
||||||
|
|
||||||
|
interface BaseDeclaration extends BaseStatement { }
|
||||||
|
|
||||||
|
export interface FunctionDeclaration extends BaseFunction, BaseDeclaration {
|
||||||
|
type: "FunctionDeclaration";
|
||||||
|
/** It is null when a function declaration is a part of the `export default function` statement */
|
||||||
|
id: Identifier | null;
|
||||||
|
body: BlockStatement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VariableDeclaration extends BaseDeclaration {
|
||||||
|
type: "VariableDeclaration";
|
||||||
|
declarations: Array<VariableDeclarator>;
|
||||||
|
kind: "var" | "let" | "const";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VariableDeclarator extends BaseNode {
|
||||||
|
type: "VariableDeclarator";
|
||||||
|
id: Pattern;
|
||||||
|
init?: Expression | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
type Expression =
|
||||||
|
ThisExpression | ArrayExpression | ObjectExpression | FunctionExpression |
|
||||||
|
ArrowFunctionExpression | YieldExpression | Literal | UnaryExpression |
|
||||||
|
UpdateExpression | BinaryExpression | AssignmentExpression |
|
||||||
|
LogicalExpression | MemberExpression | ConditionalExpression |
|
||||||
|
CallExpression | NewExpression | SequenceExpression | TemplateLiteral |
|
||||||
|
TaggedTemplateExpression | ClassExpression | MetaProperty | Identifier |
|
||||||
|
AwaitExpression | ImportExpression | ChainExpression;
|
||||||
|
|
||||||
|
export interface BaseExpression extends BaseNode { }
|
||||||
|
|
||||||
|
type ChainElement = SimpleCallExpression | MemberExpression;
|
||||||
|
|
||||||
|
export interface ChainExpression extends BaseExpression {
|
||||||
|
type: "ChainExpression";
|
||||||
|
expression: ChainElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ThisExpression extends BaseExpression {
|
||||||
|
type: "ThisExpression";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ArrayExpression extends BaseExpression {
|
||||||
|
type: "ArrayExpression";
|
||||||
|
elements: Array<Expression | SpreadElement | null>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ObjectExpression extends BaseExpression {
|
||||||
|
type: "ObjectExpression";
|
||||||
|
properties: Array<Property | SpreadElement>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PrivateIdentifier extends BaseNode {
|
||||||
|
type: "PrivateIdentifier";
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Property extends BaseNode {
|
||||||
|
type: "Property";
|
||||||
|
key: Expression | PrivateIdentifier;
|
||||||
|
value: Expression | Pattern; // Could be an AssignmentProperty
|
||||||
|
kind: "init" | "get" | "set";
|
||||||
|
method: boolean;
|
||||||
|
shorthand: boolean;
|
||||||
|
computed: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface PropertyDefinition extends BaseNode {
|
||||||
|
type: "PropertyDefinition";
|
||||||
|
key: Expression | PrivateIdentifier;
|
||||||
|
value?: Expression | null;
|
||||||
|
computed: boolean;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FunctionExpression extends BaseFunction, BaseExpression {
|
||||||
|
id?: Identifier | null;
|
||||||
|
type: "FunctionExpression";
|
||||||
|
body: BlockStatement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SequenceExpression extends BaseExpression {
|
||||||
|
type: "SequenceExpression";
|
||||||
|
expressions: Array<Expression>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UnaryExpression extends BaseExpression {
|
||||||
|
type: "UnaryExpression";
|
||||||
|
operator: UnaryOperator;
|
||||||
|
prefix: true;
|
||||||
|
argument: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BinaryExpression extends BaseExpression {
|
||||||
|
type: "BinaryExpression";
|
||||||
|
operator: BinaryOperator;
|
||||||
|
left: Expression;
|
||||||
|
right: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AssignmentExpression extends BaseExpression {
|
||||||
|
type: "AssignmentExpression";
|
||||||
|
operator: AssignmentOperator;
|
||||||
|
left: Pattern | MemberExpression;
|
||||||
|
right: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateExpression extends BaseExpression {
|
||||||
|
type: "UpdateExpression";
|
||||||
|
operator: UpdateOperator;
|
||||||
|
argument: Expression;
|
||||||
|
prefix: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LogicalExpression extends BaseExpression {
|
||||||
|
type: "LogicalExpression";
|
||||||
|
operator: LogicalOperator;
|
||||||
|
left: Expression;
|
||||||
|
right: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ConditionalExpression extends BaseExpression {
|
||||||
|
type: "ConditionalExpression";
|
||||||
|
test: Expression;
|
||||||
|
alternate: Expression;
|
||||||
|
consequent: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface BaseCallExpression extends BaseExpression {
|
||||||
|
callee: Expression | Super;
|
||||||
|
arguments: Array<Expression | SpreadElement>;
|
||||||
|
}
|
||||||
|
export type CallExpression = SimpleCallExpression | NewExpression;
|
||||||
|
|
||||||
|
export interface SimpleCallExpression extends BaseCallExpression {
|
||||||
|
type: "CallExpression";
|
||||||
|
optional: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface NewExpression extends BaseCallExpression {
|
||||||
|
type: "NewExpression";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MemberExpression extends BaseExpression, BasePattern {
|
||||||
|
type: "MemberExpression";
|
||||||
|
object: Expression | Super;
|
||||||
|
property: Expression | PrivateIdentifier;
|
||||||
|
computed: boolean;
|
||||||
|
optional: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Pattern =
|
||||||
|
Identifier | ObjectPattern | ArrayPattern | RestElement |
|
||||||
|
AssignmentPattern | MemberExpression;
|
||||||
|
|
||||||
|
interface BasePattern extends BaseNode { }
|
||||||
|
|
||||||
|
export interface SwitchCase extends BaseNode {
|
||||||
|
type: "SwitchCase";
|
||||||
|
test?: Expression | null;
|
||||||
|
consequent: Array<Statement>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CatchClause extends BaseNode {
|
||||||
|
type: "CatchClause";
|
||||||
|
param: Pattern | null;
|
||||||
|
body: BlockStatement;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
||||||
|
type: "Identifier";
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
|
||||||
|
|
||||||
|
export interface SimpleLiteral extends BaseNode, BaseExpression {
|
||||||
|
type: "Literal";
|
||||||
|
value: string | boolean | number | null;
|
||||||
|
raw?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RegExpLiteral extends BaseNode, BaseExpression {
|
||||||
|
type: "Literal";
|
||||||
|
value?: RegExp | null;
|
||||||
|
regex: {
|
||||||
|
pattern: string;
|
||||||
|
flags: string;
|
||||||
|
};
|
||||||
|
raw?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface BigIntLiteral extends BaseNode, BaseExpression {
|
||||||
|
type: "Literal";
|
||||||
|
value?: bigint | null;
|
||||||
|
bigint: string;
|
||||||
|
raw?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UnaryOperator =
|
||||||
|
"-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
||||||
|
|
||||||
|
export type BinaryOperator =
|
||||||
|
"==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" |
|
||||||
|
">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" |
|
||||||
|
"instanceof";
|
||||||
|
|
||||||
|
export type LogicalOperator = "||" | "&&" | "??";
|
||||||
|
|
||||||
|
export type AssignmentOperator =
|
||||||
|
"=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" |
|
||||||
|
"|=" | "^=" | "&=";
|
||||||
|
|
||||||
|
export type UpdateOperator = "++" | "--";
|
||||||
|
|
||||||
|
export interface ForOfStatement extends BaseForXStatement {
|
||||||
|
type: "ForOfStatement";
|
||||||
|
await: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Super extends BaseNode {
|
||||||
|
type: "Super";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SpreadElement extends BaseNode {
|
||||||
|
type: "SpreadElement";
|
||||||
|
argument: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
||||||
|
type: "ArrowFunctionExpression";
|
||||||
|
expression: boolean;
|
||||||
|
body: BlockStatement | Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface YieldExpression extends BaseExpression {
|
||||||
|
type: "YieldExpression";
|
||||||
|
argument?: Expression | null;
|
||||||
|
delegate: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TemplateLiteral extends BaseExpression {
|
||||||
|
type: "TemplateLiteral";
|
||||||
|
quasis: Array<TemplateElement>;
|
||||||
|
expressions: Array<Expression>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TaggedTemplateExpression extends BaseExpression {
|
||||||
|
type: "TaggedTemplateExpression";
|
||||||
|
tag: Expression;
|
||||||
|
quasi: TemplateLiteral;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TemplateElement extends BaseNode {
|
||||||
|
type: "TemplateElement";
|
||||||
|
tail: boolean;
|
||||||
|
value: {
|
||||||
|
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
|
||||||
|
cooked?: string | null;
|
||||||
|
raw: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AssignmentProperty extends Property {
|
||||||
|
value: Pattern;
|
||||||
|
kind: "init";
|
||||||
|
method: boolean; // false
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ObjectPattern extends BasePattern {
|
||||||
|
type: "ObjectPattern";
|
||||||
|
properties: Array<AssignmentProperty | RestElement>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ArrayPattern extends BasePattern {
|
||||||
|
type: "ArrayPattern";
|
||||||
|
elements: Array<Pattern | null>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface RestElement extends BasePattern {
|
||||||
|
type: "RestElement";
|
||||||
|
argument: Pattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AssignmentPattern extends BasePattern {
|
||||||
|
type: "AssignmentPattern";
|
||||||
|
left: Pattern;
|
||||||
|
right: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Class = ClassDeclaration | ClassExpression;
|
||||||
|
interface BaseClass extends BaseNode {
|
||||||
|
superClass?: Expression | null;
|
||||||
|
body: ClassBody;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ClassBody extends BaseNode {
|
||||||
|
type: "ClassBody";
|
||||||
|
body: Array<MethodDefinition | PropertyDefinition>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MethodDefinition extends BaseNode {
|
||||||
|
type: "MethodDefinition";
|
||||||
|
key: Expression | PrivateIdentifier;
|
||||||
|
value: FunctionExpression;
|
||||||
|
kind: "constructor" | "method" | "get" | "set";
|
||||||
|
computed: boolean;
|
||||||
|
static: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ClassDeclaration extends BaseClass, BaseDeclaration {
|
||||||
|
type: "ClassDeclaration";
|
||||||
|
/** It is null when a class declaration is a part of the `export default class` statement */
|
||||||
|
id: Identifier | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ClassExpression extends BaseClass, BaseExpression {
|
||||||
|
type: "ClassExpression";
|
||||||
|
id?: Identifier | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface MetaProperty extends BaseExpression {
|
||||||
|
type: "MetaProperty";
|
||||||
|
meta: Identifier;
|
||||||
|
property: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ModuleDeclaration =
|
||||||
|
ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration |
|
||||||
|
ExportAllDeclaration;
|
||||||
|
interface BaseModuleDeclaration extends BaseNode { }
|
||||||
|
|
||||||
|
export type ModuleSpecifier =
|
||||||
|
ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier |
|
||||||
|
ExportSpecifier;
|
||||||
|
interface BaseModuleSpecifier extends BaseNode {
|
||||||
|
local: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportDeclaration extends BaseModuleDeclaration {
|
||||||
|
type: "ImportDeclaration";
|
||||||
|
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
||||||
|
source: Literal;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportSpecifier extends BaseModuleSpecifier {
|
||||||
|
type: "ImportSpecifier";
|
||||||
|
imported: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportExpression extends BaseExpression {
|
||||||
|
type: "ImportExpression";
|
||||||
|
source: Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
||||||
|
type: "ImportDefaultSpecifier";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
||||||
|
type: "ImportNamespaceSpecifier";
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
||||||
|
type: "ExportNamedDeclaration";
|
||||||
|
declaration?: Declaration | null;
|
||||||
|
specifiers: Array<ExportSpecifier>;
|
||||||
|
source?: Literal | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExportSpecifier extends BaseModuleSpecifier {
|
||||||
|
type: "ExportSpecifier";
|
||||||
|
exported: Identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
||||||
|
type: "ExportDefaultDeclaration";
|
||||||
|
declaration: Declaration | Expression;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExportAllDeclaration extends BaseModuleDeclaration {
|
||||||
|
type: "ExportAllDeclaration";
|
||||||
|
source: Literal;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface AwaitExpression extends BaseExpression {
|
||||||
|
type: "AwaitExpression";
|
||||||
|
argument: Expression;
|
||||||
|
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue