UNPKG

@xmtp/content-type-primitives

Version:

Primitives for building custom XMTP content types

3 lines (2 loc) 587 B
class t{authorityId;typeId;versionMajor;versionMinor;constructor(t){this.authorityId=t.authorityId,this.typeId=t.typeId,this.versionMajor=t.versionMajor,this.versionMinor=t.versionMinor}toString(){return`${this.authorityId}/${this.typeId}:${this.versionMajor}.${this.versionMinor}`}static fromString(r){const[i,o]=r.split(":"),[s,e]=i.split("/"),[n,h]=o.split(".");return new t({authorityId:s,typeId:e,versionMajor:Number(n),versionMinor:Number(h)})}sameAs(t){return this.authorityId===t.authorityId&&this.typeId===t.typeId}}export{t as ContentTypeId}; //# sourceMappingURL=index.js.map