@moq/net 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/announced.d.ts +4 -0
- package/announced.d.ts.map +1 -1
- package/announced.js +5 -0
- package/announced.js.map +1 -1
- package/bandwidth.js +1 -0
- package/broadcast.d.ts +5 -1
- package/broadcast.d.ts.map +1 -1
- package/broadcast.js +4 -0
- package/broadcast.js.map +1 -1
- package/connection/accept.d.ts +2 -1
- package/connection/accept.d.ts.map +1 -1
- package/connection/accept.js +1 -0
- package/connection/accept.js.map +1 -1
- package/connection/cert.test.js +1 -0
- package/connection/connect.d.ts +5 -1
- package/connection/connect.d.ts.map +1 -1
- package/connection/connect.js +5 -1
- package/connection/connect.js.map +1 -1
- package/connection/established.d.ts +13 -5
- package/connection/established.d.ts.map +1 -1
- package/connection/established.js +1 -0
- package/connection/established.js.map +1 -1
- package/connection/handshake.d.ts +2 -2
- package/connection/handshake.js +1 -0
- package/connection/index.d.ts +4 -4
- package/connection/index.js +1 -0
- package/connection/reload.d.ts +18 -3
- package/connection/reload.d.ts.map +1 -1
- package/connection/reload.js +13 -4
- package/connection/reload.js.map +1 -1
- package/group.d.ts +13 -0
- package/group.d.ts.map +1 -1
- package/group.js +14 -0
- package/group.js.map +1 -1
- package/ietf/adapter.d.ts +2 -2
- package/ietf/adapter.js +1 -0
- package/ietf/connection.d.ts +6 -6
- package/ietf/connection.js +1 -0
- package/ietf/control.d.ts +11 -11
- package/ietf/control.js +1 -0
- package/ietf/fetch.d.ts +3 -3
- package/ietf/fetch.js +1 -0
- package/ietf/goaway.d.ts +2 -2
- package/ietf/goaway.js +1 -0
- package/ietf/ietf.test.js +1 -0
- package/ietf/index.d.ts +17 -17
- package/ietf/index.js +1 -0
- package/ietf/message.d.ts +1 -1
- package/ietf/message.js +1 -0
- package/ietf/namespace.d.ts +2 -2
- package/ietf/namespace.js +1 -0
- package/ietf/object.d.ts +2 -2
- package/ietf/object.js +1 -0
- package/ietf/parameters.d.ts +2 -2
- package/ietf/parameters.js +1 -0
- package/ietf/properties.d.ts +2 -2
- package/ietf/properties.js +1 -0
- package/ietf/publish.d.ts +3 -3
- package/ietf/publish.js +1 -0
- package/ietf/publish_namespace.d.ts +3 -3
- package/ietf/publish_namespace.js +1 -0
- package/ietf/publisher.d.ts +7 -7
- package/ietf/publisher.js +1 -0
- package/ietf/request.d.ts +3 -3
- package/ietf/request.js +1 -0
- package/ietf/setup.d.ts +3 -3
- package/ietf/setup.js +1 -0
- package/ietf/subscribe.d.ts +3 -3
- package/ietf/subscribe.js +1 -0
- package/ietf/subscribe_namespace.d.ts +3 -3
- package/ietf/subscribe_namespace.js +1 -0
- package/ietf/subscriber.d.ts +8 -8
- package/ietf/subscriber.js +1 -0
- package/ietf/track.d.ts +3 -3
- package/ietf/track.js +1 -0
- package/ietf/version.js +1 -0
- package/index.d.ts +20 -9
- package/index.d.ts.map +1 -1
- package/index.js +7 -0
- package/index.js.map +1 -1
- package/integration.test.js +1 -0
- package/lite/announce.d.ts +4 -4
- package/lite/announce.js +1 -0
- package/lite/connection.d.ts +9 -9
- package/lite/connection.js +1 -0
- package/lite/fetch.d.ts +3 -3
- package/lite/fetch.js +1 -0
- package/lite/goaway.d.ts +2 -2
- package/lite/goaway.js +1 -0
- package/lite/group.d.ts +1 -1
- package/lite/group.js +1 -0
- package/lite/index.d.ts +10 -10
- package/lite/index.js +1 -0
- package/lite/message.d.ts +1 -1
- package/lite/message.js +1 -0
- package/lite/origin.js +1 -0
- package/lite/probe.d.ts +2 -2
- package/lite/probe.js +1 -0
- package/lite/publisher.d.ts +7 -7
- package/lite/publisher.js +1 -0
- package/lite/session.d.ts +2 -2
- package/lite/session.js +1 -0
- package/lite/stream.d.ts +5 -5
- package/lite/stream.js +1 -0
- package/lite/subscribe.d.ts +3 -3
- package/lite/subscribe.js +1 -0
- package/lite/subscriber.d.ts +9 -9
- package/lite/subscriber.js +1 -0
- package/lite/version.js +1 -0
- package/mock.js +1 -0
- package/package.json +2 -2
- package/path.d.ts +2 -0
- package/path.d.ts.map +1 -1
- package/path.js +3 -0
- package/path.js.map +1 -1
- package/path.test.js +1 -0
- package/stream.d.ts +1 -1
- package/stream.js +1 -0
- package/stream.test.js +1 -0
- package/time.d.ts +8 -0
- package/time.d.ts.map +1 -1
- package/time.js +5 -0
- package/time.js.map +1 -1
- package/track.d.ts +14 -1
- package/track.d.ts.map +1 -1
- package/track.js +14 -1
- package/track.js.map +1 -1
- package/track.test.js +1 -0
- package/util/error.js +1 -0
- package/util/hex.js +1 -0
- package/util/index.d.ts +1 -1
- package/util/index.js +1 -0
- package/varint.d.ts +8 -0
- package/varint.d.ts.map +1 -1
- package/varint.js +9 -0
- package/varint.js.map +1 -1
- package/varint.test.js +1 -0
- package/zod.d.ts +9 -2
- package/zod.d.ts.map +1 -1
- package/zod.js +8 -1
- package/zod.js.map +1 -1
package/ietf/subscriber.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Announced } from "../announced
|
|
2
|
-
import { Broadcast } from "../broadcast
|
|
3
|
-
import * as Path from "../path
|
|
4
|
-
import type { Reader, Stream } from "../stream
|
|
5
|
-
import type { Session } from "./adapter
|
|
6
|
-
import { type Group as GroupMessage } from "./object
|
|
7
|
-
import { type Publish } from "./publish
|
|
8
|
-
import type { PublishNamespace } from "./publish_namespace
|
|
1
|
+
import { Announced } from "../announced";
|
|
2
|
+
import { Broadcast } from "../broadcast";
|
|
3
|
+
import * as Path from "../path";
|
|
4
|
+
import type { Reader, Stream } from "../stream";
|
|
5
|
+
import type { Session } from "./adapter";
|
|
6
|
+
import { type Group as GroupMessage } from "./object";
|
|
7
|
+
import { type Publish } from "./publish";
|
|
8
|
+
import type { PublishNamespace } from "./publish_namespace";
|
|
9
9
|
/**
|
|
10
10
|
* Handles subscribing to broadcasts using moq-transport protocol.
|
|
11
11
|
* Uses the stream-per-request pattern (real bidi streams for v17, virtual for v14-v16).
|
package/ietf/subscriber.js
CHANGED
package/ietf/track.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type * as Path from "../path
|
|
2
|
-
import type { Reader, Writer } from "../stream
|
|
3
|
-
import { type IetfVersion } from "./version
|
|
1
|
+
import type * as Path from "../path";
|
|
2
|
+
import type { Reader, Writer } from "../stream";
|
|
3
|
+
import { type IetfVersion } from "./version";
|
|
4
4
|
export declare class TrackStatusRequest {
|
|
5
5
|
#private;
|
|
6
6
|
static id: number;
|
package/ietf/track.js
CHANGED
package/ietf/version.js
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,11 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MoQ networking layer for browsers: connect to a relay, then publish and consume
|
|
3
|
+
* broadcasts, tracks, groups, and frames over WebTransport (or a WebSocket fallback).
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
/** Re-export of {@link https://jsr.io/@moq/signals | @moq/signals}, the reactive primitives used throughout this package. */
|
|
1
8
|
export * as Signals from "@moq/signals";
|
|
2
|
-
export * from "./announced
|
|
3
|
-
export * from "./bandwidth
|
|
4
|
-
export * from "./broadcast
|
|
5
|
-
|
|
6
|
-
export * from "./
|
|
7
|
-
export *
|
|
8
|
-
|
|
9
|
-
export * from "./
|
|
10
|
-
|
|
9
|
+
export * from "./announced";
|
|
10
|
+
export * from "./bandwidth";
|
|
11
|
+
export * from "./broadcast";
|
|
12
|
+
/** Connection helpers: connect to or accept a MoQ session and reconnect on failure. */
|
|
13
|
+
export * as Connection from "./connection/index";
|
|
14
|
+
export * from "./group";
|
|
15
|
+
/** Broadcast path utilities with delimiter-aware prefix matching. */
|
|
16
|
+
export * as Path from "./path";
|
|
17
|
+
/** Branded time types (nanoseconds, microseconds, milliseconds, seconds) with conversions. */
|
|
18
|
+
export * as Time from "./time";
|
|
19
|
+
export * from "./track";
|
|
20
|
+
/** QUIC variable-length integer encoding and decoding. */
|
|
21
|
+
export * as Varint from "./varint";
|
|
11
22
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,6HAA6H;AAC7H,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,uFAAuF;AACvF,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,cAAc,YAAY,CAAC;AAC3B,qEAAqE;AACrE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,8FAA8F;AAC9F,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,0DAA0D;AAC1D,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/* @ts-self-types="./index.d.ts" */
|
|
2
|
+
/**
|
|
3
|
+
* MoQ networking layer for browsers: connect to a relay, then publish and consume
|
|
4
|
+
* broadcasts, tracks, groups, and frames over WebTransport (or a WebSocket fallback).
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
1
8
|
import * as Signals_1 from "@moq/signals";
|
|
2
9
|
export { Signals_1 as Signals };
|
|
3
10
|
export * from "./announced.js";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;2BAGsB,cAAc;sBAA3B,OAAO;AACnB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;8BAEH,uBAAuB;yBAAvC,UAAU;AACtB,cAAc,YAAY,CAAC;wBAEL,WAAW;mBAArB,IAAI;wBAEM,WAAW;mBAArB,IAAI;AAChB,cAAc,YAAY,CAAC;0BAEH,aAAa;qBAAzB,MAAM","sourcesContent":["/**\n * MoQ networking layer for browsers: connect to a relay, then publish and consume\n * broadcasts, tracks, groups, and frames over WebTransport (or a WebSocket fallback).\n *\n * @module\n */\n\n/** Re-export of {@link https://jsr.io/@moq/signals | @moq/signals}, the reactive primitives used throughout this package. */\nexport * as Signals from \"@moq/signals\";\nexport * from \"./announced.ts\";\nexport * from \"./bandwidth.ts\";\nexport * from \"./broadcast.ts\";\n/** Connection helpers: connect to or accept a MoQ session and reconnect on failure. */\nexport * as Connection from \"./connection/index.ts\";\nexport * from \"./group.ts\";\n/** Broadcast path utilities with delimiter-aware prefix matching. */\nexport * as Path from \"./path.ts\";\n/** Branded time types (nanoseconds, microseconds, milliseconds, seconds) with conversions. */\nexport * as Time from \"./time.ts\";\nexport * from \"./track.ts\";\n/** QUIC variable-length integer encoding and decoding. */\nexport * as Varint from \"./varint.ts\";\n"]}
|
package/integration.test.js
CHANGED
package/lite/announce.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as Path from "../path
|
|
2
|
-
import type { Reader, Writer } from "../stream
|
|
3
|
-
import { type Origin } from "./origin
|
|
4
|
-
import { Version } from "./version
|
|
1
|
+
import * as Path from "../path";
|
|
2
|
+
import type { Reader, Writer } from "../stream";
|
|
3
|
+
import { type Origin } from "./origin";
|
|
4
|
+
import { Version } from "./version";
|
|
5
5
|
export declare const MAX_HOPS = 32;
|
|
6
6
|
export declare class Announce {
|
|
7
7
|
#private;
|
package/lite/announce.js
CHANGED
package/lite/connection.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Signal } from "@moq/signals";
|
|
2
|
-
import type { Announced } from "../announced
|
|
3
|
-
import { type Bandwidth } from "../bandwidth
|
|
4
|
-
import type { Broadcast } from "../broadcast
|
|
5
|
-
import type { Established } from "../connection/established
|
|
6
|
-
import * as Path from "../path
|
|
7
|
-
import { Stream } from "../stream
|
|
8
|
-
import type * as Time from "../time
|
|
9
|
-
import { type Origin } from "./origin
|
|
10
|
-
import { Version } from "./version
|
|
2
|
+
import type { Announced } from "../announced";
|
|
3
|
+
import { type Bandwidth } from "../bandwidth";
|
|
4
|
+
import type { Broadcast } from "../broadcast";
|
|
5
|
+
import type { Established } from "../connection/established";
|
|
6
|
+
import * as Path from "../path";
|
|
7
|
+
import { Stream } from "../stream";
|
|
8
|
+
import type * as Time from "../time";
|
|
9
|
+
import { type Origin } from "./origin";
|
|
10
|
+
import { Version } from "./version";
|
|
11
11
|
/**
|
|
12
12
|
* Represents a connection to a MoQ server.
|
|
13
13
|
*
|
package/lite/connection.js
CHANGED
package/lite/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Path from "../path
|
|
2
|
-
import type { Reader, Writer } from "../stream
|
|
3
|
-
import { Version } from "./version
|
|
1
|
+
import * as Path from "../path";
|
|
2
|
+
import type { Reader, Writer } from "../stream";
|
|
3
|
+
import { Version } from "./version";
|
|
4
4
|
export declare class Fetch {
|
|
5
5
|
#private;
|
|
6
6
|
broadcast: Path.Valid;
|
package/lite/fetch.js
CHANGED
package/lite/goaway.d.ts
CHANGED
package/lite/goaway.js
CHANGED
package/lite/group.d.ts
CHANGED
package/lite/group.js
CHANGED
package/lite/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./announce
|
|
2
|
-
export * from "./connection
|
|
3
|
-
export * from "./fetch
|
|
4
|
-
export * from "./goaway
|
|
5
|
-
export * from "./group
|
|
6
|
-
export * from "./probe
|
|
7
|
-
export * from "./session
|
|
8
|
-
export * from "./stream
|
|
9
|
-
export * from "./subscribe
|
|
10
|
-
export * from "./version
|
|
1
|
+
export * from "./announce";
|
|
2
|
+
export * from "./connection";
|
|
3
|
+
export * from "./fetch";
|
|
4
|
+
export * from "./goaway";
|
|
5
|
+
export * from "./group";
|
|
6
|
+
export * from "./probe";
|
|
7
|
+
export * from "./session";
|
|
8
|
+
export * from "./stream";
|
|
9
|
+
export * from "./subscribe";
|
|
10
|
+
export * from "./version";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
package/lite/index.js
CHANGED
package/lite/message.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Reader, Writer } from "../stream
|
|
1
|
+
import { Reader, Writer } from "../stream";
|
|
2
2
|
export declare function encode(writer: Writer, f: (w: Writer) => Promise<void>): Promise<void>;
|
|
3
3
|
export declare function decode<T>(reader: Reader, f: (r: Reader) => Promise<T>): Promise<T>;
|
|
4
4
|
export declare function decodeMaybe<T>(reader: Reader, f: (r: Reader) => Promise<T>): Promise<T | undefined>;
|
package/lite/message.js
CHANGED
package/lite/origin.js
CHANGED
package/lite/probe.d.ts
CHANGED
package/lite/probe.js
CHANGED
package/lite/publisher.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { Broadcast } from "../broadcast
|
|
2
|
-
import * as Path from "../path
|
|
3
|
-
import { type Stream } from "../stream
|
|
4
|
-
import { type AnnounceInterest } from "./announce
|
|
5
|
-
import type { Origin } from "./origin
|
|
6
|
-
import { type Subscribe } from "./subscribe
|
|
7
|
-
import { Version } from "./version
|
|
1
|
+
import type { Broadcast } from "../broadcast";
|
|
2
|
+
import * as Path from "../path";
|
|
3
|
+
import { type Stream } from "../stream";
|
|
4
|
+
import { type AnnounceInterest } from "./announce";
|
|
5
|
+
import type { Origin } from "./origin";
|
|
6
|
+
import { type Subscribe } from "./subscribe";
|
|
7
|
+
import { Version } from "./version";
|
|
8
8
|
/**
|
|
9
9
|
* Handles publishing broadcasts and managing their lifecycle.
|
|
10
10
|
*
|
package/lite/publisher.js
CHANGED
package/lite/session.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Reader, Writer } from "../stream
|
|
2
|
-
import { Version } from "./version
|
|
1
|
+
import type { Reader, Writer } from "../stream";
|
|
2
|
+
import { Version } from "./version";
|
|
3
3
|
export declare class Extensions {
|
|
4
4
|
entries: Map<bigint, Uint8Array>;
|
|
5
5
|
constructor();
|
package/lite/session.js
CHANGED
package/lite/stream.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AnnounceInterest } from "./announce
|
|
2
|
-
import type { Goaway } from "./goaway
|
|
3
|
-
import type { Group } from "./group
|
|
4
|
-
import type { SessionClient } from "./session
|
|
5
|
-
import type { Subscribe } from "./subscribe
|
|
1
|
+
import type { AnnounceInterest } from "./announce";
|
|
2
|
+
import type { Goaway } from "./goaway";
|
|
3
|
+
import type { Group } from "./group";
|
|
4
|
+
import type { SessionClient } from "./session";
|
|
5
|
+
import type { Subscribe } from "./subscribe";
|
|
6
6
|
export type StreamBi = SessionClient | AnnounceInterest | Subscribe | Goaway;
|
|
7
7
|
export type StreamUni = Group;
|
|
8
8
|
export declare const StreamId: {
|
package/lite/stream.js
CHANGED
package/lite/subscribe.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Path from "../path
|
|
2
|
-
import type { Reader, Writer } from "../stream
|
|
3
|
-
import { Version } from "./version
|
|
1
|
+
import * as Path from "../path";
|
|
2
|
+
import type { Reader, Writer } from "../stream";
|
|
3
|
+
import { Version } from "./version";
|
|
4
4
|
export declare class SubscribeUpdate {
|
|
5
5
|
#private;
|
|
6
6
|
priority: number;
|
package/lite/subscribe.js
CHANGED
package/lite/subscriber.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Signal } from "@moq/signals";
|
|
2
|
-
import { Announced } from "../announced
|
|
3
|
-
import type { Bandwidth } from "../bandwidth
|
|
4
|
-
import { Broadcast } from "../broadcast
|
|
5
|
-
import * as Path from "../path
|
|
6
|
-
import { type Reader } from "../stream
|
|
7
|
-
import type * as Time from "../time
|
|
8
|
-
import type { Group as GroupMessage } from "./group
|
|
9
|
-
import type { Origin } from "./origin
|
|
10
|
-
import { Version } from "./version
|
|
2
|
+
import { Announced } from "../announced";
|
|
3
|
+
import type { Bandwidth } from "../bandwidth";
|
|
4
|
+
import { Broadcast } from "../broadcast";
|
|
5
|
+
import * as Path from "../path";
|
|
6
|
+
import { type Reader } from "../stream";
|
|
7
|
+
import type * as Time from "../time";
|
|
8
|
+
import type { Group as GroupMessage } from "./group";
|
|
9
|
+
import type { Origin } from "./origin";
|
|
10
|
+
import { Version } from "./version";
|
|
11
11
|
/**
|
|
12
12
|
* Options accepted by {@link Subscriber.announced}.
|
|
13
13
|
*/
|
package/lite/subscriber.js
CHANGED
package/lite/version.js
CHANGED
package/mock.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moq/net",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"description": "The networking layer for Media over QUIC: real-time pub/sub with built-in caching, fan-out, and prioritization.",
|
|
6
6
|
"license": "(MIT OR Apache-2.0)",
|
|
7
7
|
"repository": "github:moq-dev/moq",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@moq/qmux": "^0.0.6",
|
|
21
|
-
"@moq/signals": "^0.1.
|
|
21
|
+
"@moq/signals": "^0.1.9",
|
|
22
22
|
"async-mutex": "^0.5.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
package/path.d.ts
CHANGED
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
export type Valid = string & {
|
|
32
32
|
__brand: "Name";
|
|
33
33
|
};
|
|
34
|
+
/** Build a path from one or more components, joining with "/" and trimming redundant slashes. */
|
|
34
35
|
export declare function from(...paths: string[]): Valid;
|
|
35
36
|
/**
|
|
36
37
|
* Check if a path has the given prefix, respecting path boundaries.
|
|
@@ -83,5 +84,6 @@ export declare function stripPrefix(prefix: Valid, path: Valid): Valid | null;
|
|
|
83
84
|
* ```
|
|
84
85
|
*/
|
|
85
86
|
export declare function join(path: Valid, other: Valid): Valid;
|
|
87
|
+
/** The empty path, which is a prefix of every path. */
|
|
86
88
|
export declare function empty(): Valid;
|
|
87
89
|
//# sourceMappingURL=path.d.ts.map
|
package/path.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAI9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAgB7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAiBpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CASrD;AAED,wBAAgB,KAAK,IAAI,KAAK,CAE7B"}
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjD,iGAAiG;AACjG,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAI9C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAgB7D;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAiBpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,GAAG,KAAK,CASrD;AAED,uDAAuD;AACvD,wBAAgB,KAAK,IAAI,KAAK,CAE7B"}
|
package/path.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* @ts-self-types="./path.d.ts" */
|
|
2
|
+
/** Build a path from one or more components, joining with "/" and trimming redundant slashes. */
|
|
1
3
|
export function from(...paths) {
|
|
2
4
|
// Join paths with "/" and then remove leading and trailing slashes, and collapse multiple slashes into one.
|
|
3
5
|
const joined = paths.join("/");
|
|
@@ -92,6 +94,7 @@ export function join(path, other) {
|
|
|
92
94
|
return `${path}/${other}`;
|
|
93
95
|
}
|
|
94
96
|
}
|
|
97
|
+
/** The empty path, which is a prefix of every path. */
|
|
95
98
|
export function empty() {
|
|
96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CAAC;QACnC,OAAO,EAAW,CAAC;IACpB,CAAC;IAED,+EAA+E;IAC/E,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAU,CAAC;AAC/C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,IAAI,CAAC,IAAW,EAAE,KAAY;IAC7C,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACd,CAAC;SAAM,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;SAAM,CAAC;QACP,yDAAyD;QACzD,OAAO,GAAG,IAAI,IAAI,KAAK,EAAW,CAAC;IACpC,CAAC;AACF,CAAC;AAED,MAAM,UAAU,KAAK;IACpB,OAAO,EAAW,CAAC;AACpB,CAAC","sourcesContent":["/**\n * A broadcast path that provides safe prefix matching operations.\n *\n * This module provides path-aware operations that respect delimiter boundaries,\n * preventing issues like \"foo\" matching \"foobar\".\n *\n * Paths are automatically trimmed of leading and trailing slashes on creation,\n * making all slashes implicit at boundaries.\n * All paths are RELATIVE; you cannot join with a leading slash to make an absolute path.\n *\n * @example\n * ```typescript\n * // Creation automatically trims slashes\n * const path1 = Path.from(\"/foo/bar/\");\n * const path2 = Path.from(\"foo/bar\");\n * console.log(path1 === path2); // true\n *\n * // Multiple arguments are joined with \"/\"\n * const path3 = Path.from(\"api\", \"v1\", \"users\");\n * console.log(path3); // \"api/v1/users\"\n *\n * // Safe prefix matching\n * const base = Path.from(\"api/v1\");\n * console.log(Path.hasPrefix(Path.from(\"api\"), base)); // true\n * console.log(Path.hasPrefix(Path.from(\"api/v1\"), base)); // true\n *\n * const joined = Path.join(base, Path.from(\"users\"));\n * console.log(joined); // \"api/v1/users\"\n * ```\n */\nexport type Valid = string & { __brand: \"Name\" };\n\nexport function from(...paths: string[]): Valid {\n\t// Join paths with \"/\" and then remove leading and trailing slashes, and collapse multiple slashes into one.\n\tconst joined = paths.join(\"/\");\n\treturn joined.replace(/\\/+/g, \"/\").replace(/^\\/+/, \"\").replace(/\\/+$/, \"\") as Valid;\n}\n\n/**\n * Check if a path has the given prefix, respecting path boundaries.\n *\n * Unlike String.startsWith, this ensures that \"foo\" does not match \"foobar\".\n * The prefix must either:\n * - Be exactly equal to the path\n * - Be followed by a '/' delimiter in the original path\n * - Be empty (matches everything)\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path)); // true\n * console.log(Path.hasPrefix(Path.from(\"foo/\"), path)); // true (trailing slash ignored)\n * console.log(Path.hasPrefix(Path.from(\"fo\"), path)); // false\n *\n * const path2 = Path.from(\"foobar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path2)); // false\n * ```\n */\nexport function hasPrefix(prefix: Valid, path: Valid): boolean {\n\tif (prefix === \"\") {\n\t\treturn true;\n\t}\n\n\tif (!path.startsWith(prefix)) {\n\t\treturn false;\n\t}\n\n\t// Check if the prefix is the exact match\n\tif (path.length === prefix.length) {\n\t\treturn true;\n\t}\n\n\t// Otherwise, ensure the character after the prefix is a delimiter\n\treturn path[prefix.length] === \"/\";\n}\n\n/**\n * Strip the given prefix from a path, returning the suffix.\n *\n * Returns null if the prefix doesn't match according to hasPrefix rules.\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar/baz\");\n * const suffix = Path.stripPrefix(Path.from(\"foo\"), path);\n * console.log(suffix); // \"bar/baz\"\n *\n * const suffix2 = Path.stripPrefix(Path.from(\"foo/\"), path);\n * console.log(suffix2); // \"bar/baz\"\n *\n * const noMatch = Path.stripPrefix(Path.from(\"notfound\"), path);\n * console.log(noMatch); // null\n * ```\n */\nexport function stripPrefix(prefix: Valid, path: Valid): Valid | null {\n\tif (!hasPrefix(prefix, path)) {\n\t\treturn null;\n\t}\n\n\t// Handle empty prefix case\n\tif (prefix === \"\") {\n\t\treturn path;\n\t}\n\n\t// If prefix matches exactly, return empty\n\tif (path.length === prefix.length) {\n\t\treturn \"\" as Valid;\n\t}\n\n\t// For non-empty prefix that's shorter, skip the prefix and the following slash\n\treturn path.slice(prefix.length + 1) as Valid;\n}\n\n/**\n * Join two path components together.\n *\n * @example\n * ```typescript\n * const base = Path.from(\"foo\");\n * const joined = Path.join(base, Path.from(\"bar\"));\n * console.log(joined); // \"foo/bar\"\n * ```\n */\nexport function join(path: Valid, other: Valid): Valid {\n\tif (path === \"\") {\n\t\treturn other;\n\t} else if (other === \"\") {\n\t\treturn path;\n\t} else {\n\t\t// Since paths are trimmed, we always need to add a slash\n\t\treturn `${path}/${other}` as Valid;\n\t}\n}\n\nexport function empty(): Valid {\n\treturn \"\" as Valid;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"path.js","sourceRoot":"","sources":["../src/path.ts"],"names":[],"mappings":"AAgCA,iGAAiG;AACjG,MAAM,UAAU,IAAI,CAAC,GAAG,KAAe;IACtC,4GAA4G;IAC5G,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAU,CAAC;AACrF,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,SAAS,CAAC,MAAa,EAAE,IAAW;IACnD,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACd,CAAC;IAED,yCAAyC;IACzC,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,kEAAkE;IAClE,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,WAAW,CAAC,MAAa,EAAE,IAAW;IACrD,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,IAAI,CAAC;IACb,CAAC;IAED,2BAA2B;IAC3B,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,0CAA0C;IAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,OAAO,EAAW,CAAC;IACpB,CAAC;IAED,+EAA+E;IAC/E,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAU,CAAC;AAC/C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,IAAI,CAAC,IAAW,EAAE,KAAY;IAC7C,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;QACjB,OAAO,KAAK,CAAC;IACd,CAAC;SAAM,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACb,CAAC;SAAM,CAAC;QACP,yDAAyD;QACzD,OAAO,GAAG,IAAI,IAAI,KAAK,EAAW,CAAC;IACpC,CAAC;AACF,CAAC;AAED,uDAAuD;AACvD,MAAM,UAAU,KAAK;IACpB,OAAO,EAAW,CAAC;AACpB,CAAC","sourcesContent":["/**\n * A broadcast path that provides safe prefix matching operations.\n *\n * This module provides path-aware operations that respect delimiter boundaries,\n * preventing issues like \"foo\" matching \"foobar\".\n *\n * Paths are automatically trimmed of leading and trailing slashes on creation,\n * making all slashes implicit at boundaries.\n * All paths are RELATIVE; you cannot join with a leading slash to make an absolute path.\n *\n * @example\n * ```typescript\n * // Creation automatically trims slashes\n * const path1 = Path.from(\"/foo/bar/\");\n * const path2 = Path.from(\"foo/bar\");\n * console.log(path1 === path2); // true\n *\n * // Multiple arguments are joined with \"/\"\n * const path3 = Path.from(\"api\", \"v1\", \"users\");\n * console.log(path3); // \"api/v1/users\"\n *\n * // Safe prefix matching\n * const base = Path.from(\"api/v1\");\n * console.log(Path.hasPrefix(Path.from(\"api\"), base)); // true\n * console.log(Path.hasPrefix(Path.from(\"api/v1\"), base)); // true\n *\n * const joined = Path.join(base, Path.from(\"users\"));\n * console.log(joined); // \"api/v1/users\"\n * ```\n */\nexport type Valid = string & { __brand: \"Name\" };\n\n/** Build a path from one or more components, joining with \"/\" and trimming redundant slashes. */\nexport function from(...paths: string[]): Valid {\n\t// Join paths with \"/\" and then remove leading and trailing slashes, and collapse multiple slashes into one.\n\tconst joined = paths.join(\"/\");\n\treturn joined.replace(/\\/+/g, \"/\").replace(/^\\/+/, \"\").replace(/\\/+$/, \"\") as Valid;\n}\n\n/**\n * Check if a path has the given prefix, respecting path boundaries.\n *\n * Unlike String.startsWith, this ensures that \"foo\" does not match \"foobar\".\n * The prefix must either:\n * - Be exactly equal to the path\n * - Be followed by a '/' delimiter in the original path\n * - Be empty (matches everything)\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path)); // true\n * console.log(Path.hasPrefix(Path.from(\"foo/\"), path)); // true (trailing slash ignored)\n * console.log(Path.hasPrefix(Path.from(\"fo\"), path)); // false\n *\n * const path2 = Path.from(\"foobar\");\n * console.log(Path.hasPrefix(Path.from(\"foo\"), path2)); // false\n * ```\n */\nexport function hasPrefix(prefix: Valid, path: Valid): boolean {\n\tif (prefix === \"\") {\n\t\treturn true;\n\t}\n\n\tif (!path.startsWith(prefix)) {\n\t\treturn false;\n\t}\n\n\t// Check if the prefix is the exact match\n\tif (path.length === prefix.length) {\n\t\treturn true;\n\t}\n\n\t// Otherwise, ensure the character after the prefix is a delimiter\n\treturn path[prefix.length] === \"/\";\n}\n\n/**\n * Strip the given prefix from a path, returning the suffix.\n *\n * Returns null if the prefix doesn't match according to hasPrefix rules.\n *\n * @example\n * ```typescript\n * const path = Path.from(\"foo/bar/baz\");\n * const suffix = Path.stripPrefix(Path.from(\"foo\"), path);\n * console.log(suffix); // \"bar/baz\"\n *\n * const suffix2 = Path.stripPrefix(Path.from(\"foo/\"), path);\n * console.log(suffix2); // \"bar/baz\"\n *\n * const noMatch = Path.stripPrefix(Path.from(\"notfound\"), path);\n * console.log(noMatch); // null\n * ```\n */\nexport function stripPrefix(prefix: Valid, path: Valid): Valid | null {\n\tif (!hasPrefix(prefix, path)) {\n\t\treturn null;\n\t}\n\n\t// Handle empty prefix case\n\tif (prefix === \"\") {\n\t\treturn path;\n\t}\n\n\t// If prefix matches exactly, return empty\n\tif (path.length === prefix.length) {\n\t\treturn \"\" as Valid;\n\t}\n\n\t// For non-empty prefix that's shorter, skip the prefix and the following slash\n\treturn path.slice(prefix.length + 1) as Valid;\n}\n\n/**\n * Join two path components together.\n *\n * @example\n * ```typescript\n * const base = Path.from(\"foo\");\n * const joined = Path.join(base, Path.from(\"bar\"));\n * console.log(joined); // \"foo/bar\"\n * ```\n */\nexport function join(path: Valid, other: Valid): Valid {\n\tif (path === \"\") {\n\t\treturn other;\n\t} else if (other === \"\") {\n\t\treturn path;\n\t} else {\n\t\t// Since paths are trimmed, we always need to add a slash\n\t\treturn `${path}/${other}` as Valid;\n\t}\n}\n\n/** The empty path, which is a prefix of every path. */\nexport function empty(): Valid {\n\treturn \"\" as Valid;\n}\n"]}
|
package/path.test.js
CHANGED
package/stream.d.ts
CHANGED
package/stream.js
CHANGED
package/stream.test.js
CHANGED
package/time.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** A duration in nanoseconds, branded so it can't be mixed with other units. */
|
|
1
2
|
export type Nano = number & {
|
|
2
3
|
readonly _brand: "nano";
|
|
3
4
|
};
|
|
5
|
+
/** Constructors, conversions, and arithmetic for {@link Nano} values. */
|
|
4
6
|
export declare const Nano: {
|
|
5
7
|
readonly zero: Nano;
|
|
6
8
|
readonly fromMicro: (us: Micro) => Nano;
|
|
@@ -17,9 +19,11 @@ export declare const Nano: {
|
|
|
17
19
|
readonly max: (a: Nano, b: Nano) => Nano;
|
|
18
20
|
readonly min: (a: Nano, b: Nano) => Nano;
|
|
19
21
|
};
|
|
22
|
+
/** A duration in microseconds, branded so it can't be mixed with other units. */
|
|
20
23
|
export type Micro = number & {
|
|
21
24
|
readonly _brand: "micro";
|
|
22
25
|
};
|
|
26
|
+
/** Constructors, conversions, and arithmetic for {@link Micro} values. */
|
|
23
27
|
export declare const Micro: {
|
|
24
28
|
readonly zero: Micro;
|
|
25
29
|
readonly fromNano: (ns: Nano) => Micro;
|
|
@@ -36,9 +40,11 @@ export declare const Micro: {
|
|
|
36
40
|
readonly max: (a: Micro, b: Micro) => Micro;
|
|
37
41
|
readonly min: (a: Micro, b: Micro) => Micro;
|
|
38
42
|
};
|
|
43
|
+
/** A duration in milliseconds, branded so it can't be mixed with other units. */
|
|
39
44
|
export type Milli = number & {
|
|
40
45
|
readonly _brand: "milli";
|
|
41
46
|
};
|
|
47
|
+
/** Constructors, conversions, and arithmetic for {@link Milli} values. */
|
|
42
48
|
export declare const Milli: {
|
|
43
49
|
readonly zero: Milli;
|
|
44
50
|
readonly fromNano: (ns: Nano) => Milli;
|
|
@@ -55,9 +61,11 @@ export declare const Milli: {
|
|
|
55
61
|
readonly max: (a: Milli, b: Milli) => Milli;
|
|
56
62
|
readonly min: (a: Milli, b: Milli) => Milli;
|
|
57
63
|
};
|
|
64
|
+
/** A duration in seconds, branded so it can't be mixed with other units. */
|
|
58
65
|
export type Second = number & {
|
|
59
66
|
readonly _brand: "second";
|
|
60
67
|
};
|
|
68
|
+
/** Constructors, conversions, and arithmetic for {@link Second} values. */
|
|
61
69
|
export declare const Second: {
|
|
62
70
|
readonly zero: Second;
|
|
63
71
|
readonly fromNano: (ns: Nano) => Second;
|
package/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version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,KAAK;sBACL,KAAK,KAAK,KAAK,KAAG,KAAK;sBACvB,KAAK,KAAK,KAAK,KAAG,KAAK;sBACvB,KAAK,KAAK,MAAM,KAAG,KAAK;sBACxB,KAAK,KAAK,MAAM,KAAG,KAAK;sBACxB,KAAK,KAAK,KAAK,KAAG,KAAK;sBACvB,KAAK,KAAK,KAAK,KAAG,KAAK;CACvB,CAAC;AAEX,4EAA4E;AAC5E,MAAM,MAAM,MAAM,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE5D,2EAA2E;AAC3E,eAAO,MAAM,MAAM;mBACP,MAAM;4BACF,IAAI,KAAG,MAAM;6BACZ,KAAK,KAAG,MAAM;6BACd,KAAK,KAAG,MAAM;yBAClB,MAAM,KAAG,IAAI;0BACZ,MAAM,KAAG,KAAK;0BACd,MAAM,KAAG,KAAK;wBAClB,MAAM;sBACN,MAAM,KAAK,MAAM,KAAG,MAAM;sBAC1B,MAAM,KAAK,MAAM,KAAG,MAAM;sBAC1B,MAAM,KAAK,MAAM,KAAG,MAAM;sBAC1B,MAAM,KAAK,MAAM,KAAG,MAAM;sBAC1B,MAAM,KAAK,MAAM,KAAG,MAAM;sBAC1B,MAAM,KAAK,MAAM,KAAG,MAAM;CAC1B,CAAC"}
|
package/time.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* @ts-self-types="./time.d.ts" */
|
|
2
|
+
/** Constructors, conversions, and arithmetic for {@link Nano} values. */
|
|
1
3
|
export const Nano = {
|
|
2
4
|
zero: 0,
|
|
3
5
|
fromMicro: (us) => (us * 1_000),
|
|
@@ -14,6 +16,7 @@ export const Nano = {
|
|
|
14
16
|
max: (a, b) => Math.max(a, b),
|
|
15
17
|
min: (a, b) => Math.min(a, b),
|
|
16
18
|
};
|
|
19
|
+
/** Constructors, conversions, and arithmetic for {@link Micro} values. */
|
|
17
20
|
export const Micro = {
|
|
18
21
|
zero: 0,
|
|
19
22
|
fromNano: (ns) => (ns / 1_000),
|
|
@@ -30,6 +33,7 @@ export const Micro = {
|
|
|
30
33
|
max: (a, b) => Math.max(a, b),
|
|
31
34
|
min: (a, b) => Math.min(a, b),
|
|
32
35
|
};
|
|
36
|
+
/** Constructors, conversions, and arithmetic for {@link Milli} values. */
|
|
33
37
|
export const Milli = {
|
|
34
38
|
zero: 0,
|
|
35
39
|
fromNano: (ns) => (ns / 1_000_000),
|
|
@@ -46,6 +50,7 @@ export const Milli = {
|
|
|
46
50
|
max: (a, b) => Math.max(a, b),
|
|
47
51
|
min: (a, b) => Math.min(a, b),
|
|
48
52
|
};
|
|
53
|
+
/** Constructors, conversions, and arithmetic for {@link Second} values. */
|
|
49
54
|
export const Second = {
|
|
50
55
|
zero: 0,
|
|
51
56
|
fromNano: (ns) => (ns / 1_000_000_000),
|