Skip to content

Commit

Permalink
fix: update parameters for substr helper
Browse files Browse the repository at this point in the history
  • Loading branch information
rajasegar committed May 16, 2020
1 parent 6247bf8 commit 622c3c7
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
- run: npm run lint:js
- run: npm run lint:hbs
- run: npm test
- uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- run: pnpm run lint:js
- run: pnpm run lint:hbs
- run: pnpm test
4 changes: 2 additions & 2 deletions addon/helpers/voca-substr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { substr } from 'voca';

export default helper(function vocaSubstr(params/*, hash */ ) {
return substr(params[0]);
export default helper(function vocaSubstr(params ) {
return substr(params[0], params[1], params[2]);
});
28 changes: 19 additions & 9 deletions tests/dummy/app/templates/voca-substr.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@

<h3>voca-substr:</h3>
<p>Description for voca-substr goes here.</p>
<p>
<h3>voca-substr:</h3>
<hr>
<p>Description for voca-substr goes here.</p>
<p>
<code>
\{{ voca-substr "hello world"}}
\{{ voca-substr "infinite loop" 9}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-substr "hello world"}}
// => {{ voca-substr "infinite loop" 9}}
</code>
</p>
</p>
<p>
<code>
\{{ voca-substr "dreams" 2 2}}
</code>
</p>
<p>
<code>
// => {{ voca-substr "dreams" 2 2}}
</code>
</p>

0 comments on commit 622c3c7

Please sign in to comment.