getDeep static method

dynamic getDeep(
  1. dynamic json, [
  2. dynamic f1,
  3. dynamic f2,
  4. dynamic f3,
])

Retrieves a

Implementation

static getDeep(json, [f1, f2, f3]) {
  var res = json;
  if (json == null) return null;

  for (var f in [if (f1 != null) f1, if (f2 != null) f2, if (f3 != null) f3]) {
    try {
      res = res?[f];
    } catch (e) {
      res = null;
    }
  }
  return res;
}