Skip to content

Commit

Permalink
chore(icons-svg): fix typos in createTrasformStream and createTrasfor…
Browse files Browse the repository at this point in the history
…mStreamAsync function names (#674)
  • Loading branch information
phostann authored Oct 28, 2024
1 parent 613157a commit bdc9510
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/icons-svg/plugins/creator.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import through from 'through2';
import File from 'vinyl';

export const createTrasformStream = (fn: (raw: string, file: File) => string) =>
export const createTransformStream = (fn: (raw: string, file: File) => string) =>
through.obj((file: File, encoding, done) => {
if (file.isBuffer()) {
const before = file.contents.toString(encoding);
Expand All @@ -17,7 +17,7 @@ export const createTrasformStream = (fn: (raw: string, file: File) => string) =>
}
});

export const createTrasformStreamAsync = (
export const createTransformStreamAsync = (
fn: (raw: string, file: File) => Promise<string>
) =>
through.obj((file: File, encoding, done) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-svg/plugins/render/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTrasformStream } from '../creator';
import { createTransformStream } from '../creator';
import {
renderIconDefinitionToSVGElement,
HelperRenderOptions
Expand All @@ -18,7 +18,7 @@ export const useRender = ({
getIconDefinitionFromSource,
renderOptions
}: RenderOptions) =>
createTrasformStream((content, file) => {
createTransformStream((content, file) => {
const def = getIconDefinitionFromSource(content);
file.extname = '.svg';
file.stem = def.name;
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-svg/plugins/svg2Definition/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTrasformStream } from '../creator';
import { createTransformStream } from '../creator';
import { ThemeType, AbstractNode } from '../../templates/types';
import {
pipe,
Expand Down Expand Up @@ -54,7 +54,7 @@ export const svg2Definition = ({
extraNodeTransformFactories,
stringify
}: SVG2DefinitionOptions) =>
createTrasformStream((SVGString, { stem: name }) =>
createTransformStream((SVGString, { stem: name }) =>
applyTo(SVGString)(
pipe(
// 0. The SVG string is like that:
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-svg/plugins/svgo/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import SVGO from 'svgo';
import { createTrasformStreamAsync } from '../creator';
import { createTransformStreamAsync } from '../creator';

export const svgo = (options: SVGO.Options) => {
const optimizer = new SVGO(options);
return createTrasformStreamAsync(async (before) => {
return createTransformStreamAsync(async (before) => {
const { data } = await optimizer.optimize(before);
return data;
});
Expand Down
4 changes: 2 additions & 2 deletions packages/icons-svg/plugins/useTemplate/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTrasformStream } from '../creator';
import { createTransformStream } from '../creator';
import template from 'lodash.template';

export interface UseTemplatePluginOptions {
Expand All @@ -15,7 +15,7 @@ export const useTemplate = ({
mapToInterpolate
}: UseTemplatePluginOptions) => {
const executor = template(tplContent);
return createTrasformStream((content, { stem: name, path }) =>
return createTransformStream((content, { stem: name, path }) =>
executor(mapToInterpolate({ name, content, path }))
);
};

0 comments on commit bdc9510

Please sign in to comment.