New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 - npm Package Compare versions

Comparing version 1.0.0-alpha2 to 1.0.0-alpha3

4

package.json
{
"name": "quizas",
"version": "1.0.0-alpha2",
"version": "1.0.0-alpha3",
"description": "A sort-of monad for reading values from objects",
"main": "index.js",
"main": "src/quizas",
"directories": {

@@ -7,0 +7,0 @@ "test": "test"

# quizas
A sort-of monad thing for reading objects
A sort-of [Moand](https://en.wikipedia.org/wiki/Monad_(functional_programming)) 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']);
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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