UNPKG

@cerbos/embedded

Version:

Client library for interacting with embedded Cerbos policy decision points generated by Cerbos Hub from server-side Node.js and browser-based applications

29 lines 920 B
"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // source: google/protobuf/duration.proto Object.defineProperty(exports, "__esModule", { value: true }); exports.Duration = exports.protobufPackage = void 0; /* eslint-disable */ exports.protobufPackage = "google.protobuf"; exports.Duration = { fromJSON(object) { return { seconds: isSet(object.seconds) ? globalThis.Number(object.seconds) : 0, nanos: isSet(object.nanos) ? globalThis.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; }, }; function isSet(value) { return value !== null && value !== undefined; } //# sourceMappingURL=duration.js.map