Skip to content

Commit

Permalink
chore: fix several typos (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdufresne authored Dec 3, 2023
1 parent a663d8d commit d6ff70b
Show file tree
Hide file tree
Showing 21 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-old.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ Some goodness from pull-requests.
* plugins/convertPathData: do not remove very first M from the path data (fix [#24](https://github.com/svg/svgo/issues/24))
* plugins/convertPathData: optimize path data in <glyph> and <missing-glyph> (close [#20](https://github.com/svg/svgo/issues/20))
* plugins/convertTransform: add patternTransform attribute to the process (close [#15](https://github.com/svg/svgo/issues/15))
* plugins/convertTransform: Firefox: removing extra space in front of negative number is alowed only in path data, but not in transform (fix [#12](https://github.com/svg/svgo/issues/12))
* plugins/convertTransform: Firefox: removing extra space in front of negative number is allowed only in path data, but not in transform (fix [#12](https://github.com/svg/svgo/issues/12))
* plugins/removeXMLProcInst: remove only 'xml' but not 'xml-stylesheet' (fix [#21](https://github.com/svg/svgo/issues/15))
* plugins/collapseGroups: merge split-level transforms (fix [#13](https://github.com/svg/svgo/issues/13))
* jsdoc corrections
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SVG files, especially those exported from vector editors, usually contain a lot

## Installation

You can install SVGO globablly through npm, yarn, or pnpm. Alternatively, drop the global flag (`global`/`-g`) to use it in your Node.js project.
You can install SVGO globally through npm, yarn, or pnpm. Alternatively, drop the global flag (`global`/`-g`) to use it in your Node.js project.

```sh
# npm
Expand Down
2 changes: 1 addition & 1 deletion docs/02-preset-default.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = {
};
```

Alternatively, you can also drop `default-preset` entirely, and configure your own plugin pipeline from scratch, with only the desireable plugins:
Alternatively, you can also drop `default-preset` entirely, and configure your own plugin pipeline from scratch, with only the desirable plugins:

```js
module.exports = {
Expand Down
4 changes: 2 additions & 2 deletions docs/03-plugins/add-classes-to-svg-element.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ If there is no `class` attribute to begin with, it will be added. However, if th

:::

If you have a standalone SVG, this is not an optimization and will increase the size of the SVG document. This plugin is only relavent when considering multiple SVGs that may be inlined a parent document.
If you have a standalone SVG, this is not an optimization and will increase the size of the SVG document. This plugin is only relevant when considering multiple SVGs that may be inlined a parent document.

By adding classes, if the parent document is aware, you can share styles across all inlined SVG elements.
By adding classes, if the parent document is aware, you can share styles across all inlined SVG elements.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/03-plugins/convert-transform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ svgo:
description: Convert transforms to their shorthand alternatives.
default: true
degPrecision:
description: Number of decimal places to round degress values to, using conventional rounding rules. Used for <code>rotate</code> and <code>skew</code>.
description: Number of decimal places to round degrees values to, using conventional rounding rules. Used for <code>rotate</code> and <code>skew</code>.
floatPrecision:
description: Number of decimal places to round to, using conventional rounding rules.
default: 3
Expand Down
2 changes: 1 addition & 1 deletion docs/03-plugins/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Plugins

All optimizations performed by SVGO are through the various plugins that are either built-in, or provided in your SVGO config.

Built-in plugins are focused around either optimzations or compatibility. However, the plugin architecure is very flexible, so plugins can be made to do effectively anything.
Built-in plugins are focused around either optimizations or compatibility. However, the plugin architecture is very flexible, so plugins can be made to do effectively anything.

## Presets

Expand Down
2 changes: 1 addition & 1 deletion docs/03-plugins/minify-styles.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ svgo:
defaultPlugin: true
parameters:
usage:
description: If to collect usage data such as tags, classes, and IDs to pass to CSSO. This is an object with four properties, which are each configured with a boolean, <code>tags</code>, <code>ids</code>, <code>classes</code>, and <code>force</code>. By default, if a script is found this does not pass usage data to CSSO, but this can be overriden with <code>force</code>, which may yield destructive changes.
description: If to collect usage data such as tags, classes, and IDs to pass to CSSO. This is an object with four properties, which are each configured with a boolean, <code>tags</code>, <code>ids</code>, <code>classes</code>, and <code>force</code>. By default, if a script is found this does not pass usage data to CSSO, but this can be overridden with <code>force</code>, which may yield destructive changes.
default: true
---

Expand Down
2 changes: 1 addition & 1 deletion docs/03-plugins/remove-attrs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ svgo:
description: A selector that matches attributes.
default: null
elemSeparator:
description: The pattern syntax used by this plugin is <code>element:attribute:value</code>, this changes the delimeter from <code>:</code> to another string.
description: The pattern syntax used by this plugin is <code>element:attribute:value</code>, this changes the delimiter from <code>:</code> to another string.
default: ":"
preserveCurrentColor:
description: If to ignore the attribute if it's set to <code>currentColor</code>.
Expand Down
2 changes: 1 addition & 1 deletion lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ const parsePathData = (string) => {
// flush arguments when necessary count is reached
if (args.length === argsCount) {
pathData.push({ command, args });
// subsequent moveto coordinates are threated as implicit lineto commands
// subsequent moveto coordinates are treated as implicit lineto commands
if (command === 'M') {
command = 'L';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/path.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('parse path data', () => {
{ command: 'M', args: [0, 10] },
]);
});
it('should forbid multipe commas in a row', () => {
it('should forbid multiple commas in a row', () => {
expect(parsePathData('M0 , , 10')).toEqual([]);
});
it('should stop when unknown char appears', () => {
Expand Down
2 changes: 1 addition & 1 deletion lib/svgo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export type Config = {
path?: string;
/** Pass over SVGs multiple times to ensure all optimizations are applied. */
multipass?: boolean;
/** Precision of floating point numbers. Will be passed to each plugin that suppors this param. */
/** Precision of floating point numbers. Will be passed to each plugin that supports this param. */
floatPrecision?: number;
/**
* Plugins configuration
Expand Down
2 changes: 1 addition & 1 deletion plugins/cleanupAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ exports.fn = (root, params) => {
enter: (node) => {
for (const name of Object.keys(node.attributes)) {
if (newlines) {
// new line which requires a space instead of themselve
// new line which requires a space instead of themself
node.attributes[name] = node.attributes[name].replace(
regNewlinesNeedSpace,
(match, p1, p2) => p1 + ' ' + p2
Expand Down
2 changes: 1 addition & 1 deletion plugins/collapseGroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ exports.fn = () => {
return;
}

// move group attibutes to the single child element
// move group attributes to the single child element
if (
Object.keys(node.attributes).length !== 0 &&
node.children.length === 1
Expand Down
4 changes: 2 additions & 2 deletions plugins/convertPathData.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function filters(
}
}

// Rounding relative coordinates, taking in account accummulating error
// Rounding relative coordinates, taking in account accumulating error
// to get closer to absolute coordinates. Sum of rounded value remains same:
// l .25 3 .25 2 .25 3 .25 2 -> l .3 3 .2 2 .3 3 .2 2
if (precision !== false) {
Expand Down Expand Up @@ -975,7 +975,7 @@ function getIntersection(coords) {
c2 = coords[4] * coords[7] - coords[5] * coords[6], // x1 * y2 - x2 * y1
denom = a1 * b2 - a2 * b1;

if (!denom) return; // parallel lines havn't an intersection
if (!denom) return; // parallel lines haven't an intersection

/**
* @type {Point}
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertShapeToPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ exports.fn = (root, params) => {
delete node.attributes.r;
}

// optionally covert ellipse
// optionally convert ellipse
if (node.name === 'ellipse' && convertArcs) {
const ecx = Number(node.attributes.cx || '0');
const ecy = Number(node.attributes.cy || '0');
Expand Down
2 changes: 1 addition & 1 deletion plugins/convertStyleToAttrs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const rSingleQuotes = "'(?:[^'\\n\\r\\\\]|" + rEscape + ")*?(?:'|$)"; // string
const rQuotes = '"(?:[^"\\n\\r\\\\]|' + rEscape + ')*?(?:"|$)'; // string in double quotes: "smth"
const rQuotedString = new RegExp('^' + g(rSingleQuotes, rQuotes) + '$');
// Parentheses, E.g.: url(data:image/png;base64,iVBO...).
// ':' and ';' inside of it should be threated as is. (Just like in strings.)
// ':' and ';' inside of it should be treated as is. (Just like in strings.)
const rParenthesis =
'\\(' + g('[^\'"()\\\\]+', rEscape, rSingleQuotes, rQuotes) + '*?' + '\\)';
// The value. It can have strings and parentheses (see above). Fallbacks to anything in case of unexpected input.
Expand Down
4 changes: 2 additions & 2 deletions plugins/convertTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ const convertTransform = (item, attrName, params) => {
* Defines precision to work with certain parts.
* transformPrecision - for scale and four first matrix parameters (needs a better precision due to multiplying),
* floatPrecision - for translate including two last matrix and rotate parameters,
* degPrecision - for rotate and skew. By default it's equal to (rougly)
* degPrecision - for rotate and skew. By default it's equal to (roughly)
* transformPrecision - 2 or floatPrecision whichever is lower. Can be set in params.
*
* @type {(data: Array<TransformItem>, params: TransformParams) => TransformParams}
Expand Down Expand Up @@ -294,7 +294,7 @@ const convertToShorts = (transforms, params) => {
/**
* Remove useless transforms.
*
* @type {(trasforms: Array<TransformItem>) => Array<TransformItem>}
* @type {(transforms: Array<TransformItem>) => Array<TransformItem>}
*/
const removeUseless = (transforms) => {
return transforms.filter((transform) => {
Expand Down
2 changes: 1 addition & 1 deletion plugins/inlineStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ exports.fn = (root, params) => {

// csstree v2 changed this type
if (style.cssAst.children.isEmpty) {
// remove emtpy style element
// remove empty style element
detachNodeFromParent(style.node, style.parentNode);
} else {
// update style element if any styles left
Expand Down
2 changes: 1 addition & 1 deletion plugins/plugins-types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type DefaultPlugins = {
*/
restructure?: boolean;
/**
* Enables merging of @media rules with the same media query by splitted by other rules.
* Enables merging of @media rules with the same media query split by other rules.
* The optimisation is unsafe in general, but should work fine in most cases. Use it on your own risk.
* @default false
*/
Expand Down
2 changes: 1 addition & 1 deletion plugins/removeXlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ exports.fn = (_, params) => {
const xlinkPrefixes = [];

/**
* Namespace prefixes that exist in {@link xlinkPrefixes} but were overriden
* Namespace prefixes that exist in {@link xlinkPrefixes} but were overridden
* in a child element to point to another namespace, and so is not treated as
* an XLink attribute.
*
Expand Down
2 changes: 1 addition & 1 deletion test/svgo/_index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('svgo', () => {
const result = optimize('<svg />', { input: 'file', path: 'input.svg' });
expect(result.data).toEqual('<svg/>');
});
it('should preserve style specifity over attributes', async () => {
it('should preserve style specificity over attributes', async () => {
const [original, expected] = await parseFixture('style-specifity.svg');
const result = optimize(original, {
input: 'file',
Expand Down

0 comments on commit d6ff70b

Please sign in to comment.