# All files / src/emitter value_type.js

100% Statements 16/16
100% Branches 7/7
100% Functions 1/1
100% Lines 16/16

    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
    25x
    25x
    25x
    25x
    25x
    25x
    25x

    25x

    25x
    260x

    19x

    17x

    12x

    1x

    1x

    210x

     // @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 I64:
          return 'i64';
        case F32:
          return 'f32';
        case F64:
          return 'f64';
        case FUNC:
          return 'func';
        case ANYFUNC:
          return 'anyfunc';
        case I32:
        default:
          return 'i32';
      }
    };