Skip to content

Commit

Permalink
Update stringEndsWith.js
Browse files Browse the repository at this point in the history
  • Loading branch information
baka-aho authored Dec 6, 2023
1 parent 4eaf2aa commit edd6d64
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/functions/util/stringEndsWith.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ module.exports = async d => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);

const [text, check] = data.inside.splits;

data.result = text.addBrackets().endsWith(check.addBrackets());
const [text, ...checks] = data.inside.splits;
const result = checks.some(check => text.addBrackets().endsWith(check.addBrackets()));
data.result = result

return {
code: d.util.setCode(data)
code: d.util.setCode(data)
}
}
}

0 comments on commit edd6d64

Please sign in to comment.