Skip to content

Commit

Permalink
fix: add params for insert, pad, pad-left, pad-right
Browse files Browse the repository at this point in the history
  • Loading branch information
rajasegar committed Jun 1, 2020
1 parent e84c453 commit b29ad4e
Show file tree
Hide file tree
Showing 14 changed files with 227 additions and 133 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
/package.json.ember-try

.DS_Store
pnpm-debug.log
8 changes: 4 additions & 4 deletions addon/helpers/voca-insert.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { helper } from '@ember/component/helper';
import { insert } from 'voca';
import { helper } from "@ember/component/helper";
import { insert } from "voca";

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

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

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

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

export default helper(function vocaSearch(params/*, hash */ ) {
return search(params[0]);
export default helper(function vocaSearch(params /*, hash */) {
return search(params[0], params[1]);
});
40 changes: 20 additions & 20 deletions tests/dummy/app/templates/voca-camel-case.hbs
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
<h3>voca-camel-case:</h3>
<p>Converts the argument to camel case.</p>
<p>
<h3>voca-camel-case:</h3>
<p>Converts the argument to camel case.</p>
<p>
<pre class="language-handlebars">
<code class="language-handlebars">
\{{ voca-camel-case "bird flight"}}
</code>
</pre>

</p>
<p>
<code>
</p>
<p>
<code>
// => {{ voca-camel-case "bird flight"}}
</code>
</p>
</code>
</p>

<p>
<p>
<pre class="language-handlebars">
<code class="language-handlebars">
\{{ voca-camel-case "BirdFlight"}}
</code>
</pre>

</p>
<p>
<code>
</p>
<p>
<code>
// => {{ voca-camel-case "BirdFlight"}}
</code>
</p>
</code>
</p>


<p>
<p>
<pre class="language-handlebars">
<code class="language-handlebars">
\{{ voca-camel-case "-BIRD-FLIGHT-"}}
</code>
</pre>

</p>
<p>
<code>
</p>
<p>
<code>
// => {{ voca-camel-case "-BIRD-FLIGHT-"}}
</code>
</p>
</code>
</p>

29 changes: 14 additions & 15 deletions tests/dummy/app/templates/voca-capitalize.hbs
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@

<h3>voca-capitalize:</h3>
<p>Converts the first character of the argument to upper case. If the second argument is true, convert the rest of subject to lower case.</p>
<p>
<h3>voca-capitalize:</h3>
<p>Converts the first character of the argument to upper case. If the second argument is true, convert the rest of subject to lower case.</p>
<p>
<pre class="language-handlebars">
<code class="language-handlebars">
\{{ voca-capitalize "apple"}}
</code>
</pre>

</p>
<p>
<code>
</p>
<p>
<code>
// => {{ voca-capitalize "apple"}}
</code>
</p>
</code>
</p>

<p>
<p>
<pre class="language-handlebars">
<code class="language-handlebars">
\{{ voca-capitalize "aPPle" true}}
</code>
</pre>

</p>
<p>
<code>
</p>
<p>
<code>
// => {{ voca-capitalize "aPPle" true}}
</code>
</p>
</code>
</p>
35 changes: 22 additions & 13 deletions tests/dummy/app/templates/voca-insert.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@

<h3>voca-insert:</h3>
<p>Description for voca-insert goes here.</p>
<p>
<code>
\{{ voca-insert "hello world"}}
</code>
</p>
<p>
<code>
// => {{ voca-insert "hello world"}}
</code>
</p>
<h3>voca-insert:</h3>
<p>Inserts into subject a string toInsert at specified position</p>
<p>
<code>
\{{ voca-insert "ct" "a" 1}}
</code>
</p>
<p>
<code>
// => {{ voca-insert "ct" "a" 1}}
</code>
</p>
<p>
<code>
\{{ voca-insert "sunny" "day" 5}}
</code>
</p>
<p>
<code>
// => {{ voca-insert "sunny" "day" 5}}
</code>
</p>
45 changes: 32 additions & 13 deletions tests/dummy/app/templates/voca-latinise.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@

<h3>voca-latinise:</h3>
<p>Description for voca-latinise goes here.</p>
<p>
<code>
\{{ voca-latinise "hello world"}}
</code>
</p>
<p>
<code>
// => {{ voca-latinise "hello world"}}
</code>
</p>
<h3>voca-latinise:</h3>
<p>Latinises the subject by removing diacritic characters.</p>
<p>
<code>
\{{ voca-latinise "cafe\u0301"}}
</code>
</p>
<p>
<code>
// => {{ voca-latinise "cafe\u0301"}}
</code>
</p>
<p>
<code>
\{{ voca-latinise "août décembre"}}
</code>
</p>
<p>
<code>
// => {{ voca-latinise "août décembre"}}
</code>
</p>
<p>
<code>
\{{ voca-latinise "как прекрасен этот мир"}}
</code>
</p>
<p>
<code>
// => {{ voca-latinise "как прекрасен этот мир"}}
</code>
</p>
45 changes: 32 additions & 13 deletions tests/dummy/app/templates/voca-pad-left.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@

<h3>voca-pad-left:</h3>
<p>Description for voca-pad-left goes here.</p>
<p>
<code>
\{{ voca-pad-left "hello world"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-left "hello world"}}
</code>
</p>
<h3>voca-pad-left:</h3>
<p>Pads subject from left to a new length</p>
<p>
<code>
\{{ voca-pad-left "dog" 5}}
</code>
</p>
<p>
<code>
// => '{{ voca-pad-left "dog" 5}}'
</code>
</p>
<p>
<code>
\{{ voca-pad-left "bird" 6 "-"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-left "bird" 6 "-"}}
</code>
</p>
<p>
<code>
\{{ voca-pad-left "cat" 6 "-="}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-left "cat" 6 "-="}}
</code>
</p>
45 changes: 32 additions & 13 deletions tests/dummy/app/templates/voca-pad-right.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@

<h3>voca-pad-right:</h3>
<p>Description for voca-pad-right goes here.</p>
<p>
<code>
\{{ voca-pad-right "hello world"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-right "hello world"}}
</code>
</p>
<h3>voca-pad-right:</h3>
<p>Pads subject from right to a new length.</p>
<p>
<code>
\{{ voca-pad-right "dog" 5}}
</code>
</p>
<p>
<code>
// => '{{ voca-pad-right "dog" 5}}'
</code>
</p>
<p>
<code>
\{{ voca-pad-right "bird" 6 "-"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-right "bird" 6 "-"}}
</code>
</p>
<p>
<code>
\{{ voca-pad-right "cat" 6 "-="}}
</code>
</p>
<p>
<code>
// => {{ voca-pad-right "cat" 6 "-="}}
</code>
</p>
45 changes: 32 additions & 13 deletions tests/dummy/app/templates/voca-pad.hbs
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@

<h3>voca-pad:</h3>
<p>Description for voca-pad goes here.</p>
<p>
<code>
\{{ voca-pad "hello world"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad "hello world"}}
</code>
</p>
<h3>voca-pad:</h3>
<p>Pads subject to a new length</p>
<p>
<code>
\{{ voca-pad "dog" 5}}
</code>
</p>
<p>
<code>
// => '{{ voca-pad "dog" 5}}'
</code>
</p>
<p>
<code>
\{{ voca-pad "bird" 6 "-"}}
</code>
</p>
<p>
<code>
// => {{ voca-pad "bird" 6 "-"}}
</code>
</p>
<p>
<code>
\{{ voca-pad "cat" 6 "-="}}
</code>
</p>
<p>
<code>
// => {{ voca-pad "cat" 6 "-="}}
</code>
</p>
Loading

0 comments on commit b29ad4e

Please sign in to comment.