@webreflection/utils 0.2.9 → 0.2.10

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.
Files changed (2) hide show
  1. package/package.json +2 -1
  2. package/src/README.md +5 -0
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@webreflection/utils",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "type": "module",
5
5
  "types": {
6
6
  "./bound-once": "./types/bound-once.d.ts",
7
7
  "./bound": "./types/bound.d.ts",
8
8
  "./shared-array-buffer": "./types/shared-array-buffer.d.ts",
9
+ "./sticky": "./types/sticky.d.ts",
9
10
  "./with-resolvers": "./types/with-resolvers.d.ts"
10
11
  },
11
12
  "exports": {
package/src/README.md CHANGED
@@ -5,12 +5,14 @@ Each utility can be loaded from a *CDN* via either `https://esm.run/@webreflecti
5
5
 
6
6
  This document describes each utility separately.
7
7
 
8
+
8
9
  ## bound-once
9
10
 
10
11
  This is equivalent to **bound**, except each bound method is created only once. It is useful when bound method identity must be preserved across multiple calls.
11
12
 
12
13
  This variant uses **sticky** to ensure that weakly referenced targets always produce the same bound method within the same realm.
13
14
 
15
+
14
16
  ## bound
15
17
 
16
18
  This utility provides an object-destructuring syntax shortcut for binding methods.
@@ -33,6 +35,7 @@ This class can be used to simulate *SAB* capabilities.
33
35
 
34
36
  The module exports both `SharedArrayBuffer` and `native`. The `native` *boolean* indicates whether the returned constructor is the platform implementation or the shim.
35
37
 
38
+
36
39
  ## sticky
37
40
 
38
41
  Based on `Symbol.for(name)`, this utility helps modules that might be embedded multiple times across projects avoid conflicts in their internal logic. It preserves the assumption that a module is imported only *once* per application.
@@ -63,6 +66,8 @@ if (known) console.warn('embedded multiple times');
63
66
  export default module;
64
67
  ```
65
68
 
69
+ Because the sticky logic is intentionally simple, using a "*first come, first served*" global symbol lookup, avoid storing sensitive values there directly when secrecy or module-level isolation matters.
70
+
66
71
 
67
72
  ## with-resolvers
68
73