e255475b7b6eaaffeb49a9c0d0fcb0b73b3d1521
[platform/framework/web/crosswalk-tizen.git] /
1
2
3     /**
4      * Checks if the object is a primitive
5      */
6     function isPrimitive(value) {
7         // Using switch fallthrough because it's simple to read and is
8         // generally fast: http://jsperf.com/testing-value-is-primitive/5
9         switch (typeof value) {
10             case "string":
11             case "number":
12             case "boolean":
13                 return true;
14         }
15
16         return value == null;
17     }
18
19     module.exports = isPrimitive;
20
21