Fitbit/enhanced-properties-loader

View on GitHub
src/getOptions.js

Summary

Maintainability
A
0 mins
Test Coverage
import {
    defaultsDeep
} from 'lodash';
import {
    getOptions
} from 'loader-utils';

/**
 * @private
 * @type {Object}
 */
const DEFAULT_OPTIONS = {
    namespaces: true,
    variables: true
};

/**
 * @param {*} loaderContext
 * @returns {Object}
 */
export default loaderContext => {
    const options = getOptions(loaderContext) || {};

    return defaultsDeep(options, DEFAULT_OPTIONS);
};