wip: code formatting nits

This commit is contained in:
jdalton
2023-09-16 16:18:43 -07:00
parent 97d4a2fe19
commit 0b28b7f7b6
107 changed files with 166 additions and 164 deletions

View File

@@ -23,14 +23,14 @@
function endsWith(string, target, position) {
const { length } = string;
position = position === undefined ? length : +position;
if (position < 0 || position != position) {
if (position < 0 || position !== position) {
position = 0;
} else if (position > length) {
position = length;
}
const end = position;
position -= target.length;
return position >= 0 && string.slice(position, end) == target;
return position >= 0 && string.slice(position, end) === target;
}
export default endsWith;