Skip to content

KeySplitter don't work for short parameter #119

@ludoo0d0a

Description

@ludoo0d0a

Using parameter like 'q' failed into the keysplitter. It falsy consider it as an array.

Here is a proposal for fix :

Backbone.Syphon.KeySplitter = function(key){
  var matches = key.match(/[^\[\]]+/g);

  //Hack for short parameter
  if (key.length>2 && key.indexOf("[]") === key.length - 2){
    lastKey = matches.pop();
    matches.push([lastKey]);
  }

  return matches;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions