ensure-natural-number.js #1

  • //
  • guest/
  • jen_bottom/
  • ember/
  • tutorial/
  • testapp/
  • node_modules/
  • es5-ext/
  • object/
  • ensure-natural-number.js
  • View
  • Commits
  • Open Download .zip Download (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;
};
# Change User Description Committed
#1 23539 jenbottom Adding the basic code for ember test appk, created with 'ember new' command