UNPKG

@aneoconsultingfr/armonik.api

Version:

gRPC API to interact with ArmoniK built for the web

107 lines (100 loc) 3.2 kB
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } var _chunkPZPR25ASjs = require('./chunk-PZPR25AS.js'); // src/generated/google/protobuf/duration.ts var _minimaljs = require('protobufjs/minimal.js'); var _minimaljs2 = _interopRequireDefault(_minimaljs); var protobufPackage = "google.protobuf"; function createBaseDuration() { return { seconds: 0, nanos: 0 }; } var Duration = { encode(message, writer = _minimaljs2.default.Writer.create()) { if (message.seconds !== 0) { writer.uint32(8).int64(message.seconds); } if (message.nanos !== 0) { writer.uint32(16).int32(message.nanos); } return writer; }, decode(input, length) { const reader = input instanceof _minimaljs2.default.Reader ? input : _minimaljs2.default.Reader.create(input); let end = length === void 0 ? reader.len : reader.pos + length; const message = createBaseDuration(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 8) { break; } message.seconds = longToNumber(reader.int64()); continue; case 2: if (tag !== 16) { break; } message.nanos = reader.int32(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { seconds: isSet(object.seconds) ? Number(object.seconds) : 0, nanos: isSet(object.nanos) ? Number(object.nanos) : 0 }; }, toJSON(message) { const obj = {}; if (message.seconds !== 0) { obj.seconds = Math.round(message.seconds); } if (message.nanos !== 0) { obj.nanos = Math.round(message.nanos); } return obj; }, create(base) { return Duration.fromPartial(_nullishCoalesce(base, () => ( {}))); }, fromPartial(object) { const message = createBaseDuration(); message.seconds = _nullishCoalesce(object.seconds, () => ( 0)); message.nanos = _nullishCoalesce(object.nanos, () => ( 0)); return message; } }; var tsProtoGlobalThis = (() => { if (typeof globalThis !== "undefined") { return globalThis; } if (typeof self !== "undefined") { return self; } if (typeof window !== "undefined") { return window; } if (typeof global !== "undefined") { return global; } throw "Unable to locate global object"; })(); function longToNumber(long) { if (long.gt(Number.MAX_SAFE_INTEGER)) { throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); } return long.toNumber(); } if (_minimaljs2.default.util.Long !== _chunkPZPR25ASjs.long_default) { _minimaljs2.default.util.Long = _chunkPZPR25ASjs.long_default; _minimaljs2.default.configure(); } function isSet(value) { return value !== null && value !== void 0; } exports.protobufPackage = protobufPackage; exports.Duration = Duration;