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:
@@ -1,4 +1,4 @@
|
||||
var forEach = require('../../lib/forEach');
|
||||
var forEach = require('../../../lib/utils').forEach;
|
||||
|
||||
module.exports = {
|
||||
testArray: function (test) {
|
||||
@@ -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) {
|
||||
@@ -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();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user