# All files / src/emitter value_type.js

94.12% Statements 16/17
85.71% Branches 6/7
100% Functions 1/1
94.12% Lines 16/17

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    24x
    24x
    24x
    24x
    24x
    24x
    24x

    24x

    24x
    204x

    162x

    13x

    16x

    11x

    1x

    1x

     // @flow
    export const I32 = 0x7f;
    export const I64 = 0x7e;
    export const F32 = 0x7d;
    export const F64 = 0x7c;
    export const ANYFUNC = 0x70;
    export const FUNC = 0x60;
    export const BLOCK_TYPE = 0x40;

    export const stringToType = {
      i32: I32,
      i64: I64,
      f32: F32,
      f64: F64,
    };

    export const getTypeString = (type: number) => {
      switch (type) {
        case I32:
          return "i32";
        case I64:
          return "i64";
        case F32:
          return "f32";
        case F64:
          return "f64";
        case FUNC:
          return "func";
        case ANYFUNC:
          return "anyfunc";
        default:
          return "?";
      }
    };