UNPKG

@dillonkearns/elm-graphql

Version:

<img src="https://cdn.jsdelivr.net/gh/martimatix/logo-graphqelm/logo.svg" alt="dillonearns/elm-graphql logo" width="40%" align="right">

11 lines (8 loc) 300 B
"use strict"; var isNatural = require("../number/is-natural") , toShortString = require("../to-short-string-representation"); module.exports = function (arg) { var num = Number(arg); if (!isNatural(num)) throw new TypeError(toShortString(arg) + " is not a natural number"); return num; };