T.property = function (type) { if (!T.Type.is(type)) { throw new TypeError('Incorrect `type` argument supplied to `property` combinator'); } var Property = function (property) { return T.Property(property).map(type); }; Property.meta = { kind: 'property', type: type }; Property.is = function (x) { return T.Property.is(x) && x.type === type; }; return Property; };
T.promise = function (type) { if (!T.Type.is(type)) { throw new TypeError('Incorrect `type` argument supplied to `promise` combinator'); } var Promise = function (promise) { return T.Promise(promise).then(type); }; Promise.meta = { kind: 'promise', type: type }; Promise.is = function (x) { return T.Promise.is(x) && x.type === type; }; return Promise; };
T.stream = function (type) { if (!T.Type.is(type)) { throw new TypeError('Incorrect `type` argument supplied to `stream` combinator'); } var Stream = function (stream) { return T.Stream(stream).map(type); }; Stream.meta = { kind: 'stream', type: type }; Stream.is = function (x) { return T.Stream.is(x) && x.type === type; }; return Stream; };