src/AutoNumericOptions.js
function freezeOptions(options) {
    // Freeze each property objects
    Object.getOwnPropertyNames(options).forEach(optionName => {
        if (optionName === 'valuesToStrings') {
            const vsProps = Object.getOwnPropertyNames(options.valuesToStrings);
            vsProps.forEach(valuesToStringObjectName => {
                if (!AutoNumericHelper.isIE11() && options.valuesToStrings[valuesToStringObjectName] !== null) {
                    Object.freeze(options.valuesToStrings[valuesToStringObjectName]);
                }
            });
        } else if (optionName !== 'styleRules') {
            if (!AutoNumericHelper.isIE11() && options[optionName] !== null) {
                Object.freeze(options[optionName]);
            }
        }
    });

    // Then freeze the options object globally
    return Object.freeze(options);
}
function freezeOptions(options) {
    // Freeze each property objects
    Object.getOwnPropertyNames(options).forEach(optionName => {
        if (optionName === 'valuesToStrings') {
            const vsProps = Object.getOwnPropertyNames(options.valuesToStrings);
            vsProps.forEach(valuesToStringObjectName => {
                if (!AutoNumericHelper.isIE11() && options.valuesToStrings[valuesToStringObjectName] !== null) {
                    Object.freeze(options.valuesToStrings[valuesToStringObjectName]);
                }
            });
        } else if (optionName !== 'styleRules') {
            if (!AutoNumericHelper.isIE11() && options[optionName] !== null) {
                Object.freeze(options[optionName]);
            }
        }
    });

    // Then freeze the options object globally
    return Object.freeze(options);
}
function freezeOptions ( options ) { // Freeze each property objects Object . getOwnPropertyNames ( options ) . forEach ( optionName => { if ( optionName === 'valuesToStrings' ) { const vsProps = Object . getOwnPropertyNames ( options . valuesToStrings ) ; vsProps . forEach ( valuesToStringObjectName => { if ( ! AutoNumericHelper . isIE11 ( ) && options . valuesToStrings [ valuesToStringObjectName ] !== null ) { Object . freeze ( options . valuesToStrings [ valuesToStringObjectName ] ) ; } } ) ; } else if ( optionName !== 'styleRules' ) { if ( ! AutoNumericHelper . isIE11 ( ) && options [ optionName ] !== null ) { Object . freeze ( options [ optionName ] ) ; } } } ) ; // Then freeze the options object globally return Object . freeze ( options ) ; }
Simple function that will semi-deep freeze the `AutoNumeric.options` object.
By 'semi' it means the nested objects in the `styleRules` option are not frozen.
The ones in the `valuesToStrings` are though, since they are much more simple.

@param {object} options
@returns {ReadonlyArray<any>}
Simple function that will semi - deep freeze the AutoNumeric . options object . By semi it means the nested objects in the styleRules option are not frozen . The ones in the valuesToStrings are though since they are much more simple .