Skip to content

Commit

Permalink
Merge pull request #7 from tylerturdenpants/master
Browse files Browse the repository at this point in the history
Add substr helper
  • Loading branch information
Chris Honniball authored Dec 12, 2016
2 parents a105562 + 2a8b1ab commit 3420d20
Show file tree
Hide file tree
Showing 5 changed files with 5,349 additions and 381 deletions.
13 changes: 13 additions & 0 deletions addon/helpers/substr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import Ember from 'ember';

export function substr([value, ...rest], hash) {
if (typeof value === 'string') {
let start = hash.start || 0;
let length = hash.length;
return value.substr(start, length);
} else {
return value;
}
}

export default Ember.Helper.helper(substr);
1 change: 1 addition & 0 deletions app/helpers/substr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default, substr } from 'ember-string-helpers/helpers/substr';
Loading

0 comments on commit 3420d20

Please sign in to comment.