-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #124 - martndemus:string-helper, r=poteto
Dry up string helpers None
- Loading branch information
Showing
6 changed files
with
16 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function(stringFunction) { | ||
return function([string]) { | ||
string = string || ''; | ||
return stringFunction(string); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { helper } from 'ember-helper'; | ||
import { camelize as _camelize } from 'ember-string'; | ||
import createStringHelperFunction from '../-private/create-string-helper'; | ||
|
||
export function camelize([string]) { | ||
string = string || ''; | ||
return _camelize(string); | ||
} | ||
|
||
export const camelize = createStringHelperFunction(_camelize); | ||
export default helper(camelize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { helper } from 'ember-helper'; | ||
import { capitalize as _capitalize } from 'ember-string'; | ||
import createStringHelperFunction from '../-private/create-string-helper'; | ||
|
||
export function capitalize([string]) { | ||
string = string || ''; | ||
return _capitalize(string); | ||
} | ||
|
||
export const capitalize = createStringHelperFunction(_capitalize); | ||
export default helper(capitalize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { helper } from 'ember-helper'; | ||
import { classify as _classify } from 'ember-string'; | ||
import createStringHelperFunction from '../-private/create-string-helper'; | ||
|
||
export function classify([string]) { | ||
string = string || ''; | ||
return _classify(string); | ||
} | ||
|
||
export const classify = createStringHelperFunction(_classify); | ||
export default helper(classify); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { helper } from 'ember-helper'; | ||
import { dasherize as _dasherize } from 'ember-string'; | ||
import createStringHelperFunction from '../-private/create-string-helper'; | ||
|
||
export function dasherize([string]) { | ||
string = string || ''; | ||
return _dasherize(string); | ||
} | ||
|
||
export const dasherize = createStringHelperFunction(_dasherize); | ||
export default helper(dasherize); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
import { helper } from 'ember-helper'; | ||
import { underscore as _underscore } from 'ember-string'; | ||
import createStringHelperFunction from '../-private/create-string-helper'; | ||
|
||
export function underscore([string]) { | ||
string = string || ''; | ||
return _underscore(string); | ||
} | ||
|
||
export const underscore = createStringHelperFunction(_underscore); | ||
export default helper(underscore); |