Skip to content

Commit

Permalink
Reformat code with prettier 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
alavers committed Nov 25, 2019
1 parent 8e84557 commit 5d2e1c8
Show file tree
Hide file tree
Showing 12 changed files with 58 additions and 22 deletions.
12 changes: 6 additions & 6 deletions lib/connectors/SentinelConnector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ export default class SentinelConnector extends AbstractConnector {
}

result
.map<IAddressFromResponse>(packObject as (
value: any
) => IAddressFromResponse)
.map<IAddressFromResponse>(
packObject as (value: any) => IAddressFromResponse
)
.forEach(sentinel => {
const flags = sentinel.flags ? sentinel.flags.split(",") : [];
if (
Expand Down Expand Up @@ -248,9 +248,9 @@ export default class SentinelConnector extends AbstractConnector {
}

const availableSlaves = result
.map<IAddressFromResponse>(packObject as (
value: any
) => IAddressFromResponse)
.map<IAddressFromResponse>(
packObject as (value: any) => IAddressFromResponse
)
.filter(
slave =>
slave.flags && !slave.flags.match(/(disconnected|s_down|o_down)/)
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"husky": "^2.5.0",
"istanbul": "^0.4.5",
"mocha": "^5.0.0",
"prettier": "^1.18.2",
"prettier": "^1.19.1",
"pretty-quick": "^1.11.1",
"server-destroy": "^1.0.1",
"sinon": "^7.3.2",
Expand Down
5 changes: 4 additions & 1 deletion test/functional/cluster/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ describe("cluster:connect", function() {
it("should send command to the correct node", function(done) {
new MockServer(30001, function(argv) {
if (argv[0] === "cluster" && argv[1] === "slots") {
return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]];
return [
[0, 1, ["127.0.0.1", 30001]],
[2, 16383, ["127.0.0.1", 30002]]
];
}
});
new MockServer(30002, function(argv) {
Expand Down
5 changes: 4 additions & 1 deletion test/functional/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ describe("cluster", function() {
it("should get value successfully", function(done) {
new MockServer(30001, function(argv) {
if (argv[0] === "cluster" && argv[1] === "slots") {
return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]];
return [
[0, 1, ["127.0.0.1", 30001]],
[2, 16383, ["127.0.0.1", 30002]]
];
}
});
new MockServer(30002, function(argv) {
Expand Down
5 changes: 4 additions & 1 deletion test/functional/cluster/maxRedirections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ describe("cluster:maxRedirections", function() {
var redirectTimes = 0;
var argvHandler = function(argv) {
if (argv[0] === "cluster" && argv[1] === "slots") {
return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]];
return [
[0, 1, ["127.0.0.1", 30001]],
[2, 16383, ["127.0.0.1", 30002]]
];
} else if (argv[0] === "get" && argv[1] === "foo") {
redirectTimes += 1;
return new Error("ASK " + calculateSlot("foo") + " 127.0.0.1:30001");
Expand Down
5 changes: 4 additions & 1 deletion test/functional/cluster/pub_sub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ describe("cluster:pub/sub", function() {
it("should receive messages", function(done) {
var handler = function(argv) {
if (argv[0] === "cluster" && argv[1] === "slots") {
return [[0, 1, ["127.0.0.1", 30001]], [2, 16383, ["127.0.0.1", 30002]]];
return [
[0, 1, ["127.0.0.1", 30001]],
[2, 16383, ["127.0.0.1", 30002]]
];
}
};
var node1 = new MockServer(30001, handler);
Expand Down
5 changes: 4 additions & 1 deletion test/functional/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ describe("pipeline", function() {
.exec();
expect(pipeline1.length).to.eql(4);

var pipeline2 = redis.pipeline([["set", "foo", "bar"], ["get", "foo"]]);
var pipeline2 = redis.pipeline([
["set", "foo", "bar"],
["get", "foo"]
]);
expect(pipeline2.length).to.eql(2);
redis.disconnect();
});
Expand Down
5 changes: 4 additions & 1 deletion test/functional/reconnect_on_error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ describe("reconnectOnError", function() {
.get("foo")
.sadd("foo", "a")
.exec(function(err, res) {
expect(res).to.eql([[null, "bar"], [null, 1]]);
expect(res).to.eql([
[null, "bar"],
[null, 1]
]);
done();
});
});
Expand Down
5 changes: 4 additions & 1 deletion test/functional/scripting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ describe("scripting", function() {
.set("test", "pipeline")
.test("test")
.exec(function(err, results) {
expect(results).to.eql([[null, "OK"], [null, "pipeline"]]);
expect(results).to.eql([
[null, "OK"],
[null, "pipeline"]
]);
redis.disconnect();
done();
});
Expand Down
15 changes: 12 additions & 3 deletions test/functional/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ describe("transaction", function() {
.get("foo")
.exec(function(err, result) {
expect(err).to.eql(null);
expect(result).to.eql([[null, "OK"], [null, "transaction"]]);
expect(result).to.eql([
[null, "OK"],
[null, "transaction"]
]);
done();
});
});
Expand Down Expand Up @@ -116,7 +119,10 @@ describe("transaction", function() {
})
.exec(function(err, result) {
expect(pending).to.eql(0);
expect(result).to.eql([[null, "OK"], [null, "bar"]]);
expect(result).to.eql([
[null, "OK"],
[null, "bar"]
]);
done();
});
});
Expand Down Expand Up @@ -146,7 +152,10 @@ describe("transaction", function() {
redis.set("foo", "bar");
redis.get("foo");
redis.exec(function(err, results) {
expect(results).to.eql([[null, "OK"], [null, "bar"]]);
expect(results).to.eql([
[null, "OK"],
[null, "bar"]
]);
done();
});
});
Expand Down
10 changes: 8 additions & 2 deletions test/unit/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ describe("utils", function() {
describe(".wrapMultiResult", function() {
it("should return correctly", function() {
expect(utils.wrapMultiResult(null)).to.eql(null);
expect(utils.wrapMultiResult([1, 2])).to.eql([[null, 1], [null, 2]]);
expect(utils.wrapMultiResult([1, 2])).to.eql([
[null, 1],
[null, 2]
]);

var error = new Error("2");
expect(utils.wrapMultiResult([1, 2, error])).to.eql([
Expand Down Expand Up @@ -137,7 +140,10 @@ describe("utils", function() {
expect(utils.convertMapToArray(new Map([[1, 2]]))).to.eql([1, 2]);
expect(
utils.convertMapToArray(
new Map<number | string, string>([[1, "2"], ["abc", "def"]])
new Map<number | string, string>([
[1, "2"],
["abc", "def"]
])
)
).to.eql([1, "2", "abc", "def"]);
}
Expand Down

0 comments on commit 5d2e1c8

Please sign in to comment.