Skip to content

Commit

Permalink
chore: Prettier formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
frontendr committed Aug 31, 2023
1 parent 1ec3532 commit 9e367ef
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type ModifierArgument = string | Record<string, unknown> | number;
* @returns {String|String[]}
*/
function createModifiers(
input: ModifierArgument | ModifierArgument[]
input: ModifierArgument | ModifierArgument[],
): Modifier | Modifier[] | null {
const type = typeof input;

Expand Down Expand Up @@ -76,7 +76,7 @@ function createModifiers(
(mods: string[], [mod, condition]): string[] => {
return condition ? mods.concat(mod) : mods;
},
[]
[],
);
}

Expand Down Expand Up @@ -211,7 +211,7 @@ class Bemmed {

if (isArray) {
return BEMList.from(
dedupe(mods).map((m) => new this.cls(this.b, this.e, m))
dedupe(mods).map((m) => new this.cls(this.b, this.e, m)),
) as BEMList;
}
return new this.cls(this.b, this.e, mods);
Expand Down
24 changes: 12 additions & 12 deletions tests/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ describe("When setting the modifier of an instance", () => {
assert.strictEqual(
// @ts-expect-error - testing falsy values
block.modifier(null, false, undefined).toString(),
"block"
"block",
);
});

Expand Down Expand Up @@ -113,7 +113,7 @@ describe("When using an object as modifier", () => {
it("should use all keys with a truthy value as modifiers", () => {
assert.strictEqual(
block.toString(),
"block--mod-true block--mod-1 block--mod-object block--mod-array"
"block--mod-true block--mod-1 block--mod-object block--mod-array",
);
});
});
Expand Down Expand Up @@ -147,7 +147,7 @@ describe("When setting multiple modifiers of an instance", () => {
it("should also work with an object", () => {
assert.strictEqual(
blockModifiedWithObject.toString(),
"block--yes block--awesome"
"block--yes block--awesome",
);
});
});
Expand All @@ -172,7 +172,7 @@ describe("When setting both the element and modifier of an instance", () => {
it("should create a block__element and block__element--modifier class", () => {
assert.strictEqual(
blockElementModifier.toString(),
"block__element block__element--modifier"
"block__element block__element--modifier",
);
});

Expand Down Expand Up @@ -201,7 +201,7 @@ describe("When setting an element with multiple modifiers", () => {
it("should create a block__element and 2 block__element--modifier classes", () => {
assert.strictEqual(
blockElementModifiers.toString(),
"block__element block__element--mod1 block__element--mod2"
"block__element block__element--mod1 block__element--mod2",
);
});

Expand All @@ -210,7 +210,7 @@ describe("When setting an element with multiple modifiers", () => {
"element",
"mod1",
"mod2",
"mod1"
"mod1",
);
if (!(blockElementDuplicateMods instanceof BEMList)) {
return;
Expand All @@ -219,7 +219,7 @@ describe("When setting an element with multiple modifiers", () => {
assert.strictEqual(blockElementDuplicateMods.length, 3);
assert.strictEqual(
blockElementDuplicateMods.toString(),
"block__element block__element--mod1 block__element--mod2"
"block__element block__element--mod1 block__element--mod2",
);
});
});
Expand Down Expand Up @@ -266,7 +266,7 @@ describe("When creating a block *with* an element", () => {
const blockWithNewElement = blockElement.withElem("element2");
assert.strictEqual(
blockWithNewElement.toString(),
"block__element block__element2"
"block__element block__element2",
);
});
});
Expand Down Expand Up @@ -312,7 +312,7 @@ describe("When creating a block *with* a modifier", () => {
it("should correctly apply object modifiers", () => {
assert.strictEqual(
blockWithMixedObjectModifiers.toString(),
"block block--foo block--bar"
"block block--foo block--bar",
);
});
});
Expand All @@ -326,7 +326,7 @@ describe("When creating a block *with* a modifier", () => {
function shouldAccept(
func: PropTypeFunctionWithRequired | PropTypeFunction,
props: Record<string, unknown>,
prop: string
prop: string,
) {
assert.strictEqual(func(props, prop, "foo", "TestComponent"), undefined);
}
Expand All @@ -340,11 +340,11 @@ function shouldAccept(
function shouldReject(
func: PropTypeFunctionWithRequired | PropTypeFunction,
props: Record<string, unknown>,
prop: string
prop: string,
) {
assert.strictEqual(
func(props, prop, "foo", "TestComponent") instanceof Error,
true
true,
);
}

Expand Down

0 comments on commit 9e367ef

Please sign in to comment.