{"size": 2646, "ext": "js", "max_stars_repo_path": "node_modules/@lwc/engine/lib/framework/utils.js", "max_stars_repo_name": "muenzpraeger/github-actions-dx-test", "max_stars_repo_stars_event_min_datetime": "2019-11-21T20:01:11.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-22T09:23:19.000Z", "max_issues_repo_path": "node_modules/@lwc/engine/lib/framework/utils.js", "max_issues_repo_name": "muenzpraeger/github-actions-dx-test", "max_issues_repo_issues_event_min_datetime": "2021-05-08T12:05:23.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T12:05:23.000Z", "max_forks_repo_path": "node_modules/@lwc/engine/lib/framework/utils.js", "max_forks_repo_name": "muenzpraeger/github-actions-dx-test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 42.0, "max_line_length": 151, "alphanum_fraction": 0.7184429327}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*
 * Copyright (c) 2018, salesforce.com, inc.
 * All rights reserved.
 * SPDX-License-Identifier: MIT
 * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
 */
const language_1 = require("../shared/language");
const fields_1 = require("../shared/fields");
let nextTickCallbackQueue = [];
exports.SPACE_CHAR = 32;
exports.EmptyObject = language_1.seal(language_1.create(null));
exports.EmptyArray = language_1.seal([]);
exports.ViewModelReflection = fields_1.createFieldName('ViewModel');
function flushCallbackQueue() {
    if (process.env.NODE_ENV !== 'production') {
        if (nextTickCallbackQueue.length === 0) {
            throw new Error(`Internal Error: If callbackQueue is scheduled, it is because there must be at least one callback on this pending queue.`);
        }
    }
    const callbacks = nextTickCallbackQueue;
    nextTickCallbackQueue = []; // reset to a new queue
    for (let i = 0, len = callbacks.length; i < len; i += 1) {
        callbacks[i]();
    }
}
function addCallbackToNextTick(callback) {
    if (process.env.NODE_ENV !== 'production') {
        if (!language_1.isFunction(callback)) {
            throw new Error(`Internal Error: addCallbackToNextTick() can only accept a function callback`);
        }
    }
    if (nextTickCallbackQueue.length === 0) {
        Promise.resolve().then(flushCallbackQueue);
    }
    language_1.ArrayPush.call(nextTickCallbackQueue, callback);
}
exports.addCallbackToNextTick = addCallbackToNextTick;
function isCircularModuleDependency(value) {
    return language_1.hasOwnProperty.call(value, '__circular__');
}
exports.isCircularModuleDependency = isCircularModuleDependency;
/**
 * When LWC is used in the context of an Aura application, the compiler produces AMD
 * modules, that doesn't resolve properly circular dependencies between modules. In order
 * to circumvent this issue, the module loader returns a factory with a symbol attached
 * to it.
 *
 * This method returns the resolved value if it received a factory as argument. Otherwise
 * it returns the original value.
 */
function resolveCircularModuleDependency(fn) {
    if (process.env.NODE_ENV !== 'production') {
        if (!language_1.isFunction(fn)) {
            throw new TypeError(`Circular module dependency must be a function.`);
        }
    }
    return fn();
}
exports.resolveCircularModuleDependency = resolveCircularModuleDependency;
exports.useSyntheticShadow = language_1.hasOwnProperty.call(Element.prototype, '$shadowToken$');
//# sourceMappingURL=utils.js.map