Skip to content

Commit

Permalink
fix: update substring helpers to have arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
rajasegar committed May 17, 2020
1 parent 622c3c7 commit 5f177a8
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12
- name: Pnpm setup
uses: pnpm/[email protected]
with:
version: 4.11.1
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Build
run: |
npm install
npm run build
pnpm run build
- name: Deploy
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
Expand Down
4 changes: 2 additions & 2 deletions addon/helpers/voca-substring.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { substring } from 'voca';

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

<h3>voca-substring:</h3>
<p>Description for voca-substring goes here.</p>
<p>
<h3>voca-substring:</h3>
<hr>
<p>Extracts from subject a string from start position up to end position. The character at end position is not included.</p>
<p>
<code>
\{{ voca-substring "hello world"}}
\{{ voca-substring "beach" 1}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-substring "hello world"}}
// => {{ voca-substring "beach" 1}}
</code>
</p>
</p>
<p>
<code>
\{{ voca-substring "ocean" 1 3}}
</code>
</p>
<p>
<code>
// => {{ voca-substring "ocean" 1 3}}
</code>
</p>

0 comments on commit 5f177a8

Please sign in to comment.