zodvex 0.7.2-beta.0 → 0.7.2

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/dist/index.js CHANGED
@@ -818,6 +818,15 @@ function readMeta(target) {
818
818
  }
819
819
  return target[META_KEY];
820
820
  }
821
+ var CODEC_BRAND_KEY = "__zodvexCodecBrand";
822
+ function attachCodecBrand(target, brand) {
823
+ Object.defineProperty(target, CODEC_BRAND_KEY, {
824
+ value: brand,
825
+ enumerable: false,
826
+ writable: false,
827
+ configurable: false
828
+ });
829
+ }
821
830
 
822
831
  // src/public/codegen/extractCodec.ts
823
832
  function findCodec(schema) {
@@ -885,8 +894,10 @@ function id(tableName) {
885
894
  branded._tableName = tableName;
886
895
  return branded;
887
896
  }
888
- function codec(wire, runtime, transforms) {
889
- return zodvexCodec(wire, runtime, transforms);
897
+ function codec(wire, runtime, transforms, opts) {
898
+ const built = zodvexCodec(wire, runtime, transforms);
899
+ if (opts?.brand) attachCodecBrand(built, opts.brand);
900
+ return built;
890
901
  }
891
902
  function sharedWeakMap(name) {
892
903
  const key = /* @__PURE__ */ Symbol.for(`zodvex.zx.cache.${name}`);