style: Prettify

This commit is contained in:
Mariusz Nowak
2022-03-07 13:27:20 +01:00
parent 9f0ef0007a
commit 59f9b074fd
51 changed files with 78 additions and 70 deletions
+2 -1
View File
@@ -5,6 +5,7 @@ var objToString = Object.prototype.toString, id = objToString.call(1);
module.exports = function (value) {
return (
typeof value === "number" ||
(value instanceof Number || (typeof value === "object" && objToString.call(value) === id))
value instanceof Number ||
(typeof value === "object" && objToString.call(value) === id)
);
};
+5 -6
View File
@@ -10,11 +10,9 @@ module.exports = function (fmap) {
var context = this;
value(context);
pattern = String(pattern);
return pattern.replace(/%([a-zA-Z]+)|\\([\u0000-\uffff])/g, function (
match,
token,
escapeChar
) {
return pattern.replace(
/%([a-zA-Z]+)|\\([\u0000-\uffff])/g,
function (match, token, escapeChar) {
var t, result;
if (escapeChar) return escapeChar;
t = token;
@@ -22,6 +20,7 @@ module.exports = function (fmap) {
if (!result) return match;
if (isCallable(result)) result = call.call(result, context);
return result + token.slice(t.length);
});
}
);
};
};
+7 -1
View File
@@ -2,7 +2,13 @@
module.exports = function (t, a) {
a.deep(t({ foo: "bar" }), [["foo", "bar"]], "Object");
a.deep(t("raz"), [["0", "r"], ["1", "a"], ["2", "z"]], "Primitive");
a.deep(
t("raz"),
[
["0", "r"], ["1", "a"], ["2", "z"]
],
"Primitive"
);
a.throws(function () { t(); }, TypeError, "Undefined");
a.throws(function () { t(null); }, TypeError, "Undefined");
};
+3 -1
View File
@@ -14,5 +14,7 @@ module.exports = function (t, a) {
);
a.deep(o2, [2, 4, 6]);
t(o).sort().forEach(function (item) { a.deep(item, [item[0], o[item[0]]], "Default"); });
t(o)
.sort()
.forEach(function (item) { a.deep(item, [item[0], o[item[0]]], "Default"); });
};
+5 -5
View File
@@ -12,14 +12,14 @@ module.exports = function (t, a) {
},
Failure: function (d) {
var error = new Error("Rejection");
t.call(new Promise(function (resolve, reject) { reject(error); }), function (
passedError,
value
) {
t.call(
new Promise(function (resolve, reject) { reject(error); }),
function (passedError, value) {
a(passedError, error);
a(value, undefined);
d();
});
}
);
}
};
};