All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.util.debug.js Maven / Gradle / Ivy

The newest version!
// @flow
import {extend} from './util';
import window from './window';

/**
 * This is a private namespace for utility functions that will get automatically stripped
 * out in production builds.
 *
 * @private
 */
export const Debug = {
    extend(dest: Object, ...sources: Array): Object {
        return extend(dest, ...sources);
    },

    run(fn: () => any) {
        fn();
    },

    logToElement(message: string, overwrite: boolean = false, id: string = "log") {
        const el = window.document.getElementById(id);
        if (el) {
            if (overwrite) el.innerHTML = '';
            el.innerHTML += `
${message}`; } } };




© 2015 - 2024 Weber Informatics LLC | Privacy Policy