Skip to content

Commit

Permalink
fix: update params for count-where, truncate, count-substrings
Browse files Browse the repository at this point in the history
  • Loading branch information
rajasegar committed May 20, 2020
1 parent e70a5c8 commit bd355c9
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 51 deletions.
4 changes: 2 additions & 2 deletions addon/helpers/voca-count-substrings.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { countSubstrings } from 'voca';

export default helper(function vocaCountSubstrings(params/*, hash */ ) {
return countSubstrings(params[0]);
export default helper(function vocaCountSubstrings(params ) {
return countSubstrings(params[0], params[1]);
});
4 changes: 2 additions & 2 deletions addon/helpers/voca-count-where.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { countWhere } from 'voca';

export default helper(function vocaCountWhere(params/*, hash */ ) {
return countWhere(params[0]);
export default helper(function vocaCountWhere(params) {
return countWhere(params[0], params[1]);
});
4 changes: 2 additions & 2 deletions addon/helpers/voca-grapheme-at.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { graphemeAt } from 'voca';

export default helper(function vocaGraphemeAt(params/*, hash */ ) {
return graphemeAt(params[0]);
export default helper(function vocaGraphemeAt(params) {
return graphemeAt(params[0], params[1]);
});
4 changes: 2 additions & 2 deletions addon/helpers/voca-truncate.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { truncate } from 'voca';

export default helper(function vocaTruncate(params/*, hash */ ) {
return truncate(params[0]);
export default helper(function vocaTruncate(params) {
return truncate(params[0], params[1], params[2]);
});
3 changes: 2 additions & 1 deletion tests/dummy/app/templates/application.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<div id="container">
<div id="sidebar">
<h2>ember-voca <span>v1.0.0</span></h2>
<h2>ember-voca <span>v1.0.2</span></h2>
<nav>
<ul>
<li><LinkTo @route="index">Home</LinkTo></li>
<li><a href="https://github.com/rajasegar/ember-voca">Github</a></li>
<li><a href="https://vocajs.com/">voca.js</a></li>
</ul>
</nav>

Expand Down
10 changes: 5 additions & 5 deletions tests/dummy/app/templates/voca-count-substrings.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h3>voca-count-substrings:</h3>
<p>Description for voca-count-substrings goes here.</p>
<hr>
<p>Counts the number of substring appearances in subject.</p>
<p>
<code>
\{{ voca-count-substrings "hello world"}}
<code>
\{{ voca-count-substrings "bad boys, bad boys whatcha gonna do?" "boys"}}
</code>
</p>
<p>
<code>
// => {{ voca-count-substrings "hello world"}}
// => {{ voca-count-substrings "bad boys, bad boys whatcha gonna do?" "boys"}}
</code>
</p>
18 changes: 9 additions & 9 deletions tests/dummy/app/templates/voca-count-where.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h3>voca-count-where:</h3>
<p>Description for voca-count-where goes here.</p>
<p>
<h3>voca-count-where:</h3>
<hr>
<p>Counts the characters in subject for which predicate returns truthy.</p>
<p>
<code>
\{{ voca-count-where "hello world"}}
\{{ voca-count-where "hola" (voca-is-alpha)}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-count-where "hello world"}}
// => {{ voca-count-where "hola" (voca-is-alpha)}}
</code>
</p>
</p>
14 changes: 7 additions & 7 deletions tests/dummy/app/templates/voca-count-words.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h3>voca-count-words:</h3>
<p>Description for voca-count-words goes here.</p>
<p>
<h3>voca-count-words:</h3>
<hr>
<p>Count the number of words</p>
<p>
<code>
\{{ voca-count-words "hello world"}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-count-words "hello world"}}
</code>
</p>
</p>
4 changes: 2 additions & 2 deletions tests/dummy/app/templates/voca-count.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<h3>voca-count:</h3>
<p>Description for voca-count goes here.</p>
<hr>
<p>Count the characters</p>
<p>
<code>
\{{ voca-count "hello world"}}
Expand Down
18 changes: 9 additions & 9 deletions tests/dummy/app/templates/voca-grapheme-at.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

<h3>voca-grapheme-at:</h3>
<p>Description for voca-grapheme-at goes here.</p>
<p>
<h3>voca-grapheme-at:</h3>
<hr>
<p></p>
<p>
<code>
\{{ voca-grapheme-at "hello world"}}
\{{ voca-grapheme-at '\uD835\uDC00\uD835\uDC01' 0}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-grapheme-at "hello world"}}
// => {{ voca-grapheme-at "\uD835\uDC00\uD835\uDC01" 0}}
</code>
</p>
</p>
2 changes: 1 addition & 1 deletion tests/dummy/app/templates/voca-substr.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3>voca-substr:</h3>
<hr>
<p>Description for voca-substr goes here.</p>
<p>Extracts from subject a string from start position a number of length characters.</p>
<p>
<code>
\{{ voca-substr "infinite loop" 9}}
Expand Down
38 changes: 29 additions & 9 deletions tests/dummy/app/templates/voca-truncate.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@

<h3>voca-truncate:</h3>
<p>Description for voca-truncate goes here.</p>
<p>
<h3>voca-truncate:</h3>
<hr>
<p>Truncates subject to a new length.</p>
<p>
<code>
\{{ voca-truncate "hello world"}}
\{{ voca-truncate "Once upon a time" 7}}
</code>
</p>
<p>
</p>
<p>
<code>
// => {{ voca-truncate "hello world"}}
// => {{ voca-truncate "Once upon a time" 7}}
</code>
</p>
</p>
<p>
<code>
\{{ voca-truncate "Good day, Little Red Riding Hood" 14 "(...)"}}
</code>
</p>
<p>
<code>
// => {{ voca-truncate "Good day, Little Red Riding Hood" 14 "(...)"}}
</code>
</p>
<p>
<code>
\{{ voca-truncate "Once upon" 10}}
</code>
</p>
<p>
<code>
// => {{ voca-truncate "Once upon" 10}}
</code>
</p>

0 comments on commit bd355c9

Please sign in to comment.