wenay-common2 1.0.50 → 1.0.52

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.
@@ -12,6 +12,7 @@ const SERVERS = new WeakMap();
12
12
  function createServer(socket, key, target, hooks, limits, auth, opt) {
13
13
  const lim = (0, rpc_limits_1.resolveLimits)(limits);
14
14
  const IS_RPC_PIPE = Symbol.for("isRpcPipe");
15
+ const hasRpcListen = (obj) => !!obj && typeof obj == "object" && Object.prototype.hasOwnProperty.call(obj, rpc_protocol_1.IS_RPC_LISTEN);
15
16
  function transformTree(obj) {
16
17
  let current = obj;
17
18
  if (hooks?.resolveTransform && !(0, rpc_dynamic_1.isNoStrict)(current)) {
@@ -20,7 +21,7 @@ function createServer(socket, key, target, hooks, limits, auth, opt) {
20
21
  if (current == null || typeof current != "object" || (0, rpc_dynamic_1.isNoStrict)(current))
21
22
  return current;
22
23
  const out = {};
23
- if (current[rpc_protocol_1.IS_RPC_LISTEN])
24
+ if (hasRpcListen(current))
24
25
  out[rpc_protocol_1.IS_RPC_LISTEN] = true;
25
26
  for (const k of Object.keys(current)) {
26
27
  if (!(0, rpc_limits_1.isSafeKey)(k))
@@ -82,7 +83,7 @@ function createServer(socket, key, target, hooks, limits, auth, opt) {
82
83
  cx.push(obj);
83
84
  }
84
85
  else if (v && typeof v == "object" && !(0, rpc_dynamic_1.isNoStrict)(v)) {
85
- if (v[rpc_protocol_1.IS_RPC_LISTEN])
86
+ if (hasRpcListen(v))
86
87
  lp.push(path);
87
88
  index(v, path);
88
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wenay-common2",
3
- "version": "1.0.50",
3
+ "version": "1.0.52",
4
4
  "description": "Common library",
5
5
  "strict": true,
6
6
  "main": "lib/index.js",