docs: function encodeEnum(enumDefinition) {
      /**
       * Takes in a string value and using the provided enum definition encodes it as a `sInt` stored in a [ByteBuffer]{@link https://www.npmjs.com/package/bytebuffer} object for use with the protobufjs library.
       * @param value - The value to encode.
       * @throws {Error} If the provided value was not found in the enum definition
       * @return {ByteBuffer|void}
       */
      return function encodeValueBasedOnEnum(value) {
          let buffer = new ByteBuffer();
          if (value === null) {
              return buffer;
          }
          let foundEnumVal;
          Object.keys(enumDefinition).some(function(key) {
              let enumValue = enumDefinition[key].toLowerCase();
              if (enumValue === value.toLowerCase()) {
                  foundEnumVal = Number(key);
                  return true;
              }
              return false;
          });
          if (!Number.isInteger(foundEnumVal)) {
              throw Error(
                  `Invalid enum value ${value}, should have been one of ${JSON.stringify(
                      enumDefinition
                  )}`
              );
          }
          return encodeSInt32(foundEnumVal);
      };
  }