Skip to content

Add code to handle replacing $eye variables in case the eyes are not …#43

Merged
piuccio merged 2 commits intopiuccio:masterfrom
jasonkhanlar:eyes
Nov 5, 2018
Merged

Add code to handle replacing $eye variables in case the eyes are not …#43
piuccio merged 2 commits intopiuccio:masterfrom
jasonkhanlar:eyes

Conversation

@jasonkhanlar
Copy link
Copy Markdown
Contributor

Add code to handle replacing $eye variables in case the eyes are not adjacent to each other

@jasonkhanlar
Copy link
Copy Markdown
Contributor Author

Note, the /g in the regex is not included, so that only the first instance of $eye is replaced with the first character of $eyes, and second instance of $eye is replaced with the second character of $eyes.

Comment thread lib/replacer.js Outdated
@@ -1,5 +1,7 @@
module.exports = function (cow, variables) {
var eyes = escapeRe(variables.eyes);
var eyeL = eyes.substr(0,1);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@piuccio
Copy link
Copy Markdown
Owner

piuccio commented Nov 2, 2018

Looks good, I was wondering if we should support any number of eyes but I guess all files have 2 eyes

@piuccio piuccio merged commit df5cdf6 into piuccio:master Nov 5, 2018
ofarukcaki pushed a commit to ofarukcaki/cowsay that referenced this pull request Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants