Skip to main content
Module

x/cors_middleware/deps.ts>isNonNegativeInteger

HTTP cross-origin resource sharing(CORS) middleware
Latest
function isNonNegativeInteger
import { isNonNegativeInteger } from "https://deno.land/x/cors_middleware@1.0.0/deps.ts";

Whether the input is non negative integer or not.

Examples

Example 1

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

Parameters

input: number
  • Any number.

Returns

boolean