Skip to content

Commit

Permalink
Merge pull request #691 from ember-animation/remove-ember-string
Browse files Browse the repository at this point in the history
Refactor: Remove `@ember/string` peerDependency
  • Loading branch information
mkszepp authored Aug 6, 2024
2 parents e92f3f7 + bf8fb87 commit cbfefae
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
1 change: 0 additions & 1 deletion liquid-fire/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@
"extends": "../package.json"
},
"peerDependencies": {
"@ember/string": "^3.1.1",
"ember-source": ">= 4.0.0",
"velocity-animate": "^1.5.2"
}
Expand Down
5 changes: 5 additions & 0 deletions liquid-fire/src/-private/string.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const CAPITALIZE_REGEX = /(^|\/)([a-z\u00C0-\u024F])/g;

export function capitalize(str) {
return str.replace(CAPITALIZE_REGEX, (match) => match.toUpperCase());
}
2 changes: 1 addition & 1 deletion liquid-fire/src/running-transition.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { capitalize } from '@ember/string';
import { capitalize } from './-private/string';

export default class RunningTransition {
constructor(transitionMap, versions, animation) {
Expand Down
2 changes: 1 addition & 1 deletion liquid-fire/src/utils/animate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { capitalize } from '@ember/string';
import { Velocity } from '../index';
import { capitalize } from '../-private/string';

export function measure($elt) {
const boundingRect = $elt.getBoundingClientRect();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
"engines": {
"node": "16.* || >= 18"
}
}
}
4 changes: 1 addition & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cbfefae

Please sign in to comment.