How to use the typechecker.isNumber function in typechecker

To help you get started, we’ve selected a few typechecker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bevry-archive / feedr / source / index.js View on Github external
static isFeedCacheStillRelevant(feed, metaData) {
		return (
			feed.cache && // User always wants to use cache
			(feed.cache === 'preferred' ||
				// If the cache === still relevant according to the website
				(metaData.expires && new Date() < new Date(metaData.expires)) ||
				// If the cache === still relevant according to the user
				(typeChecker.isNumber(feed.cache) &&
					metaData.date &&
					new Date() <
						new Date(new Date(metaData.date).getTime() + feed.cache)))
		)
	}

typechecker

Utilities to get and check variable types (isString, isPlainObject, isRegExp, etc)

Artistic-2.0
Latest version published 7 months ago

Package Health Score

70 / 100
Full package analysis