@whisklabs/grpc
Version:
gRPC generator and http library for typescript
12 lines • 498 B
JavaScript
import { isFunction, isObject, isString } from '@whisklabs/typeguards';
export function oneof(base, key, fn) {
return isString(key) && isObject(base)
? base.oneof === key
? isFunction(fn)
? fn(base.value)
: base.value
: undefined
: base === null || base === void 0 ? void 0 : base.value;
}
export var oneis = function (base, key) { return (isObject(base) ? base.oneof === key : false); };
//# sourceMappingURL=oneof.js.map