aboutsummaryrefslogtreecommitdiff
path: root/node_modules/es-abstract/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/es-abstract/helpers')
-rw-r--r--node_modules/es-abstract/helpers/assign.js17
-rw-r--r--node_modules/es-abstract/helpers/isFinite.js3
-rw-r--r--node_modules/es-abstract/helpers/isNaN.js3
-rw-r--r--node_modules/es-abstract/helpers/isPrimitive.js3
-rw-r--r--node_modules/es-abstract/helpers/mod.js4
-rw-r--r--node_modules/es-abstract/helpers/sign.js3
6 files changed, 33 insertions, 0 deletions
diff --git a/node_modules/es-abstract/helpers/assign.js b/node_modules/es-abstract/helpers/assign.js
new file mode 100644
index 00000000..2533d20a
--- /dev/null
+++ b/node_modules/es-abstract/helpers/assign.js
@@ -0,0 +1,17 @@
+var bind = require('function-bind');
+var has = bind.call(Function.call, Object.prototype.hasOwnProperty);
+
+var $assign = Object.assign;
+
+module.exports = function assign(target, source) {
+ if ($assign) {
+ return $assign(target, source);
+ }
+
+ for (var key in source) {
+ if (has(source, key)) {
+ target[key] = source[key];
+ }
+ }
+ return target;
+};
diff --git a/node_modules/es-abstract/helpers/isFinite.js b/node_modules/es-abstract/helpers/isFinite.js
new file mode 100644
index 00000000..46585376
--- /dev/null
+++ b/node_modules/es-abstract/helpers/isFinite.js
@@ -0,0 +1,3 @@
+var $isNaN = Number.isNaN || function (a) { return a !== a; };
+
+module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };
diff --git a/node_modules/es-abstract/helpers/isNaN.js b/node_modules/es-abstract/helpers/isNaN.js
new file mode 100644
index 00000000..e4d4f95f
--- /dev/null
+++ b/node_modules/es-abstract/helpers/isNaN.js
@@ -0,0 +1,3 @@
+module.exports = Number.isNaN || function isNaN(a) {
+ return a !== a;
+};
diff --git a/node_modules/es-abstract/helpers/isPrimitive.js b/node_modules/es-abstract/helpers/isPrimitive.js
new file mode 100644
index 00000000..36691564
--- /dev/null
+++ b/node_modules/es-abstract/helpers/isPrimitive.js
@@ -0,0 +1,3 @@
+module.exports = function isPrimitive(value) {
+ return value === null || (typeof value !== 'function' && typeof value !== 'object');
+};
diff --git a/node_modules/es-abstract/helpers/mod.js b/node_modules/es-abstract/helpers/mod.js
new file mode 100644
index 00000000..5867fd97
--- /dev/null
+++ b/node_modules/es-abstract/helpers/mod.js
@@ -0,0 +1,4 @@
+module.exports = function mod(number, modulo) {
+ var remain = number % modulo;
+ return Math.floor(remain >= 0 ? remain : remain + modulo);
+};
diff --git a/node_modules/es-abstract/helpers/sign.js b/node_modules/es-abstract/helpers/sign.js
new file mode 100644
index 00000000..2ac0bf1b
--- /dev/null
+++ b/node_modules/es-abstract/helpers/sign.js
@@ -0,0 +1,3 @@
+module.exports = function sign(number) {
+ return number >= 0 ? 1 : -1;
+};