NEAR-Edu / near-certification-tools

2 stars 2 forks source link

refactored: wrapText function #24

Closed norrec99 closed 2 years ago

norrec99 commented 2 years ago

Refactored wrapText function by using regex

source: https://stackoverflow.com/a/51506718

Closes #22

ryancwalsh commented 2 years ago

@norrec99 Good job finding a better way to wrap text. Take a look at https://github.com/NEAR-Edu/near-certification-tools/pull/24/commits/8d26059b4f3ad49106b4138222933a7cae3742bc and see why I chose the dynamic option. It makes our wrapText function more flexible (instead of hard-coding 60 inside it).

Also look at my commit message. It's always good to reference the number of the GitHub issue that your commit fixes because then GitHub automatically adds a note like this:

image

https://github.com/NEAR-Edu/near-certification-tools/issues/22