repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-adapter/lib/in-memory-adapter.ts
packages/socket.io-adapter/lib/in-memory-adapter.ts
import { EventEmitter } from "events"; import { yeast } from "./contrib/yeast"; import * as WebSocket from "ws"; // @ts-expect-error const canPreComputeFrame = typeof WebSocket?.Sender?.frame === "function"; /** * A public ID, sent by the server at the beginning of the Socket.IO session and which can be used for pri...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-adapter/lib/contrib/yeast.ts
packages/socket.io-adapter/lib/contrib/yeast.ts
// imported from https://github.com/unshiftio/yeast "use strict"; const alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split( "", ), length = 64, map = {}; let seed = 0, i = 0, prev; /** * Return a string representing the specified number. * * @param {Number} nu...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/test/util.ts
packages/socket.io-redis-streams-emitter/test/util.ts
import { createServer } from "node:http"; import { type AddressInfo } from "node:net"; import { createClient, createCluster } from "redis"; import { Redis, Cluster } from "ioredis"; import { Server, type Socket as ServerSocket } from "socket.io"; import { io as ioc, type Socket as ClientSocket } from "socket.io-client"...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/test/index.ts
packages/socket.io-redis-streams-emitter/test/index.ts
import { describe, it, beforeEach, afterEach } from "node:test"; import * as assert from "node:assert"; import { type Server, type Socket as ServerSocket } from "socket.io"; import { type Socket as ClientSocket } from "socket.io-client"; import { times, sleep, setup, initRedisClient } from "./util"; import { Emitter } ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/lib/util.ts
packages/socket.io-redis-streams-emitter/lib/util.ts
export function hasBinary(obj: any, toJSON?: boolean): boolean { if (!obj || typeof obj !== "object") { return false; } if (obj instanceof ArrayBuffer || ArrayBuffer.isView(obj)) { return true; } if (Array.isArray(obj)) { for (let i = 0, l = obj.length; i < l; i++) { if (hasBinary(obj[i]))...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/lib/typed-events.ts
packages/socket.io-redis-streams-emitter/lib/typed-events.ts
/** * An events map is an interface that maps event names to their value, which * represents the type of the `on` listener. */ export interface EventsMap { [event: string]: any; } /** * The default events map, used if no EventsMap is given. Using this EventsMap * is equivalent to accepting all event names, and ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/lib/index.ts
packages/socket.io-redis-streams-emitter/lib/index.ts
import debugModule from "debug"; import type { DefaultEventsMap, EventNames, EventParams, EventsMap, TypedEventBroadcaster, } from "./typed-events"; import { encode } from "@msgpack/msgpack"; import { hasBinary, XADD } from "./util"; import { ClusterMessage, MessageType, BroadcastFlags } from "./adapter-types...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-redis-streams-emitter/lib/adapter-types.ts
packages/socket.io-redis-streams-emitter/lib/adapter-types.ts
// imported from the 'socket.io-adapter' package export enum MessageType { INITIAL_HEARTBEAT = 1, HEARTBEAT, BROADCAST, SOCKETS_JOIN, SOCKETS_LEAVE, DISCONNECT_SOCKETS, FETCH_SOCKETS, FETCH_SOCKETS_RESPONSE, SERVER_SIDE_EMIT, SERVER_SIDE_EMIT_RESPONSE, BROADCAST_CLIENT_COUNT, BROADCAST_ACK, AD...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/close.ts
packages/socket.io/test/close.ts
import { createServer } from "http"; import { io as ioc } from "socket.io-client"; import { join } from "path"; import { exec } from "child_process"; import { Server } from ".."; import expect from "expect.js"; import { createClient, eioHandshake, eioPoll, eioPush, getPort, } from "./support/util"; describe(...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/socket-timeout.ts
packages/socket.io/test/socket-timeout.ts
import { Server } from ".."; import { createClient, success } from "./support/util"; import expect from "expect.js"; describe("timeout", () => { it("should timeout if the client does not acknowledge the event", (done) => { const io = new Server(0); const client = createClient(io, "/"); io.on("connection...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/socket.io.test-d.ts
packages/socket.io/test/socket.io.test-d.ts
"use strict"; import { createServer } from "http"; import { Adapter } from "socket.io-adapter"; import { expectType } from "tsd"; import { BroadcastOperator, Server, Socket, type DisconnectReason, } from "../lib/index"; import type { DefaultEventsMap, EventsMap } from "../lib/typed-events"; // This file is run...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/namespaces.ts
packages/socket.io/test/namespaces.ts
import type { SocketId } from "socket.io-adapter"; import { Server, Namespace, Socket } from ".."; import expect from "expect.js"; import { success, createClient, successFn, createPartialDone, assert, } from "./support/util"; describe("namespaces", () => { it("should be accessible through .sockets", () => ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/handshake.ts
packages/socket.io/test/handshake.ts
import { Server } from ".."; import expect from "expect.js"; import { getPort, success } from "./support/util"; describe("handshake", () => { const request = require("superagent"); it("should send the Access-Control-Allow-xxx headers on OPTIONS request", (done) => { const io = new Server(0, { cors: { ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/middleware.ts
packages/socket.io/test/middleware.ts
import { Server, Socket } from ".."; import expect from "expect.js"; import { success, createClient, successFn, createPartialDone, } from "./support/util"; describe("middleware", () => { it("should call functions", (done) => { const io = new Server(0); let run = 0; io.use((socket, next) => { ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/socket-middleware.ts
packages/socket.io/test/socket-middleware.ts
import { Server } from ".."; import expect from "expect.js"; import { success, createClient } from "./support/util"; describe("socket middleware", () => { it("should call functions", (done) => { const io = new Server(0); const clientSocket = createClient(io, "/", { multiplex: false }); clientSocket.emit...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/messaging-many.ts
packages/socket.io/test/messaging-many.ts
import { Server } from ".."; import expect from "expect.js"; import { createClient, createPartialDone, success, successFn, waitFor, } from "./support/util"; describe("messaging many", () => { it("emits to a namespace", (done) => { const io = new Server(0); const socket1 = createClient(io, "/", { mu...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/connection-state-recovery.ts
packages/socket.io/test/connection-state-recovery.ts
import { Server, Socket } from ".."; import expect from "expect.js"; import { waitFor, eioHandshake, eioPush, eioPoll } from "./support/util"; import { createServer, Server as HttpServer } from "http"; import { Adapter } from "socket.io-adapter"; async function init(httpServer: HttpServer, io: Server) { // Engine.IO...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/uws.ts
packages/socket.io/test/uws.ts
import { App, us_socket_local_port, us_listen_socket_close, } from "uWebSockets.js"; import { Server } from ".."; import { io as ioc, Socket as ClientSocket } from "socket.io-client"; import request from "supertest"; import expect from "expect.js"; import { assert } from "./support/util"; const createPartialDone...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/index.ts
packages/socket.io/test/index.ts
"use strict"; describe("socket.io", () => { require("./server-attachment"); require("./handshake"); require("./close"); require("./namespaces"); require("./socket"); require("./messaging-many"); require("./middleware"); require("./socket-middleware"); require("./v2-compatibility"); require("./socke...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/socket.ts
packages/socket.io/test/socket.ts
import fs = require("fs"); import { join } from "path"; import { createClient, createPartialDone, getPort, success, successFn, } from "./support/util"; import { Server } from ".."; import expect from "expect.js"; describe("socket", () => { it("should not fire events more than once after manually reconnecti...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/v2-compatibility.ts
packages/socket.io/test/v2-compatibility.ts
import { Server, Socket } from ".."; import expect from "expect.js"; import { success, getPort, waitFor } from "./support/util"; import * as io_v2 from "socket.io-client-v2"; describe("v2 compatibility", () => { it("should connect if `allowEIO3` is true", (done) => { const io = new Server(0, { allowEIO3: t...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/utility-methods.ts
packages/socket.io/test/utility-methods.ts
import { createServer } from "http"; import { Server, Socket } from ".."; import { io as ioc, Socket as ClientSocket } from "socket.io-client"; import { Adapter, BroadcastOptions } from "socket.io-adapter"; import expect from "expect.js"; import type { AddressInfo } from "net"; import "./support/util"; import { create...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/server-attachment.ts
packages/socket.io/test/server-attachment.ts
import { Server } from ".."; import { createServer } from "http"; import request from "supertest"; import expect from "expect.js"; import { getPort, successFn } from "./support/util"; describe("server attachment", () => { describe("http.Server", () => { const clientVersion = require("../package.json").version; ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/support/util.ts
packages/socket.io/test/support/util.ts
/// <reference types="./expectjs" /> import type { Server } from "../.."; import { io as ioc, ManagerOptions, Socket as ClientSocket, SocketOptions, } from "socket.io-client"; import request from "supertest"; import type { AddressInfo } from "node:net"; import type { DefaultEventsMap, EventsMap } from "../../li...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/support/expectjs.d.ts
packages/socket.io/test/support/expectjs.d.ts
declare function expect(target?: any): Expect.Root; declare namespace Expect { interface Assertion { /** * Check if the value is truthy */ ok(): void; /** * Creates an anonymous function which calls fn with arguments. */ withArgs(...args: any[]): Root; /** * Assert that...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/test/fixtures/server-close.ts
packages/socket.io/test/fixtures/server-close.ts
const server = require("http").createServer(); const ioc = require("socket.io-client"); const io = require("../..")(server); const srv = server.listen(() => { const socket = ioc.connect("ws://localhost:" + server.address().port); socket.on("connect", () => { io.close(); socket.close(); }); });
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/broadcast-operator.ts
packages/socket.io/lib/broadcast-operator.ts
import type { BroadcastFlags, Room, SocketId } from "socket.io-adapter"; import { Handshake, RESERVED_EVENTS } from "./socket-types"; import { PacketType } from "socket.io-parser"; import type { Adapter } from "socket.io-adapter"; import type { EventParams, EventNames, EventsMap, TypedEventBroadcaster, Decora...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/client.ts
packages/socket.io/lib/client.ts
import { Decoder, Encoder, Packet, PacketType } from "socket.io-parser"; import debugModule from "debug"; import url from "url"; import type { IncomingMessage } from "http"; import type { Server } from "./index"; import type { Namespace } from "./namespace"; import type { EventsMap } from "./typed-events"; import type ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/namespace.ts
packages/socket.io/lib/namespace.ts
import { Socket } from "./socket"; import type { Server } from "./index"; import { EventParams, EventNames, EventsMap, StrictEventEmitter, DefaultEventsMap, DecorateAcknowledgementsWithTimeoutAndMultipleResponses, AllButLast, Last, DecorateAcknowledgementsWithMultipleResponses, RemoveAcknowledgement...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/parent-namespace.ts
packages/socket.io/lib/parent-namespace.ts
import { Namespace } from "./namespace"; import type { Server, RemoteSocket } from "./index"; import type { EventParams, EventsMap, DefaultEventsMap, EventNamesWithoutAck, } from "./typed-events"; import { Adapter } from "socket.io-adapter"; import type { BroadcastOptions } from "socket.io-adapter"; import debu...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/uws.ts
packages/socket.io/lib/uws.ts
import { Adapter, Room } from "socket.io-adapter"; import type { WebSocket } from "uWebSockets.js"; import type { Socket } from "./socket.js"; import { createReadStream, statSync } from "fs"; import debugModule from "debug"; const debug = debugModule("socket.io:adapter-uws"); const SEPARATOR = "\x1f"; // see https://...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/typed-events.ts
packages/socket.io/lib/typed-events.ts
import { EventEmitter } from "events"; /** * An events map is an interface that maps event names to their value, which * represents the type of the `on` listener. */ export interface EventsMap { [event: string]: any; } /** * The default events map, used if no EventsMap is given. Using this EventsMap * is equiva...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/index.ts
packages/socket.io/lib/index.ts
import http from "http"; import type { Server as HTTPSServer } from "https"; import type { Http2SecureServer, Http2Server } from "http2"; import { createReadStream } from "fs"; import { createDeflate, createGzip, createBrotliCompress } from "zlib"; import accepts = require("accepts"); import { pipeline } from "stream";...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
true
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/socket.ts
packages/socket.io/lib/socket.ts
import { Packet, PacketType } from "socket.io-parser"; import debugModule from "debug"; import type { Server } from "./index"; import { AllButLast, DecorateAcknowledgements, DecorateAcknowledgementsWithMultipleResponses, DefaultEventsMap, EventNames, EventNamesWithAck, EventParams, EventsMap, FirstNon...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io/lib/socket-types.ts
packages/socket.io/lib/socket-types.ts
import type { NamespaceReservedEventsMap } from "./namespace"; import type { IncomingHttpHeaders } from "http"; import type { ParsedUrlQuery } from "querystring"; type ClientReservedEvents = "connect_error"; // TODO for next major release: cleanup disconnect reasons export type DisconnectReason = // Engine.IO close...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transport.ts
packages/engine.io-client/lib/transport.ts
import { decodePacket } from "engine.io-parser"; import type { Packet, RawData } from "engine.io-parser"; import { Emitter } from "@socket.io/component-emitter"; import { installTimerFunctions } from "./util.js"; import type { Socket, SocketOptions } from "./socket.js"; import { encode } from "./contrib/parseqs.js"; im...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/util.ts
packages/engine.io-client/lib/util.ts
import { globalThisShim as globalThis } from "./globals.node.js"; export function pick(obj, ...attr) { return attr.reduce((acc, k) => { if (obj.hasOwnProperty(k)) { acc[k] = obj[k]; } return acc; }, {}); } // Keep a reference to the real timeout functions so they can be used when overridden cons...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/browser-entrypoint.ts
packages/engine.io-client/lib/browser-entrypoint.ts
import { Socket } from "./socket.js"; export default (uri, opts) => new Socket(uri, opts);
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/index.ts
packages/engine.io-client/lib/index.ts
import { Socket } from "./socket.js"; export { Socket }; export { SocketOptions, SocketWithoutUpgrade, SocketWithUpgrade, } from "./socket.js"; export const protocol = Socket.protocol; export { Transport, TransportError } from "./transport.js"; export { transports } from "./transports/index.js"; export { install...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/globals.ts
packages/engine.io-client/lib/globals.ts
export const nextTick = (() => { const isPromiseAvailable = typeof Promise === "function" && typeof Promise.resolve === "function"; if (isPromiseAvailable) { return (cb) => Promise.resolve().then(cb); } else { return (cb, setTimeoutFn) => setTimeoutFn(cb, 0); } })(); export const globalThisShim = (...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/socket.ts
packages/engine.io-client/lib/socket.ts
import { transports as DEFAULT_TRANSPORTS } from "./transports/index.js"; import { installTimerFunctions, byteLength } from "./util.js"; import { decode } from "./contrib/parseqs.js"; import { parse } from "./contrib/parseuri.js"; import { Emitter } from "@socket.io/component-emitter"; import { protocol } from "engine....
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
true
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/globals.node.ts
packages/engine.io-client/lib/globals.node.ts
export const nextTick = process.nextTick; export const globalThisShim = global; export const defaultBinaryType = "nodebuffer"; export function createCookieJar() { return new CookieJar(); } interface Cookie { name: string; value: string; expires?: Date; } /** * @see https://developer.mozilla.org/en-US/docs/W...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/contrib/parseuri.ts
packages/engine.io-client/lib/contrib/parseuri.ts
// imported from https://github.com/galkn/parseuri /** * Parses a URI * * Note: we could also have used the built-in URL object, but it isn't supported on all platforms. * * See: * - https://developer.mozilla.org/en-US/docs/Web/API/URL * - https://caniuse.com/url * - https://www.rfc-editor.org/rfc/rfc3986#appen...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/contrib/has-cors.ts
packages/engine.io-client/lib/contrib/has-cors.ts
// imported from https://github.com/component/has-cors let value = false; try { value = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest(); } catch (err) { // if XMLHttp support is disabled in IE then it will throw // when trying to create } export const hasCORS = v...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/contrib/parseqs.ts
packages/engine.io-client/lib/contrib/parseqs.ts
// imported from https://github.com/galkn/querystring /** * Compiles a querystring * Returns string representation of the object * * @param {Object} * @api private */ export function encode (obj) { let str = ''; for (let i in obj) { if (obj.hasOwnProperty(i)) { if (str.length) str +=...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/websocket.ts
packages/engine.io-client/lib/transports/websocket.ts
import { Transport } from "../transport.js"; import { pick, randomString } from "../util.js"; import { encodePacket } from "engine.io-parser"; import type { Packet, RawData } from "engine.io-parser"; import { globalThisShim as globalThis, nextTick } from "../globals.node.js"; import debugModule from "debug"; // debug()...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/polling-xhr.ts
packages/engine.io-client/lib/transports/polling-xhr.ts
import { Polling } from "./polling.js"; import { Emitter } from "@socket.io/component-emitter"; import type { SocketOptions } from "../socket.js"; import { installTimerFunctions, pick } from "../util.js"; import { globalThisShim as globalThis } from "../globals.node.js"; import type { CookieJar } from "../globals.node....
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/polling-fetch.ts
packages/engine.io-client/lib/transports/polling-fetch.ts
import { Polling } from "./polling.js"; import { CookieJar, createCookieJar } from "../globals.node.js"; /** * HTTP long-polling based on the built-in `fetch()` method. * * Usage: browser, Node.js (since v18), Deno, Bun * * @see https://developer.mozilla.org/en-US/docs/Web/API/fetch * @see https://caniuse.com/fe...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/websocket.node.ts
packages/engine.io-client/lib/transports/websocket.node.ts
import * as ws from "ws"; import type { Packet, RawData } from "engine.io-parser"; import { BaseWS } from "./websocket.js"; /** * WebSocket transport based on the `WebSocket` object provided by the `ws` package. * * Usage: Node.js, Deno (compat), Bun (compat) * * @see https://developer.mozilla.org/en-US/docs/Web/...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/webtransport.ts
packages/engine.io-client/lib/transports/webtransport.ts
import { Transport } from "../transport.js"; import { nextTick } from "../globals.node.js"; import { Packet, createPacketDecoderStream, createPacketEncoderStream, } from "engine.io-parser"; import debugModule from "debug"; // debug() const debug = debugModule("engine.io-client:webtransport"); // debug() /** * ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/polling.ts
packages/engine.io-client/lib/transports/polling.ts
import { Transport } from "../transport.js"; import { randomString } from "../util.js"; import { encodePayload, decodePayload } from "engine.io-parser"; import debugModule from "debug"; // debug() const debug = debugModule("engine.io-client:polling"); // debug() export abstract class Polling extends Transport { pri...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/polling-xhr.node.ts
packages/engine.io-client/lib/transports/polling-xhr.node.ts
import * as XMLHttpRequestModule from "xmlhttprequest-ssl"; import { BaseXHR, Request, RequestOptions } from "./polling-xhr.js"; const XMLHttpRequest = XMLHttpRequestModule.default || XMLHttpRequestModule; /** * HTTP long-polling based on the `XMLHttpRequest` object provided by the `xmlhttprequest-ssl` package. * ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/engine.io-client/lib/transports/index.ts
packages/engine.io-client/lib/transports/index.ts
import { XHR } from "./polling-xhr.node.js"; import { WS } from "./websocket.node.js"; import { WT } from "./webtransport.js"; export const transports = { websocket: WS, webtransport: WT, polling: XHR, };
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-component-emitter/lib/esm/index.d.ts
packages/socket.io-component-emitter/lib/esm/index.d.ts
/** * An events map is an interface that maps event names to their value, which * represents the type of the `on` listener. */ export interface EventsMap { [event: string]: any; } /** * The default events map, used if no EventsMap is given. Using this EventsMap * is equivalent to accepting all event names, an...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-component-emitter/lib/cjs/index.d.ts
packages/socket.io-component-emitter/lib/cjs/index.d.ts
/** * An events map is an interface that maps event names to their value, which * represents the type of the `on` listener. */ export interface EventsMap { [event: string]: any; } /** * The default events map, used if no EventsMap is given. Using this EventsMap * is equivalent to accepting all event names, an...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/test/util.ts
packages/socket.io-cluster-engine/test/util.ts
import expect = require("expect.js"); export function url(port: number, sid?: string) { let url = `http://localhost:${port}/engine.io/?EIO=4&transport=polling`; if (sid) { url += `&sid=${sid}`; } return url; } export async function handshake(port: number) { const res = await fetch(url(port)); expect(r...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/test/redis.ts
packages/socket.io-cluster-engine/test/redis.ts
import expect = require("expect.js"); import { createServer } from "node:http"; import { createClient } from "redis"; import { handshake, url } from "./util"; import { type ClusterEngine } from "../lib/engine"; import { RedisEngine } from "../lib"; import Redis from "ioredis"; describe("redis", () => { let engine1: ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/test/in-memory.ts
packages/socket.io-cluster-engine/test/in-memory.ts
import { EventEmitter } from "node:events"; import { createServer, Server } from "node:http"; import expect = require("expect.js"); import { WebSocket } from "ws"; import { ClusterEngine, type Message } from "../lib/engine"; import { type ServerOptions } from "engine.io"; import { url, handshake } from "./util"; class...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/test/cluster.ts
packages/socket.io-cluster-engine/test/cluster.ts
import cluster from "node:cluster"; import expect = require("expect.js"); import { handshake, url } from "./util"; import { setupPrimary } from "../lib"; const WORKER_COUNT = 3; cluster.setupPrimary({ exec: "./test/worker.js", // @ts-expect-error serialization: "advanced", // needed for packets with Buffer obje...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/lib/redis.ts
packages/socket.io-cluster-engine/lib/redis.ts
import { ClusterEngine, type Message } from "./engine"; import { encode, decode } from "@msgpack/msgpack"; import { type ServerOptions } from "engine.io"; import cluster from "node:cluster"; import { randomUUID } from "node:crypto"; import debugModule from "debug"; const debug = debugModule("engine:redis"); const MESS...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/lib/engine.ts
packages/socket.io-cluster-engine/lib/engine.ts
import { Server, type ServerOptions, type ErrorCallback, Socket, type Transport, } from "engine.io"; import { randomBytes } from "node:crypto"; import { setTimeout, clearTimeout } from "node:timers"; import { type IncomingMessage } from "node:http"; import { type Packet } from "engine.io-parser"; import debug...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/lib/index.ts
packages/socket.io-cluster-engine/lib/index.ts
export { setupPrimary, NodeClusterEngine } from "./cluster"; export { setupPrimaryWithRedis, RedisEngine } from "./redis";
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-cluster-engine/lib/cluster.ts
packages/socket.io-cluster-engine/lib/cluster.ts
import cluster from "node:cluster"; import { type ServerOptions } from "engine.io"; import { ClusterEngine, type Message } from "./engine"; import debugModule from "debug"; const debug = debugModule("engine:cluster"); const MESSAGE_SOURCE = "_eio"; const kNodeId = Symbol("nodeId"); function ignoreError() {} export f...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-parser/lib/is-binary.ts
packages/socket.io-parser/lib/is-binary.ts
const withNativeArrayBuffer: boolean = typeof ArrayBuffer === "function"; const isView = (obj: any) => { return typeof ArrayBuffer.isView === "function" ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer; }; const toString = Object.prototype.toString; const withNativeBlob = typeof Blob === "fun...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-parser/lib/binary.ts
packages/socket.io-parser/lib/binary.ts
import { isBinary } from "./is-binary.js"; /** * Replaces every Buffer | ArrayBuffer | Blob | File in packet with a numbered placeholder. * * @param {Object} packet - socket.io event packet * @return {Object} with deconstructed packet and list of buffers * @public */ export function deconstructPacket(packet) { ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
socketio/socket.io
https://github.com/socketio/socket.io/blob/9978574e4f1d4e21593497f94c40053cd0fff359/packages/socket.io-parser/lib/index.ts
packages/socket.io-parser/lib/index.ts
import { Emitter } from "@socket.io/component-emitter"; import { deconstructPacket, reconstructPacket } from "./binary.js"; import { isBinary, hasBinary } from "./is-binary.js"; import debugModule from "debug"; // debug() const debug = debugModule("socket.io-parser"); // debug() /** * These strings must not be used ...
typescript
MIT
9978574e4f1d4e21593497f94c40053cd0fff359
2026-01-04T15:28:10.329849Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/vitest.config.ts
vitest.config.ts
import path from 'node:path' import url from 'node:url' import { defineConfig } from 'vitest/config' const _dirname = path.dirname(url.fileURLToPath(import.meta.url)) export default defineConfig({ test: { include: ['**/__tests__/**/*.spec.[tj]s'], exclude: [ '**/node_modules/**', '**/dist/**', ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/vitest.config.e2e.ts
vitest.config.e2e.ts
import { resolve } from 'node:path' import { defaultExclude, defineConfig } from 'vitest/config' const isBuild = !!process.env.VITE_TEST_BUILD const timeout = process.env.PWDEBUG ? Infinity : process.env.CI ? 50000 : 30000 export default defineConfig({ resolve: { alias: { '~utils': resolve(__dirname, './...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/scripts/publishCI.ts
scripts/publishCI.ts
import { publish } from '@vitejs/release-scripts' publish({ defaultPackage: 'vite', packageManager: 'pnpm' })
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/scripts/releaseUtils.ts
scripts/releaseUtils.ts
import fs from 'node:fs/promises' import path from 'node:path' import colors from 'picocolors' import type { Options as ExecaOptions, ResultPromise } from 'execa' import { execa } from 'execa' function run<EO extends ExecaOptions>( bin: string, args: string[], opts?: EO, ): ResultPromise< EO & (keyof EO extend...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/scripts/release.ts
scripts/release.ts
import { generateChangelog, release } from '@vitejs/release-scripts' import colors from 'picocolors' import { logRecentCommits, updateTemplateVersions } from './releaseUtils' release({ repo: 'vite', packages: ['vite', 'create-vite', 'plugin-legacy'], toTag: (pkg, version) => pkg === 'vite' ? `v${version}` : ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/_data/blog.data.ts
docs/_data/blog.data.ts
import { createContentLoader } from 'vitepress' interface Post { title: string url: string date: { time: number string: string } } declare const data: Post[] export { data } export default createContentLoader('blog/*.md', { // excerpt: true, transform(raw): Post[] { return raw .map(({ u...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/config.ts
docs/.vitepress/config.ts
import path from 'node:path' import fs from 'node:fs' import type { DefaultTheme, HeadConfig } from 'vitepress' import { defineConfig } from 'vitepress' import { transformerTwoslash } from '@shikijs/vitepress-twoslash' import { groupIconMdPlugin, groupIconVitePlugin, } from 'vitepress-plugin-group-icons' import llm...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/buildEnd.config.ts
docs/.vitepress/buildEnd.config.ts
import path from 'node:path' import { writeFileSync } from 'node:fs' import { Feed } from 'feed' import type { SiteConfig } from 'vitepress' import { createContentLoader } from 'vitepress' const siteUrl = 'https://vite.dev' const blogUrl = `${siteUrl}/blog` export const buildEnd = async (config: SiteConfig): Promise<...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/inlined-scripts/banner.d.ts
docs/.vitepress/inlined-scripts/banner.d.ts
interface Window { __VITE_BANNER_ID__: string }
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/theme/index.ts
docs/.vitepress/theme/index.ts
import { h } from 'vue' import type { Theme } from 'vitepress' import DefaultTheme from 'vitepress/theme' import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client' import '@shikijs/vitepress-twoslash/style.css' import './styles/vars.css' import './styles/landing.css' import AsideSponsors from './components/A...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/theme/composables/useCardAnimation.ts
docs/.vitepress/theme/composables/useCardAnimation.ts
import { type Ref, onMounted, onUnmounted, ref } from 'vue' import { gsap } from 'gsap' import { ScrollTrigger } from 'gsap/dist/ScrollTrigger' gsap.registerPlugin(ScrollTrigger) /** * A custom hook for animating a card element. * * @param {HTMLElement | string} el - The element or selector for the element to be a...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/theme/composables/useSlideIn.ts
docs/.vitepress/theme/composables/useSlideIn.ts
import { nextTick, onMounted } from 'vue' import { gsap } from 'gsap' export function useSlideIn(el: HTMLElement | string) { onMounted(async () => { await nextTick(() => { gsap.to(el, { x: 0, duration: 1, ease: 'power3.out', scrollTrigger: { trigger: el, ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/docs/.vitepress/theme/composables/sponsor.ts
docs/.vitepress/theme/composables/sponsor.ts
import { onMounted, onUnmounted, ref } from 'vue' import voidZeroSvg from './images/voidzero.svg' import boltSvg from './images/bolt.svg' import nuxtLabsSvg from './images/nuxtlabs.svg' interface Sponsors { special: Sponsor[] platinum: Sponsor[] platinum_china: Sponsor[] gold: Sponsor[] silver: Sponsor[] b...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/rolldown.dts.config.ts
packages/vite/rolldown.dts.config.ts
import { readFileSync } from 'node:fs' import { builtinModules } from 'node:module' import { defineConfig } from 'rolldown' import type { OutputChunk, Plugin, PluginContext, RenderedChunk, } from 'rolldown' import { parseAst } from 'rolldown/parseAst' import { dts } from 'rolldown-plugin-dts' import { parse as ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/client.d.ts
packages/vite/client.d.ts
/// <reference path="./types/importMeta.d.ts" /> // CSS modules type CSSModuleClasses = { readonly [key: string]: string } declare module '*.module.css' { const classes: CSSModuleClasses export default classes } declare module '*.module.scss' { const classes: CSSModuleClasses export default classes } declare ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/rollupLicensePlugin.ts
packages/vite/rollupLicensePlugin.ts
import fs from 'node:fs' import license from 'rollup-plugin-license' import type { Dependency } from 'rollup-plugin-license' import colors from 'picocolors' import type { Plugin, PluginContext } from 'rollup' export default function licensePlugin( licenseFilePath: string, licenseTitle: string, packageName: strin...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/rolldown.config.ts
packages/vite/rolldown.config.ts
import { readFileSync, writeFileSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' import MagicString from 'magic-string' import type { Plugin } from 'rolldown' import { defineConfig } from 'rolldown' import { init, parse } from 'es-module-lexer' import licensePlugin from './rol...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/scripts/generateTarget.ts
packages/vite/scripts/generateTarget.ts
import { getCompatibleVersions } from 'baseline-browser-mapping' // Update on each major release const targetDate = '2026-01-01' // https://esbuild.github.io/api/#target const esbuildSupportedBrowsers = new Set([ 'chrome', 'edge', 'firefox', 'safari', ]) const results = getCompatibleVersions({ widelyAvaila...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/misc/true.d.ts
packages/vite/misc/true.d.ts
declare const result: boolean export default result
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/misc/false.d.ts
packages/vite/misc/false.d.ts
declare const result: boolean export default result
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/idResolver.ts
packages/vite/src/node/idResolver.ts
import type { PartialResolvedId } from 'rolldown' import aliasPlugin from '@rollup/plugin-alias' import type { ResolvedConfig } from './config' import type { EnvironmentPluginContainer } from './server/pluginContainer' import { createEnvironmentPluginContainer } from './server/pluginContainer' import { oxcResolvePlugin...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/config.ts
packages/vite/src/node/config.ts
import fs from 'node:fs' import path from 'node:path' import fsp from 'node:fs/promises' import { pathToFileURL } from 'node:url' import { inspect, promisify } from 'node:util' import { performance } from 'node:perf_hooks' import { createRequire } from 'node:module' import crypto from 'node:crypto' import colors from '...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
true
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/nodeResolve.ts
packages/vite/src/node/nodeResolve.ts
import isModuleSyncConditionEnabled from '#module-sync-enabled' import { DEFAULT_EXTENSIONS } from './constants' import { tryNodeResolve } from './plugins/resolve' import { nodeLikeBuiltins } from './utils' export interface NodeResolveWithViteOptions { root: string isRequire?: boolean } /** * Resolve like Node.j...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/typeUtils.ts
packages/vite/src/node/typeUtils.ts
import type { ObjectHook, MinimalPluginContext as RolldownMinimalPluginContext, Plugin as RolldownPlugin, } from 'rolldown' export type NonNeverKeys<T> = { [K in keyof T]: T[K] extends never ? never : K }[keyof T] export type GetHookContextMap<Plugin> = { [K in keyof Plugin]-?: Plugin[K] extends ObjectHook<...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/preview.ts
packages/vite/src/node/preview.ts
import fs from 'node:fs' import path from 'node:path' import sirv from 'sirv' import compression from '@polka/compression' import connect from 'connect' import corsMiddleware from 'cors' import type { Connect } from '#dep-types/connect' import type { HttpServer, ResolvedServerOptions, ResolvedServerUrls, } from '...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/utils.ts
packages/vite/src/node/utils.ts
import fs from 'node:fs' import os from 'node:os' import net from 'node:net' import path from 'node:path' import { exec } from 'node:child_process' import crypto from 'node:crypto' import { fileURLToPath } from 'node:url' import type { ServerOptions as HttpsServerOptions } from 'node:https' import { builtinModules } fr...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
true
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/publicDir.ts
packages/vite/src/node/publicDir.ts
import path from 'node:path' import { cleanUrl, withTrailingSlash } from '../shared/utils' import type { ResolvedConfig } from './config' import { ERR_SYMLINK_IN_RECURSIVE_READDIR, normalizePath, recursiveReaddir, tryStatSync, } from './utils' const publicFilesMap = new WeakMap<ResolvedConfig, Set<string>>() ...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/external.ts
packages/vite/src/node/external.ts
import path from 'node:path' import type { InternalResolveOptions } from './plugins/resolve' import { tryNodeResolve } from './plugins/resolve' import { bareImportRE, createDebugger, createFilter, getNpmPackageName, isBuiltin, isInNodeModules, } from './utils' import type { Environment } from './environment...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/watch.ts
packages/vite/src/node/watch.ts
import { EventEmitter } from 'node:events' import path from 'node:path' import type { OutputOptions, WatcherOptions } from 'rolldown' import colors from 'picocolors' import { escapePath } from 'tinyglobby' import type { FSWatcher, WatchOptions } from '#dep-types/chokidar' import { withTrailingSlash } from '../shared/ut...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/env.ts
packages/vite/src/node/env.ts
import fs from 'node:fs' import path from 'node:path' import { parse } from 'dotenv' import { type DotenvPopulateInput, expand } from 'dotenv-expand' import { arraify, createDebugger, normalizePath, tryStatSync } from './utils' import type { UserConfig } from './config' const debug = createDebugger('vite:env') export...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/build.ts
packages/vite/src/node/build.ts
import path from 'node:path' import colors from 'picocolors' import type { ExternalOption, InputOption, InternalModuleFormat, LogLevel, LogOrStringHandler, MinimalPluginContext, ModuleFormat, OutputBundle, OutputChunk, OutputOptions, PluginContext, RenderedChunk, RolldownBuild, RolldownOptio...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
true
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/cli.ts
packages/vite/src/node/cli.ts
import path from 'node:path' import fs from 'node:fs' import { performance } from 'node:perf_hooks' import { cac } from 'cac' import colors from 'picocolors' import { VERSION } from './constants' import type { BuildEnvironmentOptions } from './build' import type { ServerOptions } from './server' import type { CLIShortc...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/http.ts
packages/vite/src/node/http.ts
import fsp from 'node:fs/promises' import path from 'node:path' import type { OutgoingHttpHeaders as HttpServerHeaders } from 'node:http' import type { ServerOptions as HttpsServerOptions } from 'node:https' import colors from 'picocolors' import type { Connect } from '#dep-types/connect' import type { ProxyOptions } f...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false
vitejs/vite
https://github.com/vitejs/vite/blob/2ba4e990192845e01c733aa186c9599cdb5bb8fe/packages/vite/src/node/logger.ts
packages/vite/src/node/logger.ts
/* eslint no-console: 0 */ import readline from 'node:readline' import colors from 'picocolors' import type { RollupError } from 'rolldown' import type { ResolvedServerUrls } from './server' export type LogType = 'error' | 'warn' | 'info' export type LogLevel = LogType | 'silent' export interface Logger { info(msg:...
typescript
MIT
2ba4e990192845e01c733aa186c9599cdb5bb8fe
2026-01-04T15:25:31.936307Z
false