10 examples of 'angularjs typeof' in JavaScript

Every line of 'angularjs typeof' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
39function typeOf(object) {
40 if (typeof object === 'object' && object !== null) {
41 var $$typeof = object.$$typeof;
42
43 switch ($$typeof) {
44 case REACT_ELEMENT_TYPE:
45 var type = object.type;
46
47 switch (type) {
48 case REACT_ASYNC_MODE_TYPE:
49 case REACT_FRAGMENT_TYPE:
50 case REACT_PROFILER_TYPE:
51 case REACT_STRICT_MODE_TYPE:
52 return type;
53 default:
54 var $$typeofType = type && type.$$typeof;
55
56 switch ($$typeofType) {
57 case REACT_CONTEXT_TYPE:
58 case REACT_FORWARD_REF_TYPE:
59 case REACT_PROVIDER_TYPE:
60 return $$typeofType;
61 default:
62 return $$typeof;
63 }
64 }
65 case REACT_PORTAL_TYPE:
66 return $$typeof;
67 }
68 }
69
70 return undefined;
71}
19utils.typeOf = function typeOf (val) {
20 return Array.isArray(val) ? 'array' : typeof val
21}
16function _typeof(obj) {
17 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
18 _typeof = function (obj) {
19 return typeof obj;
20 };
21 } else {
22 _typeof = function (obj) {
23 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
24 };
25 }
26
27 return _typeof(obj);
28}
35function typeOf(obj) {
36 return Object.prototype.toString.call(obj).match(/\[object\s*([^\]]+)\]/)[1].toLowerCase();
37}
53function typeOf(value) {
54 var t = typeof(value);
55 if (t === 'object') {
56 if (value) {
57 if (value instanceof Array) {
58 t = 'array';
59 }
60 }
61 else {
62 t = 'null';
63 }
64 }
65 return t;
66}
154function typeOf(value) {
155 var s = typeof value;
156 if (s === 'object') {
157 if (value) {
158 if (typeof value.length === 'number' &&
159 !(value.propertyIsEnumerable('length')) &&
160 typeof value.splice === 'function') {
161 s = 'array';
162 }
163 } else {
164 s = 'null';
165 }
166 }
167 return s;
168}
144function typeOf(value) {
145 if (Array.isArray(value)) {
146 return 'array';
147 }
148 if (value === null) {
149 return 'null';
150 }
151 return typeof value;
152}
368typeOf: function typeOf(obj) {
369 return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
370},
18function _typeof(obj) {
19 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
20 _typeof = function _typeof(obj) {
21 return typeof obj;
22 };
23 } else {
24 _typeof = function _typeof(obj) {
25 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
26 };
27 }
28 return _typeof(obj);
29}
18function _typeof(obj) {
19 if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {
20 _typeof = function _typeof(obj) {
21 return typeof obj;
22 };
23 } else {
24 _typeof = function _typeof(obj) {
25 return obj && typeof Symbol === 'function' && obj.constructor === Symbol && obj !== Symbol.prototype
26 ? 'symbol'
27 : typeof obj;
28 };
29 }
30 return _typeof(obj);
31}

Related snippets