src/utilities.js
function argsByRules(argsArray, rules) {
  var params = rules || ['x', 'y', 'width', 'height'],
    args = {};

  for (var i = 0; i < argsArray.length; i++) {
    if (typeof(argsArray[i]) === "object")
      args["style"] = argsArray[i];
    else
    if (params.length)
      args[params.shift()] = argsArray[i];
  }

  args.style = normalizeStyle(args.style);

  if ((typeof(args.x) === 'string') && (typeof(args.y) === 'string'))
    args = smartCoordinates(args);

  return args;
}
function argsByRules(argsArray, rules) {
  var params = rules || ['x', 'y', 'width', 'height'],
    args = {};

  for (var i = 0; i < argsArray.length; i++) {
    if (typeof(argsArray[i]) === "object")
      args["style"] = argsArray[i];
    else
    if (params.length)
      args[params.shift()] = argsArray[i];
  }

  args.style = normalizeStyle(args.style);

  if ((typeof(args.x) === 'string') && (typeof(args.y) === 'string'))
    args = smartCoordinates(args);

  return args;
}
function argsByRules ( argsArray , rules ) { var params = rules || [ 'x' , 'y' , 'width' , 'height' ] , args = { } ; for ( var i = 0 ; i < argsArray . length ; i ++ ) { if ( typeof ( argsArray [ i ] ) === "object" ) args [ "style" ] = argsArray [ i ] ; else if ( params . length ) args [ params . shift ( ) ] = argsArray [ i ] ; } args . style = normalizeStyle ( args . style ) ; if ( ( typeof ( args . x ) === 'string' ) && ( typeof ( args . y ) === 'string' ) ) args = smartCoordinates ( args ) ; return args ; }
Filter arguments by rules
@param {Array} methods arguments
@param {Object} rules to apply
@returns {Object} arguments filtered
Filter arguments by rules