Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
encrypted_brainkey: maybe(Str),
brainkey_pubkey: Str,
brainkey_sequence: Num,
brainkey_backup_date: maybe(Dat),
deposit_keys: maybe(Obj),
// password_checksum: Str,
chain_id: Str
},
"WalletTcomb"
);
let PrivateKeyTcomb = struct(
{
id: maybe(Num),
pubkey: Str,
label: maybe(Str),
import_account_names: maybe(Arr),
brainkey_sequence: maybe(Num),
encrypted_key: Str
},
"PrivateKeyTcomb"
);
export {WalletTcomb, PrivateKeyTcomb};
test('maybe', function (assert) {
assert.plan(1);
var expected = {
kind: 'irreducible',
required: false,
name: 'String',
predicate: t.String.meta.predicate
};
var actual = toObject(t.maybe(t.String));
assert.deepEqual(actual, expected);
});
function foo(x: ?tc.String) {
tc.assert(tc.maybe(tc.String).is(x), 'Invalid argument x (expected a ' + tc.getTypeName(tc.maybe(tc.String)) + ')');
return x || 'Empty';
}
const Tc = require('tcomb')
const Thing = Tc.struct({
name: Tc.String,
description: Tc.maybe(Tc.String),
}, 'Thing')
const Things = Tc.list(Thing, 'Things')
module.exports = {
Resource: Things
}
var t = require('tcomb');
var Type = t.irreducible('Type', t.isType);
var ActionDictionary = t.dict(t.String, Type);
var ActionStruct = t.subtype(t.Object, function (x) {
return t.String.is(x.type);
});
var Name = t.maybe(t.String);
function values(actions) {
return Object.keys(actions).map(function (type) {
return actions[type];
});
}
function createUnion(actions, name) {
if (process.env.NODE_ENV !== 'production') {
t.assert(ActionDictionary.is(actions), function () { return 'Invalid argument action ' + t.stringify(actions) + ' supplied to createUnion(actions, name) function (expected a dictionary String -> Type)'; });
t.assert(Name.is(name), function () { return 'Invalid argument name ' + t.stringify(name) + ' supplied to createUnion(actions, name) function (expected a string)'; });
}
name = name || 'Action';
object: function(s) {
var props = {};
var hasProperties = false;
var required = {};
if (s.required) {
s.required.forEach(function(k) {
required[k] = true;
});
}
for (var k in s.properties) {
if (s.properties.hasOwnProperty(k)) {
hasProperties = true;
var type = transform(s.properties[k]);
props[k] = required[k] || type === t.Boolean ? type : t.maybe(type);
}
}
return hasProperties ? t.struct(props, s.description) : t.Object;
},
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;