SkillAgentSearch skills...

At

Access nested keys in json objects without worrying about undefined / null errors.

Install / Use

/learn @varunpal/At
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

at

Access nested keys in json objects without worrying about undefined / null errors

Install

npm install v-at

Example

var at = require('v-at');

var object = {
  a: 10,
  b: "hello",
  c: [
    {y: 10}, {y: 20}, {y: 30}
  ],
  d: {
    e: 10,
    f: 20
  }
};

var y = at(object, 'c.0.y'); // 10

var f = at(object, 'd.f'); // 20

var undef = at(object, 'z.u.v'); //undefined
View on GitHub
GitHub Stars7
CategoryDevelopment
Updated6y ago
Forks1

Languages

JavaScript

Security Score

55/100

Audited on May 14, 2019

No findings