UNPKG
holyfills
Version:
latest (1.0.1)
1.0.1
1.0.0
No more "Holy Sxxt!!" when writting ES5/ES6
github.com/tomchentw/holyfills
tomchentw/holyfills
holyfills
/
lib
/
helpers
/
toObject.js
11 lines
(9 loc)
•
237 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
"use strict"
;
// ES5 9.9
// http://es5.github.com/#x9.9
module
.
exports
=
function
(
o
) {
if
(o ==
null
) {
// this matches both null and undefined
throw
new
TypeError
(
"can't convert "
+ o +
" to object"
); }
return
Object
(o); };