mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 00:27:50 +00:00
wip: code formatting nits
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user