How to use the tslib.__importDefault function in tslib

To help you get started, we’ve selected a few tslib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MenloOne / block-overflow / build / services / TopicsService.js View on Github external
* you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an “AS IS” BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var web3_override_1 = tslib_1.__importDefault(require("./web3_override"));
var truffle_contract_1 = tslib_1.__importDefault(require("truffle-contract"));
var RemoteIPFSStorage_1 = tslib_1.__importDefault(require("../storage/RemoteIPFSStorage"));
var HashUtils_1 = tslib_1.__importDefault(require("../storage/HashUtils"));
var QPromise_1 = require("../utils/QPromise");
var MenloToken_json_1 = tslib_1.__importDefault(require("../build-contracts/MenloToken.json"));
var MenloTopics_json_1 = tslib_1.__importDefault(require("../build-contracts/MenloTopics.json"));
var MenloTopics_1 = require("../.contracts/MenloTopics");
var MenloToken_1 = require("../.contracts/MenloToken");
var Topic_1 = tslib_1.__importDefault(require("./Topic"));
var TOPIC_LENGTH = 15 * 60; /* 15 Minutes */
var TopicsService = /** @class */ (function () {
    function TopicsService() {
        var _this = this;
        this.topics = [];
        this.ready = QPromise_1.QPromise(function (resolve) { _this.signalReady = resolve; });
        this.synced = QPromise_1.QPromise(function (resolve) { _this.signalSynced = resolve; });
        this.remoteStorage = new RemoteIPFSStorage_1.default();
        this.account = null;
github loomnetwork / loom-js / dist / plasma-cash / db.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var debug_1 = tslib_1.__importDefault(require("debug"));
var lowdb_1 = tslib_1.__importDefault(require("lowdb"));
var plasma_cash_tx_1 = require("./plasma-cash-tx");
var bn_js_1 = tslib_1.__importDefault(require("bn.js"));
var fs_1 = tslib_1.__importDefault(require("fs"));
var path_1 = tslib_1.__importDefault(require("path"));
var debugLog = debug_1.default('plasma-cash:db');
var errorLog = debug_1.default('plasma-cash:db:error');
var PlasmaDB = /** @class */ (function () {
    function PlasmaDB(dbPath) {
        // TODO: the db path shouldn't be hardcoded
        // If we're on node.js
        var adapter;
        if (typeof localStorage === 'undefined' || localStorage === null) {
            var FileSync = require('lowdb/adapters/FileSync');
            var shelljs = require('shelljs');
            if (dbPath) {
github eserozvataf / immunity / dist / npm / __tests__ / removeKeyFromObject.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var removeKeyFromObject_1 = tslib_1.__importDefault(require("../removeKeyFromObject"));
describe('removeKeyFromObject', function () {
    test('basic', function () {
        var arr1 = { a: 1, b: 2, c: 3, d: 4, e: 5 };
        var val1 = 'b';
        var val2 = 'c';
        var result = removeKeyFromObject_1.default(arr1, val1, val2);
        expect(result).not.toBe(arr1);
        expect(Object.keys(result)).toHaveLength(3);
        expect(result).toEqual({ a: 1, d: 4, e: 5 });
    });
});
//# sourceMappingURL=removeKeyFromObject.js.map
github eserozvataf / immunity / dist / npm / __tests__ / prependToObject.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var prependToObject_1 = tslib_1.__importDefault(require("../prependToObject"));
describe('prependToObject', function () {
    test('basic', function () {
        var obj1 = { b: 2, c: 3 };
        var obj2 = { a: 1 };
        var result = prependToObject_1.default(obj1, obj2);
        expect(result).not.toBe(obj1);
        expect(result).not.toBe(obj2);
        expect(result).toEqual({ a: 1, b: 2, c: 3 });
    });
});
//# sourceMappingURL=prependToObject.js.map
github youzan / create-utils / packages / create-utils / lib / index.js View on Github external
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var commander_1 = tslib_1.__importDefault(require("commander"));
var chalk_1 = tslib_1.__importDefault(require("chalk"));
var create_1 = tslib_1.__importDefault(require("./cli/create"));
var packageJson = require('../package.json');
var projectName;
var program = commander_1.default
    .version(packageJson.version, '-v, --version')
    .arguments('')
    .usage(chalk_1.default.green('') + " [options]")
    .option('--js')
    .action(function (name) {
    projectName = name;
})
    .action(create_1.default)
    .parse(process.argv);
if (typeof projectName === 'undefined') {
    console.error('Please specify the project directory:');
github caioreis123 / market2 / backend2 / node_modules / apollo-link / lib / link.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var zen_observable_ts_1 = tslib_1.__importDefault(require("zen-observable-ts"));
var ts_invariant_1 = require("ts-invariant");
var linkUtils_1 = require("./linkUtils");
function passthrough(op, forward) {
    return forward ? forward(op) : zen_observable_ts_1.default.of();
}
function toLink(handler) {
    return typeof handler === 'function' ? new ApolloLink(handler) : handler;
}
function empty() {
    return new ApolloLink(function () { return zen_observable_ts_1.default.of(); });
}
exports.empty = empty;
function from(links) {
    if (links.length === 0)
        return empty();
    return links.map(toLink).reduce(function (x, y) { return x.concat(y); });
github PedroGao / lin-cms-koa-braver / packages / core / lib / file / index.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
/**
 * 文件上传相关
 * file_include,file_exclude,file_single_limit,file_total_limit,file_store_dir,siteDomain
 * id,path,type,name,extension,size,md5
 */
const uuid_1 = tslib_1.__importDefault(require("uuid"));
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
const path_1 = tslib_1.__importDefault(require("path"));
const crypto_1 = tslib_1.__importDefault(require("crypto"));
const fs_1 = tslib_1.__importDefault(require("fs"));
const config_1 = require("../config");
const utils_1 = require("../utils");
/**
 * 上传文件类,所有文件上传的基类
 */
class Uploader {
    constructor(storeDir) {
        this.storeDir = storeDir;
    }
    /**
     * 处理文件对象
     * { size, encoding, fieldname, filename, mimeType, data }
github neoclide / coc-tslint / lib / index.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const child_process_1 = require("child_process");
const coc_nvim_1 = require("coc.nvim");
const fs_1 = tslib_1.__importDefault(require("fs"));
const path_1 = tslib_1.__importDefault(require("path"));
const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
const vscode_uri_1 = tslib_1.__importDefault(require("vscode-uri"));
const which_1 = tslib_1.__importDefault(require("which"));
const errorRegex = /^(\w+):\s+([^\[]+)\[(\d+),\s*(\d+)\]:\s+(.*)$/;
var AllFixesRequest;
(function (AllFixesRequest) {
    AllFixesRequest.type = new vscode_languageserver_protocol_1.RequestType('textDocument/tslint/allFixes');
})(AllFixesRequest || (AllFixesRequest = {}));
var NoTSLintLibraryRequest;
(function (NoTSLintLibraryRequest) {
    NoTSLintLibraryRequest.type = new vscode_languageserver_protocol_1.RequestType('tslint/noLibrary');
})(NoTSLintLibraryRequest || (NoTSLintLibraryRequest = {}));
function activate(context) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        let { subscriptions, logger } = context;
        const config = coc_nvim_1.workspace.getConfiguration().get('tslint');
        const enable = config.enable;
        if (enable === false)
            return;
github seanpmaxwell / express-generator-typescript / sample-output / express-gen-ts / dist / Server.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const cookie_parser_1 = tslib_1.__importDefault(require("cookie-parser"));
const express_1 = tslib_1.__importDefault(require("express"));
const morgan_1 = tslib_1.__importDefault(require("morgan"));
const path_1 = tslib_1.__importDefault(require("path"));
const routes_1 = tslib_1.__importDefault(require("./routes"));
const app = express_1.default();
app.use(morgan_1.default('dev'));
app.use(express_1.default.json());
app.use(express_1.default.urlencoded({ extended: true }));
app.use(cookie_parser_1.default());
app.use(express_1.default.static(path_1.default.join(__dirname, 'public')));
app.use('/api', routes_1.default);
const viewsDir = path_1.default.join(__dirname, 'views');
app.set('views', viewsDir);
const staticDir = path_1.default.join(__dirname, 'public');
app.use(express_1.default.static(staticDir));
app.get('*', (req, res) => {
    res.sendFile('index.html', { root: viewsDir });
});
github baseprime / rest-resource / dist / related / index.js View on Github external
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var index_1 = tslib_1.__importDefault(require("../index"));
var lodash_1 = require("lodash");
var assert_1 = tslib_1.__importDefault(require("assert"));
var exceptions_1 = require("../exceptions");
var RelatedManager = /** @class */ (function () {
    function RelatedManager(to, value) {
        this.many = false;
        /**
         * Is `true` when `resolve()` is called and first page of results loads up to `this.batchSize` objects
         */
        this.resolved = false;
        /**
         * Deferred promises when `this.resolve()` hits the max requests in `this.batchSize`
         */
        this.deferred = [];
        /**
         * When sending `this.resolve()`, only send out the first `n` requests where `n` is `this.batchSize`. You