src/back/models/attributes/AttributeDictionary.js
function concat(attributeDictionary, attribute) {
  expect(arguments).to.have.length(
    2,
    'Invalid arguments length when concatenating an AttributeDictionary (it ' +
    'has to be passed 2 arguments)'
  );

  expect(attributeDictionary).to.be.instanceof(
    AttributeDictionary,
    'Invalid argument "attributeDictionary" when concatenating an ' +
    'AttributeDictionary (it has to be an AttributeDictionary)'
  );

  expect(attribute).to.be.instanceof(
    Attribute,
    'Invalid argument "attribute" when concatenating an AttributeDictionary ' +
    '(it has to be an Attribute)'
  );

  var currentAttributes = [];

  for (var currentAttribute in attributeDictionary) {
    currentAttributes.push(attributeDictionary[currentAttribute]);
  }

  currentAttributes.push(attribute);

  return new AttributeDictionary(currentAttributes);
}
function concat(attributeDictionary, attribute) {
  expect(arguments).to.have.length(
    2,
    'Invalid arguments length when concatenating an AttributeDictionary (it ' +
    'has to be passed 2 arguments)'
  );

  expect(attributeDictionary).to.be.instanceof(
    AttributeDictionary,
    'Invalid argument "attributeDictionary" when concatenating an ' +
    'AttributeDictionary (it has to be an AttributeDictionary)'
  );

  expect(attribute).to.be.instanceof(
    Attribute,
    'Invalid argument "attribute" when concatenating an AttributeDictionary ' +
    '(it has to be an Attribute)'
  );

  var currentAttributes = [];

  for (var currentAttribute in attributeDictionary) {
    currentAttributes.push(attributeDictionary[currentAttribute]);
  }

  currentAttributes.push(attribute);

  return new AttributeDictionary(currentAttributes);
}
function concat ( attributeDictionary , attribute ) { expect ( arguments ) . to . have . length ( 2 , 'Invalid arguments length when concatenating an AttributeDictionary (it ' + 'has to be passed 2 arguments)' ) ; expect ( attributeDictionary ) . to . be . instanceof ( AttributeDictionary , 'Invalid argument "attributeDictionary" when concatenating an ' + 'AttributeDictionary (it has to be an AttributeDictionary)' ) ; expect ( attribute ) . to . be . instanceof ( Attribute , 'Invalid argument "attribute" when concatenating an AttributeDictionary ' + '(it has to be an Attribute)' ) ; var currentAttributes = [ ] ; for ( var currentAttribute in attributeDictionary ) { currentAttributes . push ( attributeDictionary [ currentAttribute ] ) ; } currentAttributes . push ( attribute ) ; return new AttributeDictionary ( currentAttributes ) ; }
Concatenates an AttributeDictionary instance with an Attribute instance and
returns a new AttributeDictionary.
@name module:back4app-entity/models/attributes.AttributeDictionary.concat
@function
@param {!module:back4app-entity/models/attributes.AttributeDictionary}
attributeDictionary The AttributeDictionary to be concatenated.
@param {!module:back4app-entity/models/attributes.Attribute} attribute
The Attribute to be concatenated.
@returns {module:back4app-entity/models/attributes.AttributeDictionary} The
new concatenated AttributeDictionary.
@example
var concatenatedAttributeDictionary = AttributeDictionary.concat(
attributeDictionary,
attribute
);
Concatenates an AttributeDictionary instance with an Attribute instance and returns a new AttributeDictionary .