Skip to content

Commit

Permalink
feat: ability to count characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Faf4a committed Oct 26, 2023
1 parent 1614826 commit b55a541
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/functions/util/charCount.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module.exports = async d => {
const data = d.util.aoiFunc(d);
module.exports = async (d) => {
const data = d.util.aoiFunc(d);
const [text, find] = data.inside.splits;

const [text = d.args.join(" ")] = data.inside.splits;
data.result = find
? (text.split(find).length - 1) * find.length
: text.length;

data.result = text.addBrackets().length

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

0 comments on commit b55a541

Please sign in to comment.