Skip to content

Commit

Permalink
rename and clarify comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Monkeychip committed Jan 10, 2025
1 parent 6bc001f commit 81b1c4c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
import { helper as buildHelper } from '@ember/component/helper';
import { assert } from '@ember/debug';

// This helper is simlar to the Ember string camelize helper but it does some additional handling:
// This helper is similar to the Ember string camelize helper but it does some additional handling:
// it allows you to pass in an array of strings
// it lowercases the entire string before converting to camelCase preventing situations like IAM Endpoint -> iamEndpoint instead of iAMEndpoint
// Does not handle accented characters
export function stringToCamelCase(str) {
// it does not handle accented characters so try not use for user inputted strings.
export function stringArrayToCamelCase(str) {
if (!str) return;
if (Array.isArray(str)) {
return str.map((s) => {
Expand All @@ -35,4 +35,4 @@ export function stringToCamelCase(str) {
}
}

export default buildHelper(stringToCamelCase);
export default buildHelper(stringArrayToCamelCase);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { module, test } from 'qunit';
import { setupRenderingTest } from 'vault/tests/helpers';
import { stringToCamelCase } from 'vault/helpers/string-to-camel';
import { stringToCamelCase } from 'vault/helpers/string-array-to-camel';

module('Integration | Helper | string-to-camel', function (hooks) {
setupRenderingTest(hooks);
Expand Down

0 comments on commit 81b1c4c

Please sign in to comment.