@whisklabs/grpc
Version:
gRPC generator and http library for typescript
17 lines • 700 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.oneis = exports.oneof = void 0;
var typeguards_1 = require("@whisklabs/typeguards");
function oneof(base, key, fn) {
return (0, typeguards_1.isString)(key) && (0, typeguards_1.isObject)(base)
? base.oneof === key
? (0, typeguards_1.isFunction)(fn)
? fn(base.value)
: base.value
: undefined
: base === null || base === void 0 ? void 0 : base.value;
}
exports.oneof = oneof;
var oneis = function (base, key) { return ((0, typeguards_1.isObject)(base) ? base.oneof === key : false); };
exports.oneis = oneis;
//# sourceMappingURL=oneof.js.map