Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix a bug that was preventing animation name flipping in names surrou…
…nded by commas
  • Loading branch information
elchininet committed Apr 18, 2020
commit d285dfd81ad68fc2b0f222f00fb207eb0f3ae033
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [1.2.3] - 2020-04-18

- Bug fix: flip animation names if they are surrounded by comas

## [1.2.2] - 2020-04-16

- Bug fix: detect chainable override, e.g. border-bottom-color is overridden by border-bottom but also by border
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const transformer = (options: PluginOptions = {}): Transformer => (
}

const keyFramesStringMap = getKeyFramesStringMap(keyframes);

const keyFrameData: KeyFramesData = {
length: keyframes.length,
keyframes,
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/atrules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const getKeyFramesStringMap = (keyframes: AtRulesObject[]): AtRulesString
return stringMap;
};

export const getKeyFramesRegExp = (stringMap: AtRulesStringMap): RegExp => new RegExp(`(^| )(${ Object.keys(stringMap).join('|') })( |$)`, 'g');
export const getKeyFramesRegExp = (stringMap: AtRulesStringMap): RegExp => new RegExp(`(^|[^\\w-]| )(${ Object.keys(stringMap).join('|') })( |[^\\w-]|$)`, 'g');

export const parseAtRules = (
rules: RulesObject[],
Expand Down
2 changes: 1 addition & 1 deletion src/parsers/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const parseDeclarations = (
) {
return;
}

if (isAnimation) {

const declValue = decl.value.replace(
Expand Down
Loading