Mercurial > pub > ImplabJs
comparison src/implab/safe.js @ 19:8332e287d552
fix (click on cospas)
author | nickolay |
---|---|
date | Wed, 04 Oct 2017 21:05:21 +0300 |
parents | 3d4abbce4afc |
children | 8af8e840dd49 |
comparison
equal
deleted
inserted
replaced
17:9c21e656cbec | 19:8332e287d552 |
---|---|
34 return (arg === null || arg === undefined || typeof (arg) === "string" || | 34 return (arg === null || arg === undefined || typeof (arg) === "string" || |
35 typeof (arg) === "number" || typeof (arg) === "boolean"); | 35 typeof (arg) === "number" || typeof (arg) === "boolean"); |
36 }, | 36 }, |
37 | 37 |
38 isInteger: function (arg) { | 38 isInteger: function (arg) { |
39 return parseInt(arg) === arg; | 39 return parseInt(arg) == arg; |
40 }, | 40 }, |
41 | 41 |
42 isNumber: function (arg) { | 42 isNumber: function (arg) { |
43 return parseFloat(arg) === arg; | 43 return parseFloat(arg) == arg; |
44 }, | 44 }, |
45 | 45 |
46 isString: function (val) { | 46 isString: function (val) { |
47 return typeof (val) == "string" || val instanceof String; | 47 return typeof (val) == "string" || val instanceof String; |
48 }, | 48 }, |