Skip to content

Commit 22b6213

Browse files
committed
Linter cleanup
1 parent 4ac2bab commit 22b6213

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lib/interpolateName.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ function encodeStringToEmoji(content, length) {
1212
if(emojiCache[content]) return emojiCache[content];
1313
length = length || 1;
1414
const emojis = [];
15-
do {
16-
if (!emojiList.length) {
17-
throw new Error("Ran out of emoji");
18-
}
15+
do {
16+
if(!emojiList.length) {
17+
throw new Error("Ran out of emoji");
18+
}
1919

20-
const index = Math.floor(Math.random() * emojiList.length);
20+
const index = Math.floor(Math.random() * emojiList.length);
2121
emojis.push(emojiList[index]);
2222
emojiList.splice(index, 1);
2323
} while(--length > 0);

test/interpolateName.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ describe("interpolateName()", () => {
6767
});
6868

6969
it("should throw error when out of emoji", () => {
70-
assert.throws(function() { loaderUtils.interpolateName.apply(loaderUtils, [{}, "[emoji:5000]", { content: "foo" }]) }, Error, "Ran out of emoji");
70+
assert.throws(() => {
71+
loaderUtils.interpolateName.apply(loaderUtils, [{}, "[emoji:5000]", { content: "foo" }]);
72+
}, Error, "Ran out of emoji");
7173
});
7274

7375
context("no loader context", () => {

0 commit comments

Comments
 (0)