socket-function 0.32.0 → 0.34.0
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/SocketFunction.ts +11 -0
- package/package.json +2 -2
package/SocketFunction.ts
CHANGED
|
@@ -274,11 +274,22 @@ export class SocketFunction {
|
|
|
274
274
|
return url.toString();
|
|
275
275
|
}
|
|
276
276
|
|
|
277
|
+
private static ignoreExposeCount = 0;
|
|
278
|
+
public static async ignoreExposeCalls<T>(code: () => Promise<T>) {
|
|
279
|
+
this.ignoreExposeCount++;
|
|
280
|
+
try {
|
|
281
|
+
return await code();
|
|
282
|
+
} finally {
|
|
283
|
+
this.ignoreExposeCount--;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
277
287
|
/** Expose should be called before your mounting occurs. It mostly just exists to ensure you include the class type,
|
|
278
288
|
* so the class type's module construction runs, which should trigger register. Otherwise you would have
|
|
279
289
|
* to add additional imports to ensure the register call runs.
|
|
280
290
|
*/
|
|
281
291
|
public static expose(socketRegistered: SocketRegistered) {
|
|
292
|
+
if (this.ignoreExposeCount > 0) return;
|
|
282
293
|
if (!socketRegistered._classGuid) {
|
|
283
294
|
throw new Error("SocketFunction.expose must be called with a classGuid");
|
|
284
295
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "socket-function",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"node-forge": "https://github.com/sliftist/forge#name",
|
|
13
13
|
"pako": "^2.1.0",
|
|
14
14
|
"preact": "^10.10.6",
|
|
15
|
-
"typenode": "^5.
|
|
15
|
+
"typenode": "^5.6.0",
|
|
16
16
|
"ws": "^8.17.1"
|
|
17
17
|
},
|
|
18
18
|
"scripts": {
|