@standardserver/shared 0.0.15 → 0.0.16

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/README.md ADDED
@@ -0,0 +1,25 @@
1
+ # @standardserver/shared
2
+
3
+ <div align="center">
4
+ <a href="https://codecov.io/gh/middleapi/standardserver">
5
+ <img alt="codecov" src="https://codecov.io/gh/middleapi/standardserver/branch/main/graph/badge.svg">
6
+ </a>
7
+ <a href="https://www.npmjs.com/package/@standardserver/shared">
8
+ <img alt="weekly downloads" src="https://img.shields.io/npm/dw/%40standardserver%2Fshared?logo=npm" />
9
+ </a>
10
+ <a href="https://github.com/middleapi/standardserver/blob/main/LICENSE">
11
+ <img alt="MIT License" src="https://img.shields.io/github/license/middleapi/standardserver?logo=open-source-initiative" />
12
+ </a>
13
+ <a href="https://discord.gg/TXEbwRBvQn">
14
+ <img alt="Discord" src="https://img.shields.io/discord/1308966753044398161?color=7389D8&label&logo=discord&logoColor=ffffff" />
15
+ </a>
16
+ <a href="https://deepwiki.com/middleapi/standardserver">
17
+ <img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki">
18
+ </a>
19
+ </div>
20
+
21
+ This package contains shared types and utilities for the `@standardserver` ecosystem. It has no runtime dependencies and can be used in any JavaScript environment.
22
+
23
+ ## Learn more
24
+
25
+ For the higher-level project overview, see the root [Standard Server README](../../README.md).
package/dist/index.d.mts CHANGED
@@ -1,17 +1,5 @@
1
1
  declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]);
2
2
 
3
- declare const PACKAGE_NAME = "@standardserver/shared";
4
- declare const PACKAGE_VERSION = "0.0.15";
5
- /**
6
- * Generates a unique symbol for the specified name within the package scope.
7
- * The symbol is globally registered using `Symbol.for` to ensure consistency across modules.
8
- *
9
- * @remarks
10
- * - Ensure names are unique to avoid symbol collisions within the package.
11
- * - Ensure package versions are synchronized (e.g., when the core package is updated, this package should also be updated).
12
- */
13
- declare function getPackageSymbol(name: string): symbol;
14
-
15
3
  /**
16
4
  * Error thrown when an operation is aborted.
17
5
  * Uses the standardized 'AbortError' name for consistency with JavaScript APIs.
@@ -133,5 +121,5 @@ declare function sleep(ms: number, { signal }?: SleepOptions): Promise<void>;
133
121
 
134
122
  declare function tryDecodeURIComponent(value: string): string;
135
123
 
136
- export { AbortError, AsyncIteratorClass, PACKAGE_NAME, PACKAGE_VERSION, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, getPackageSymbol, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
124
+ export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
137
125
  export type { AsyncCleanupFn, AsyncIteratorClassNextFn, GetOrBindOptions, SleepOptions };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,5 @@
1
1
  declare function toArray<T>(value: T): T extends readonly any[] ? T : (T extends undefined | null ? never : T[]);
2
2
 
3
- declare const PACKAGE_NAME = "@standardserver/shared";
4
- declare const PACKAGE_VERSION = "0.0.15";
5
- /**
6
- * Generates a unique symbol for the specified name within the package scope.
7
- * The symbol is globally registered using `Symbol.for` to ensure consistency across modules.
8
- *
9
- * @remarks
10
- * - Ensure names are unique to avoid symbol collisions within the package.
11
- * - Ensure package versions are synchronized (e.g., when the core package is updated, this package should also be updated).
12
- */
13
- declare function getPackageSymbol(name: string): symbol;
14
-
15
3
  /**
16
4
  * Error thrown when an operation is aborted.
17
5
  * Uses the standardized 'AbortError' name for consistency with JavaScript APIs.
@@ -133,5 +121,5 @@ declare function sleep(ms: number, { signal }?: SleepOptions): Promise<void>;
133
121
 
134
122
  declare function tryDecodeURIComponent(value: string): string;
135
123
 
136
- export { AbortError, AsyncIteratorClass, PACKAGE_NAME, PACKAGE_VERSION, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, getPackageSymbol, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
124
+ export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
137
125
  export type { AsyncCleanupFn, AsyncIteratorClassNextFn, GetOrBindOptions, SleepOptions };
package/dist/index.mjs CHANGED
@@ -2,12 +2,6 @@ function toArray(value) {
2
2
  return Array.isArray(value) ? value : value === void 0 || value === null ? [] : [value];
3
3
  }
4
4
 
5
- const PACKAGE_NAME = "@standardserver/shared";
6
- const PACKAGE_VERSION = "0.0.15";
7
- function getPackageSymbol(name) {
8
- return Symbol.for(`${PACKAGE_NAME}@${PACKAGE_VERSION}/${name}`);
9
- }
10
-
11
5
  class AbortError extends Error {
12
6
  constructor(...rest) {
13
7
  super(...rest);
@@ -240,4 +234,4 @@ function tryDecodeURIComponent(value) {
240
234
  }
241
235
  }
242
236
 
243
- export { AbortError, AsyncIteratorClass, PACKAGE_NAME, PACKAGE_VERSION, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, getPackageSymbol, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
237
+ export { AbortError, AsyncIteratorClass, Queue, SequentialIdGenerator, emitUnhandledRejection, getOrBind, isAsyncIteratorObject, isTypescriptObject, omit, parseEmptyableJSON, sequential, sleep, stringifyJSON, toArray, tryDecodeURIComponent };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@standardserver/shared",
3
3
  "type": "module",
4
- "version": "0.0.15",
4
+ "version": "0.0.16",
5
5
  "license": "MIT",
6
6
  "homepage": "https://standardserver.dev",
7
7
  "repository": {
@@ -11,6 +11,7 @@
11
11
  },
12
12
  "sideEffects": false,
13
13
  "exports": {
14
+ "./package.json": "./package.json",
14
15
  ".": {
15
16
  "types": "./dist/index.d.mts",
16
17
  "import": "./dist/index.mjs",