Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kricsleo committed Oct 17, 2022
1 parent 411857a commit ef1f684
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ function chain(...stylers: Styler[]) {
return root;
}

function buildCraier(stylers: Styler[]) {
const craier: Record<string, Styler> = {};
function buildCraie(stylers: Styler[]) {
const craie: Record<string, Styler> = {};
stylers.forEach((styler) => {
craier[styler.alias] = chain(
craie[styler.alias] = chain(
styler,
...stylers.filter((t) => t !== styler)
);
});
return craier;
return craie;
}

const craier = buildCraier(createStylers(styles));
const craie = buildCraie(createStylers(styles));

function createStylers(styleMap: StyleMap) {
return Object.entries(styleMap).map(([alias, style]) =>
Expand Down Expand Up @@ -82,4 +82,4 @@ function expandRadius(styleMap: StyleMap) {
}, {} as StyleMap);
}

export default craier;
export default craie;
12 changes: 6 additions & 6 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { describe, expect, test } from 'vitest';
import craier from '../src';
import craie from '../src';

describe('craier', () => {
describe('craie', () => {
test('style', () => {
expect(craier.red('text')[1]).toMatchInlineSnapshot('"color:#D24735;"');
expect(craie.red('text')[1]).toMatchInlineSnapshot('"color:#D24735;"');

expect(craier.red.bold('text')[1]).toMatchInlineSnapshot(
expect(craie.red.bold('text')[1]).toMatchInlineSnapshot(
'"color:#D24735;font-weight:bold;"'
);

expect(craier.red.bold.round('text')[1]).toMatchInlineSnapshot(
expect(craie.red.bold.round('text')[1]).toMatchInlineSnapshot(
'"color:#D24735;font-weight:bold;border-radius:999em;"'
);

expect(craier.red.bold.roundR.bgBlue('text')[1]).toMatchInlineSnapshot(
expect(craie.red.bold.roundR.bgBlue('text')[1]).toMatchInlineSnapshot(
'"color:#D24735;font-weight:bold;border-top-right-radius:999em;border-bottom-right-radius:999em;background-color:#003D74;padding:0 0.5em;"'
);
});
Expand Down

0 comments on commit ef1f684

Please sign in to comment.