PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@celo/utils/lib

Просмотр файла: io.js

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AttestationServiceStatusResponseType = exports.SaltType = exports.SignatureType = exports.PublicKeyType = exports.AddressType = exports.JSONStringType = exports.UrlType = exports.URL_REGEX = exports.isValidUrl = void 0;
var io_1 = require("@celo/base/lib/io");
var ethereumjs_util_1 = require("ethereumjs-util");
var Either_1 = require("fp-ts/lib/Either");
var t = __importStar(require("io-ts"));
var address_1 = require("./address");
// Exports moved to @celo/base, forwarding them
// here for backwards compatibility
var io_2 = require("@celo/base/lib/io");
Object.defineProperty(exports, "isValidUrl", { enumerable: true, get: function () { return io_2.isValidUrl; } });
Object.defineProperty(exports, "URL_REGEX", { enumerable: true, get: function () { return io_2.URL_REGEX; } });
exports.UrlType = new t.Type('Url', t.string.is, function (input, context) {
    return Either_1.either.chain(t.string.validate(input, context), function (stringValue) {
        return io_1.URL_REGEX.test(stringValue)
            ? t.success(stringValue)
            : t.failure(stringValue, context, 'is not a valid url');
    });
}, String);
exports.JSONStringType = new t.Type('JSONString', t.string.is, function (input, context) {
    return Either_1.either.chain(t.string.validate(input, context), function (stringValue) {
        try {
            JSON.parse(stringValue);
            return t.success(stringValue);
        }
        catch (error) {
            return t.failure(stringValue, context, 'can not be parsed as JSON');
        }
    });
}, String);
exports.AddressType = new t.Type('Address', t.string.is, function (input, context) {
    return Either_1.either.chain(t.string.validate(input, context), function (stringValue) {
        return (0, address_1.isValidAddress)(stringValue)
            ? t.success((0, ethereumjs_util_1.toChecksumAddress)(stringValue))
            : t.failure(stringValue, context, 'is not a valid address');
    });
}, String);
exports.PublicKeyType = new t.Type('Public Key', t.string.is, function (input, context) {
    return Either_1.either.chain(t.string.validate(input, context), function (stringValue) {
        return stringValue.startsWith('0x') && (0, ethereumjs_util_1.isValidPublic)(Buffer.from(stringValue.slice(2), 'hex'), true)
            ? t.success((0, ethereumjs_util_1.toChecksumAddress)(stringValue))
            : t.failure(stringValue, context, 'is not a valid public key');
    });
}, String);
exports.SignatureType = t.string;
exports.SaltType = t.string;
exports.AttestationServiceStatusResponseType = t.type({
    status: t.literal('ok'),
    smsProviders: t.array(t.string),
    blacklistedRegionCodes: t.union([t.array(t.string), t.undefined]),
    accountAddress: exports.AddressType,
    signature: t.union([exports.SignatureType, t.undefined]),
    version: t.string,
    latestBlock: t.number,
    ageOfLatestBlock: t.number,
    isNodeSyncing: t.boolean,
    appSignature: t.string,
    smsProvidersRandomized: t.boolean,
    maxDeliveryAttempts: t.number,
    maxRerequestMins: t.number,
    twilioVerifySidProvided: t.boolean,
});
//# sourceMappingURL=io.js.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!