Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quizas

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quizas

A sort-of monad for reading values from objects

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
1
Weekly downloads
 
Created
Source

quizas

A sort-of Moand type thing for reading objects. Bascially a way to avoid doing a ton if if statements to check the data is the way you expect it to be before using it. Quizas will endevaour to do these checks for you and return something without errors.

Installation

npm i --save quizas

Usage

Get value

  quizas(obj, 'path.to.value').value;

Check if value exists

  quizas(obj, 'path.to.value').hasValue;

Grab nth item in array

As it's javascript you can just pass the index and it will magically just work

  quizas(obj, 'array.4.value').value;

Loop through array, grabbing the props you need

  quizas(obj, 'path.to.array').pluck('foo', 'bar', 'deeply.nested.property');

Loop through array, renaming the props to something better

  quizas(obj, 'path.to.array').pluck(['foo', 'name'], ['bar', 'email'], ['deeply.nested.property', 'flattened']);

FAQs

Package last updated on 21 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc