function getNumberTypeAndValue(op) {
  switch (op.datatype) {
    case "counter":
      return [VALUE_TYPE.COUNTER, op.value]
    case "timestamp":
      return [VALUE_TYPE.TIMESTAMP, op.value]
    case "uint":
      return [VALUE_TYPE.LEB128_UINT, op.value]
    case "int":
      return [VALUE_TYPE.LEB128_INT, op.value]
    case "float64": {
      const buf64 = new ArrayBuffer(8),
        view64 = new DataView(buf64)
      view64.setFloat64(0, op.value, true)
      return [VALUE_TYPE.IEEE754, new Uint8Array(buf64)]
    }
    default:
      // increment operators get resolved here ...
      if (
        Number.isInteger(op.value) &&
        op.value <= Number.MAX_SAFE_INTEGER &&
        op.value >= Number.MIN_SAFE_INTEGER
      ) {
        return [VALUE_TYPE.LEB128_INT, op.value]
      } else {
        const buf64 = new ArrayBuffer(8),
          view64 = new DataView(buf64)
        view64.setFloat64(0, op.value, true)
        return [VALUE_TYPE.IEEE754, new Uint8Array(buf64)]
      }
  }
}
Given the datatype for a number, determine the typeTag and the value to encode
otherwise guess