@temporalio/proto 1.8.6 → 1.9.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.
@@ -53,11 +53,13 @@ type Type = Record<string, unknown>;
53
53
  type Namespace = { nested: Record<string, unknown> };
54
54
 
55
55
  function isType(value: unknown): value is Type {
56
- return isRecord(value) && value.constructor.name === 'Type';
56
+ // constructor.name may get mangled by minifiers; thanksfuly protobufjs also sets a constructor.className property
57
+ return isRecord(value) && (value.constructor as any).className === 'Type';
57
58
  }
58
59
 
59
60
  function isNamespace(value: unknown): value is Namespace {
60
- return isRecord(value) && value.constructor.name === 'Namespace';
61
+ // constructor.name may get mangled by minifiers; thanksfuly protobufjs also sets a constructor.className property
62
+ return isRecord(value) && (value.constructor as any).className === 'Namespace';
61
63
  }
62
64
 
63
65
  // Duplicate from type-helpers instead of importing in order to avoid circular dependency