docs: function resolve() {
    expect(arguments).to.have.length.within(
      1,
      4,
      'Invalid arguments length when resolving an Attribute (it has to be ' +
      'passed from 1 to 4 arguments)'
    );
  
    var argumentArray = Array.prototype.slice.call(arguments);
    var TypedAttribute = attributes.types.ObjectAttribute;
  
    if (arguments.length === 1 && typeof arguments[0] !== 'string') {
      var attribute = objects.copy(arguments[0]);
      argumentArray[0] = attribute;
  
      expect(attribute).to.be.an(
        'object',
        'Invalid argument type when resolving an Attribute (it has to be an ' +
        'object)'
      );
  
      if (attribute.type) {
        expect(attribute.type).to.be.a(
          'string',
          'Invalid argument "type" when resolving an Attribute' +
          (attribute.name ? ' called' + attribute.name : '') +
          ' (it has to be a string)'
        );
  
        try {
          TypedAttribute = attributes.types.get(attribute.type);
        } catch (e) {
          if (e instanceof errors.AttributeTypeNotFoundError) {
            TypedAttribute = attributes.types.AssociationAttribute;
            attribute.entity = attribute.type;
          } else {
            throw e;
          }
        }
  
        delete attribute.type;
      }
    } else {
      if (arguments.length > 1) {
        expect(arguments[1]).to.be.a(
          'string',
          'Invalid argument "type" when resolving an Attribute' +
          (arguments[0] ? ' called' + arguments[0] : '') +
          ' (it has to be a string)'
        );
  
        try {
          TypedAttribute = attributes.types.get(arguments[1]);
        } catch (e) {
          if (e instanceof errors.AttributeTypeNotFoundError) {
            TypedAttribute = attributes.types.AssociationAttribute;
            argumentArray.splice(2, 0, arguments[1]);
          } else {
            throw e;
          }
        }
  
        argumentArray.splice(1,1);
      }
    }
  
    return new (Function.prototype.bind.apply(
      TypedAttribute,
      [null].concat(argumentArray)
    ))();
  }