@micham/iso8583
    Preparing search index...

    Function createFieldDefinition

    • Create a MessageDefinition object while coercing it's type

      Type Parameters

      Parameters

      • messageDef: MessageDefinition<FD>

        an object that define the fields of the ISO message. It's type will be used as the base to type the result of this function and provide type safety

      Returns {
          createNewMessage: (mti: number) => Message<FD>;
          fields: FD;
          mtiField: Field<number>;
          parse: (iso: Buffer) => Message<FD>;
          prepare: (message: Message<FD>) => Buffer<ArrayBufferLike>;
      }

      a strongly typed message definition

      const IsoDefinition = createFieldDefinition({"2": {name: "PAN", field: AN({length: 19})}});