Open dengjeffrey opened 5 years ago
Previous implementation of String.endsWith(str, substr) returns false if the the string provided contained more than one instance of the substring.
String.endsWith(str, substr)
This PR tries to solve this problem by comparing the suffix of the original string against the substring the user is looking for.
This PR does not use String.endsWith added in ECMA6, so that targaryen is still compatible with node 4
String.endsWith
Added edge case test to string-methods.js test spec
string-methods.js
Coverage increased (+0.004%) to 95.408% when pulling 5a6c6975b591ef650f7be458f19f648e7d140de2 on dengjeffrey:fix/string-endsWith into e4151e75642ea6383e41278c09b1eb02984abadc on goldibex:master.
What does this PR try to solve:
Previous implementation of
String.endsWith(str, substr)
returns false if the the string provided contained more than one instance of the substring.This PR tries to solve this problem by comparing the suffix of the original string against the substring the user is looking for.
This PR does not use
String.endsWith
added in ECMA6, so that targaryen is still compatible with node 4Testing
Added edge case test to
string-methods.js
test spec