Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Minor refactor

  • Loading branch information...
commit b30ea7b2a064481f0d1d76b7ee9a64b39ac474e4 1 parent 766a586
@nathanmacinnes authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 lib/pretendr.js
View
8 lib/pretendr.js
@@ -79,8 +79,7 @@ pretendr = function (o, f) {
var i,
indexNumber,
mock,
- output,
- type;
+ output;
for (i = 0; i < ins.length; i++) {
if (input === ins[i]) {
return outs[i];
@@ -88,7 +87,7 @@ pretendr = function (o, f) {
}
ins.push(input);
indexNumber = ins.length - 1;
- if (typeof input === 'function' || typeof input === 'object') {
+ if (enumerate(input)) {
if (typeof input === 'function') {
output = pretendrFunction();
} else {
@@ -106,8 +105,7 @@ pretendr = function (o, f) {
outs[indexNumber] = output;
for (i in input) {
if (input.hasOwnProperty(i)) {
- type = typeof input[i];
- if (type === 'object' || type === 'function') {
+ if (enumerate(input[i])) {
output[i] = pretendr(input[i]);
output.mock[i] = output[i].mock;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.