aboutsummaryrefslogtreecommitdiff
path: root/node_modules/es5-ext/object/validate-array-like-object.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es5-ext/object/validate-array-like-object.js')
-rw-r--r--node_modules/es5-ext/object/validate-array-like-object.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/node_modules/es5-ext/object/validate-array-like-object.js b/node_modules/es5-ext/object/validate-array-like-object.js
new file mode 100644
index 000000000..d7c45b365
--- /dev/null
+++ b/node_modules/es5-ext/object/validate-array-like-object.js
@@ -0,0 +1,9 @@
+"use strict";
+
+var isArrayLike = require("./is-array-like")
+ , isObject = require("./is-object");
+
+module.exports = function (obj) {
+ if (isObject(obj) && isArrayLike(obj)) return obj;
+ throw new TypeError(obj + " is not array-like object");
+};