bin/function.js
function TypedFunction (config) {
    const fn = this;

    if (config.hasOwnProperty('minArguments') && (!util.isInteger(config.minArguments) || config.minArguments < 0)) {
        const message = util.propertyErrorMessage('minArguments', config.minArguments, 'Expected a non-negative integer.');
        throw Error(message);
    }
    const min = config.hasOwnProperty('minArguments') ? config.minArguments : 0;

    if (config.hasOwnProperty('maxArguments') && (!util.isInteger(config.maxArguments) || config.maxArguments < min)) {
        const message = util.propertyErrorMessage('minArguments', config.maxArguments, 'Expected a integer greater than minArgument value of ' + min + '.');
        throw Error(message);
    }

    // define properties
    Object.defineProperties(fn, {

        maxArguments: {
            /**
             * @property
             * @name TypedString#maxArguments
             * @type {number}
             */
            value: config.maxArguments,
            writable: false
        },

        minArguments: {
            /**
             * @property
             * @name TypedString#minArguments
             * @type {number}
             */
            value: min,
            writable: false
        },

        named: {
            /**
             * @property
             * @name TypedString#strict
             * @type {boolean}
             */
            value: config.hasOwnProperty('named') ? !!config.named : false,
            writable: false
        }

    });

    return fn;
}
function TypedFunction (config) {
    const fn = this;

    if (config.hasOwnProperty('minArguments') && (!util.isInteger(config.minArguments) || config.minArguments < 0)) {
        const message = util.propertyErrorMessage('minArguments', config.minArguments, 'Expected a non-negative integer.');
        throw Error(message);
    }
    const min = config.hasOwnProperty('minArguments') ? config.minArguments : 0;

    if (config.hasOwnProperty('maxArguments') && (!util.isInteger(config.maxArguments) || config.maxArguments < min)) {
        const message = util.propertyErrorMessage('minArguments', config.maxArguments, 'Expected a integer greater than minArgument value of ' + min + '.');
        throw Error(message);
    }

    // define properties
    Object.defineProperties(fn, {

        maxArguments: {
            /**
             * @property
             * @name TypedString#maxArguments
             * @type {number}
             */
            value: config.maxArguments,
            writable: false
        },

        minArguments: {
            /**
             * @property
             * @name TypedString#minArguments
             * @type {number}
             */
            value: min,
            writable: false
        },

        named: {
            /**
             * @property
             * @name TypedString#strict
             * @type {boolean}
             */
            value: config.hasOwnProperty('named') ? !!config.named : false,
            writable: false
        }

    });

    return fn;
}
function TypedFunction ( config ) { const fn = this ; if ( config . hasOwnProperty ( 'minArguments' ) && ( ! util . isInteger ( config . minArguments ) || config . minArguments < 0 ) ) { const message = util . propertyErrorMessage ( 'minArguments' , config . minArguments , 'Expected a non-negative integer.' ) ; throw Error ( message ) ; } const min = config . hasOwnProperty ( 'minArguments' ) ? config . minArguments : 0 ; if ( config . hasOwnProperty ( 'maxArguments' ) && ( ! util . isInteger ( config . maxArguments ) || config . maxArguments < min ) ) { const message = util . propertyErrorMessage ( 'minArguments' , config . maxArguments , 'Expected a integer greater than minArgument value of ' + min + '.' ) ; throw Error ( message ) ; } // define properties Object . defineProperties ( fn , { maxArguments : { /**
             * @property
             * @name TypedString#maxArguments
             * @type {number}
             */ value : config . maxArguments , writable : false } , minArguments : { /**
             * @property
             * @name TypedString#minArguments
             * @type {number}
             */ value : min , writable : false } , named : { /**
             * @property
             * @name TypedString#strict
             * @type {boolean}
             */ value : config . hasOwnProperty ( 'named' ) ? ! ! config . named : false , writable : false } } ) ; return fn ; }
Create a TypedFunction instance.
@param {object} config
@returns {TypedFunction}
@augments Typed
@constructor
Create a TypedFunction instance .