lib/factory.js
function (Class, descriptors, staticDescriptors) {
    var castAll = Casting.forDescriptors(descriptors);
    function cast (value) {
      if (!(value instanceof this)) {
       return new this(castAll(value));
      }
      else {
        return castAll(value);
      }
    }

    cast.isAutoGenerated = true;
    return cast;
  }
function (Class, descriptors, staticDescriptors) {
    var castAll = Casting.forDescriptors(descriptors);
    function cast (value) {
      if (!(value instanceof this)) {
       return new this(castAll(value));
      }
      else {
        return castAll(value);
      }
    }

    cast.isAutoGenerated = true;
    return cast;
  }
function ( Class , descriptors , staticDescriptors ) { var castAll = Casting . forDescriptors ( descriptors ) ; function cast ( value ) { if ( ! ( value instanceof this ) ) { return new this ( castAll ( value ) ) ; } else { return castAll ( value ) ; } } cast . isAutoGenerated = true ; return cast ; }
Create a function which can cast objects to this class.

@param  {Function} Class             The class.
@param  {Object}   descriptors       The property descriptors.
@param  {Object}   staticDescriptors The static property descriptors.

@return {Function} The generated function.
Create a function which can cast objects to this class .