🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

check-if

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

check-if

Input validation for Apollo Server.

0.0.5
Source
npm
Version published
Weekly downloads
3
-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

github license npm version

check-if

Input validation for Apollo Server.

Details

A collection of functions to validate the input received in Apollo GraphQL Server. When a validation fails the function throw one of Apollo Server's exceptions which are appropriately processed by Apollo Server. For more details on the errors see https://www.apollographql.com/docs/apollo-server/v2/features/errors.html.

Usage

Install module

npm install --save check-if

Sample

const checkIf = require('check-if')

// [your code here...]

// Throw UserInputError if it is not a valid date in ms.
checkIf.isValidDateInMs(value, argumentName)

Functions

FunctionsDescriptionException
isValidDateInMs(value, argumentName)Validates that:
- value is not Nil
- typeof value is number
- value can be parsed by new Date(value)
UserInputError

Keywords

firebase

FAQs

Package last updated on 09 Aug 2018

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