Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
8
increased by60%
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

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

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