Blockchain Commons Uniform Resources TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class URType

    Represents a UR (Uniform Resource) type identifier.

    Valid UR types contain only lowercase letters, digits, and hyphens.

    const urType = new URType('test');
    console.log(urType.string()); // "test"
    Index

    Constructors

    • Creates a new URType from the provided type string.

      Parameters

      • urType: string

        The UR type as a string

      Returns URType

      If the type contains invalid characters

      const urType = new URType('test');
      

    Methods

    • Returns the string representation of the URType.

      Returns string

      const urType = new URType('test');
      console.log(urType.string()); // "test"
    • Checks equality with another URType based on the type string.

      Parameters

      Returns boolean

    • Returns the string representation.

      Returns string

    • Creates a URType from a string, throwing an error if invalid.

      Parameters

      • value: string

        The UR type string

      Returns URType

      A new URType instance

      If the type is invalid