Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var BaseInlineQuery = function (props, name) {
if (name === void 0) { name = 'Unknown'; }
return t.struct(Object.assign({}, {
type: t.String,
id: t.String,
reply_markup: t.maybe(k.InlineKeyboardMarkup),
input_message_content: t.maybe(exports.InputMessageContent)
}, props), name);
};
exports.InlineQueryResultCachedAudio = BaseInlineQuery({
'use strict';
var t = require('tcomb');
var Response = t.struct({
redirect: t.Func,
render: t.Func
}, 'Response');
module.exports = Response;
const BaseInlineQuery = function (props: any, name: string = 'Unknown') {
return t.struct(
Object.assign(
{},
{
type: t.String,
id: t.String,
reply_markup: t.maybe(k.InlineKeyboardMarkup),
input_message_content: t.maybe(InputMessageContent)
},
props),
name)
}
export interface BaseInlineQueryResult {
var t = require('tcomb');
var Rx = require('rx');
var ParallelEffect = t.struct({
effects: t.list(t.Any)
}, 'ParallelEffect');
ParallelEffect.prototype.toObservable = function(store) {
return Rx.Observable.merge(this.effects.map(function (effect) {
return effect.toObservable(store);
}));
};
module.exports = ParallelEffect;
var t = require('tcomb');
var Rx = require('rx');
var SequenceEffect = t.struct({
effects: t.list(t.Any)
}, 'SequenceEffect');
SequenceEffect.prototype.toObservable = function(store) {
return Rx.Observable.concat(this.effects.map(function (effect) {
return effect.toObservable(store);
}));
};
module.exports = SequenceEffect;
function getDeafultPatch(State) {
debug('using default `Patch` constructor');
return t.struct({
token: t.maybe(State),
spec: t.Obj
}, 'Patch');
}
export default function createTcombValidator(schemas) {
const rawSchema = {}
Object.keys(schemas).forEach(key => {
rawSchema[key] = schemas[key] || Obj
})
const schema = struct(rawSchema, 'State')
return function _validate(data) {
return formatErrors(validate(data, schema).errors)
}
}
'administrator',
'member',
'left',
'kicked'
])
})
export interface TcombChatMember {
user: TcombUser,
status: 'creator' |
'administrator' |
'member' |
'left' |
'kicked'
}
export const Chat = t.struct({
id: t.Number,
type: t.enums.of(['private', 'group', 'supergroup', 'channel']),
title: t.maybe(t.String),
username: t.maybe(t.String),
first_name: t.maybe(t.String),
last_name: t.maybe(t.String),
all_members_are_administrators: t.maybe(t.Boolean)
})
export interface TcombChat {
id: number
type: 'private' | 'group' | 'supergroup' | 'channel',
title?: string
username?: string
first_name?: string
last_name?: string,
all_members_are_administrators: boolean
function create(Model, Event, Effect, initialState) {
if (process.env.NODE_ENV !== 'production') {
t.assert(t.isType(Effect), function () {
return 'Invalid argument Effect ' + t.stringify(Effect) + ' supplied to create(Model, Event, Effect, initialState) (expected a type)';
});
}
var State = t.struct({
model: Model,
effect: t.maybe(Effect)
}, 'State');
var reducer = createReducer(State, Event);
var store = createStore(reducer, State(initialState));
store.types = {
State: State,
Model: Model,
Event: Event,
Effect: Effect
};
//
'use strict';
var t = require('tcomb');
var stringify = t.stringify;
var noobj = {};
var ValidationError = t.struct({
message: t.Any,
actual: t.Any,
expected: t.Any,
path: t.list(t.union([t.String, t.Number]))
}, 'ValidationError');
function getDefaultValidationErrorMessage(actual, expected, path) {
var expectedName = t.getTypeName(expected);
var to = path.length ? '/' + path.join('/') + ': ' + expectedName : expectedName;
return 'Invalid value ' + stringify(actual) + ' supplied to ' + to;
}
function getValidationErrorMessage(actual, expected, path, context) {
if (t.Function.is(expected.getValidationErrorMessage)) {
return expected.getValidationErrorMessage(actual, path, context);
}