Skip to content

Commit

Permalink
Minor performance improvements (#3244)
Browse files Browse the repository at this point in the history
* perf: small lints

* revert

* lint

* chore: add changeset

* Update .changeset/curly-jars-punch.md

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
  • Loading branch information
romgrk and Andarist committed Aug 25, 2024
1 parent 3f46884 commit ad630e3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changeset/curly-jars-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@emotion/serialize': patch
'@emotion/utils': patch
---

Minor performance improvement
2 changes: 1 addition & 1 deletion packages/serialize/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function createStringFromObject(
return string
}

let labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g
let labelPattern = /label:\s*([^\s;{]+)\s*(;|$)/g

let sourceMapPattern: RegExp | undefined
if (isDevelopment) {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function getRegisteredStyles(
classNames.split(' ').forEach(className => {
if (registered[className] !== undefined) {
registeredStyles.push(`${registered[className]};`)
} else {
} else if (className) {
rawClassName += `${className} `
}
})
Expand Down

0 comments on commit ad630e3

Please sign in to comment.