UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

16 lines (12 loc) 314 B
define(['../lang/toNumber'], function (toNumber) { /** * Get sign of the value. */ function sign(val) { var num = toNumber(val); if (num === 0) return num; // +0 and +0 === 0 if (isNaN(num)) return num; // NaN return num < 0? -1 : 1; } return sign; });