Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/hsts_parser/deps.ts>isNonNegativeInteger

HTTP Strict Transport Security(HSTS) header field parser
Latest
function isNonNegativeInteger
import { isNonNegativeInteger } from "https://deno.land/x/hsts_parser@1.0.0-beta.1/deps.ts";

Whether the value is non negative integer or not.

Examples

Example 1

import { isNonNegativeInteger } from "https://deno.land/x/isx@$VERSION/mod.ts"
import { assertEquals } from "https://deno.land/std@$VERSION/testing/asserts.ts"
assertEquals(isNonNegativeInteger(0), true)
assertEquals(isNonNegativeInteger(1.0), true)
assertEquals(isNonNegativeInteger(-1), false)

Parameters

value: number
  • Any number.

Returns

boolean