2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-17 19:21:29 +03:00

Moving utility functions into utils

This commit is contained in:
Matt Zabriskie
2014-08-28 12:33:53 -06:00
parent ceca9ced47
commit cec3482ff7
17 changed files with 971 additions and 647 deletions
@@ -1,4 +1,4 @@
var forEach = require('../../lib/forEach');
var forEach = require('../../../lib/utils').forEach;
module.exports = {
testArray: function (test) {
+21
View File
@@ -0,0 +1,21 @@
var utils = require('../../../lib/utils');
module.exports = {
testIsArray: function (test) {
test.equals(utils.isArray([]), true);
test.equals(utils.isArray({length: 5}), false);
test.done();
},
testIsObject: function (test) {
test.equals(utils.isObject({}), true);
test.equals(utils.isObject(null), false);
test.done();
},
testIsDate: function (test) {
test.equals(utils.isDate(new Date()), true);
test.equals(utils.isDate(Date.now()), false);
test.done();
}
};
@@ -1,4 +1,4 @@
var merge = require('../../lib/merge');
var merge = require('../../../lib/utils').merge;
module.exports = {
testImmutability: function (test) {
+13
View File
@@ -0,0 +1,13 @@
var trim = require('../../../lib/utils').trim;
module.exports = {
testTrim: function (test) {
test.equals(trim(' foo '), 'foo');
test.done();
},
testTrimTab: function (test) {
test.equals(trim('\tfoo'), 'foo');
test.done();
}
};