first commit
This commit is contained in:
+12
@@ -0,0 +1,12 @@
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
module.exports = function assign(target, source) {
|
||||
if (Object.assign) {
|
||||
return Object.assign(target, source);
|
||||
}
|
||||
for (var key in source) {
|
||||
if (has.call(source, key)) {
|
||||
target[key] = source[key];
|
||||
}
|
||||
}
|
||||
return target;
|
||||
};
|
||||
+3
@@ -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; };
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = Number.isNaN || function isNaN(a) {
|
||||
return a !== a;
|
||||
};
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = function isPrimitive(value) {
|
||||
return value === null || (typeof value !== 'function' && typeof value !== 'object');
|
||||
};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
module.exports = function mod(number, modulo) {
|
||||
var remain = number % modulo;
|
||||
return Math.floor(remain >= 0 ? remain : remain + modulo);
|
||||
};
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
module.exports = function sign(number) {
|
||||
return number >= 0 ? 1 : -1;
|
||||
};
|
||||
Reference in New Issue
Block a user