hive/html/jquery/3rd/PapaParse-4.0.7/papaparse.js
// Replaces bad config values with good, default ones
Replaces bad config values with good, default ones
Replaces bad config values with good default ones
function copyAndValidateConfig(origConfig)
    {
        if (typeof origConfig !== 'object')
            origConfig = {};
        var config = copy(origConfig);
        if (typeof config.delimiter !== 'string'
            || config.delimiter.length != 1
            || Papa.BAD_DELIMITERS.indexOf(config.delimiter) > -1)
            config.delimiter = DEFAULTS.delimiter;
        if (config.newline != '\n'
            && config.newline != '\r'
            && config.newline != '\r\n')
            config.newline = DEFAULTS.newline;
        if (typeof config.header !== 'boolean')
            config.header = DEFAULTS.header;
        if (typeof config.dynamicTyping !== 'boolean')
            config.dynamicTyping = DEFAULTS.dynamicTyping;
        if (typeof config.preview !== 'number')
            config.preview = DEFAULTS.preview;
        if (typeof config.step !== 'function')
            config.step = DEFAULTS.step;
        if (typeof config.complete !== 'function')
            config.complete = DEFAULTS.complete;
        if (typeof config.error !== 'function')
            config.error = DEFAULTS.error;
        if (typeof config.encoding !== 'string')
            config.encoding = DEFAULTS.encoding;
        if (typeof config.worker !== 'boolean')
            config.worker = DEFAULTS.worker;
        if (typeof config.download !== 'boolean')
            config.download = DEFAULTS.download;
        if (typeof config.skipEmptyLines !== 'boolean')
            config.skipEmptyLines = DEFAULTS.skipEmptyLines;
        if (typeof config.fastMode !== 'boolean')
            config.fastMode = DEFAULTS.fastMode;
        return config;
    }
function copyAndValidateConfig ( origConfig ) { if ( typeof origConfig !== 'object' ) origConfig = { } ; var config = copy ( origConfig ) ; if ( typeof config . delimiter !== 'string' || config . delimiter . length != 1 || Papa . BAD_DELIMITERS . indexOf ( config . delimiter ) > - 1 ) config . delimiter = DEFAULTS . delimiter ; if ( config . newline != '\n' && config . newline != '\r' && config . newline != '\r\n' ) config . newline = DEFAULTS . newline ; if ( typeof config . header !== 'boolean' ) config . header = DEFAULTS . header ; if ( typeof config . dynamicTyping !== 'boolean' ) config . dynamicTyping = DEFAULTS . dynamicTyping ; if ( typeof config . preview !== 'number' ) config . preview = DEFAULTS . preview ; if ( typeof config . step !== 'function' ) config . step = DEFAULTS . step ; if ( typeof config . complete !== 'function' ) config . complete = DEFAULTS . complete ; if ( typeof config . error !== 'function' ) config . error = DEFAULTS . error ; if ( typeof config . encoding !== 'string' ) config . encoding = DEFAULTS . encoding ; if ( typeof config . worker !== 'boolean' ) config . worker = DEFAULTS . worker ; if ( typeof config . download !== 'boolean' ) config . download = DEFAULTS . download ; if ( typeof config . skipEmptyLines !== 'boolean' ) config . skipEmptyLines = DEFAULTS . skipEmptyLines ; if ( typeof config . fastMode !== 'boolean' ) config . fastMode = DEFAULTS . fastMode ; return config ; }
Replaces bad config values with good, default ones
Replaces bad config values with good default ones