/jsonselect

Searches arbitrary JSON for a key and returns an array of all matches.

Primary LanguageCoffeeScript

jsonSelect

Created by Andriy Bazyuta.

Way to find a particular key's value in a JSON

Usage

HTML

data =
  a: "One"
  b:
    d: "Two"
    a: [
      a: "Tree"
    ,
      c: "Four"
     ]

Call

$.jsonSelect(data, "a");

Return

["One", "Tree", [Object { a="Tree"}, Object { c="Four"}]]

Dependencies

CoffeeScript for compilation to .js