Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions manifests/micro-utilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,12 @@
"description": "You can define a self-overwriting getter that computes the value on first access and then replaces itself with a plain data property using `Object.defineProperty`.",
"example": "const obj = {\n get prop() {\n const value = computeExpensiveValue();\n Object.defineProperty(this, 'prop', { value, writable: true, configurable: true, enumerable: true });\n return value;\n }\n};"
},
"snippet::lcm": {
"id": "snippet::lcm",
"type": "simple",
"description": "You can compute the least common multiple by dividing the product of two integers by their greatest common divisor (found with the Euclidean algorithm), and reduce over the inputs for more than two values.",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your agent seems to mistakingly think we care what algorithm was used. let's remove that unnecessary information

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the algorithm wording in c11ce37 and trimmed the PR description. Noted on reading the diff before opening PRs, thanks.

"example": "const gcd = (a, b) => (b === 0 ? Math.abs(a) : gcd(b, a % b))\nconst lcm = (...values) => values.reduce((a, b) => (a === 0 || b === 0 ? 0 : Math.abs((a / gcd(a, b)) * b)))"
},
"snippet::math-random": {
"id": "snippet::math-random",
"type": "simple",
Expand Down Expand Up @@ -843,6 +849,11 @@
"moduleName": "collapse-white-space",
"replacements": ["snippet::collapse-whitespace"]
},
"compute-lcm": {
"type": "module",
"moduleName": "compute-lcm",
"replacements": ["snippet::lcm"]
},
"comver-to-semver": {
"type": "module",
"moduleName": "comver-to-semver",
Expand Down