Skip to content

Commit

Permalink
Documentation polish
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Jan 19, 2016
1 parent 254d20a commit 39fe5c2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions documentation/assertions/function/to-be-valid-for-all.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,19 @@ if that code also fulfill our round trip test:

```js
function rleEncode(input) {
var encoding = [];
input.match(/(.)\1*/g).forEach(function(substr){
encoding.push([substr.length, substr[0]]);
});
return encoding;
var encoding = [];
input.match(/(.)\1*/g).forEach(function(substr){
encoding.push([substr.length, substr[0]]);
});
return encoding;
}

function rleDecode(encoded) {
var output = "";
encoded.forEach(function(pair){ output += new Array(1+pair[0]).join(pair[1]) });
return output;
var output = "";
encoded.forEach(function(pair){
output += new Array(1+pair[0]).join(pair[1]);
});
return output;
}

expect(function (text) {
Expand Down

0 comments on commit 39fe5c2

Please sign in to comment.