Repository navigation
cyclic-prev.js.org - #12715
cyclic-prev.js.org#12715abhisekp wants to merge 4 commits into
Conversation
# Conflicts: # cnames_active.js
|
✅ All validations passed! Please wait for the JS.org maintainers to process your subdomain request. |
|
@abhisekp I'm not convinced by your content and why so simple functions would need a page and subdomain. Why are you splitting prev and next into two seperated functions, libraries, seperated pages, seperated npm packages. /**
* Move through a cycle of max positions.
* @param {number} max Number of positions (positive safe integer).
* @param {number} [curr=0] Current position.
* @param {number} [step=1] Step size (negative for previous).
* @returns {number} The normalized position in [0, max).
*/
function cyclic(max, curr = 0, step = 1) {
if (!Number.isSafeInteger(max) || max <= 0)
throw new RangeError('max must be a positive safe integer');
if (!Number.isSafeInteger(curr) || !Number.isSafeInteger(step))
throw new TypeError('curr and step must be safe integers');
const mod = n => ((n % max) + max) % max;
return mod(mod(curr) + mod(step));
}
export default cyclic;I mean are you going to request |
MattIPv4
left a comment
There was a problem hiding this comment.
✅ Commit valid, CNAME present, site appears to have content *
* based off https://github.com/abhisekp/cyclic-prev/blob/gh-pages/index.html
|
@MattIPv4 What do you think of this content-wise. It boiles down to: https://github.com/abhisekp/cyclic-prev/blob/master/src/cyclicPrev.js In #12713 we had the same but only |
|
@indus it's trivial but in my experience with the beginners, this is something which they feel very uncomfortable and don't write their own. This is a good one. I thought of publishing this in npm 10 yrs ago back when I published cyclic-next but due to other commitments, I had forgotten. I didn't make it |
|
🤔 What's stopping |
I think in isolation it is fine, which is why I approved, but I can also see how given the context of the previous subdomain, it may make sense to combine it instead. I don't really have super strong feelings either way. |
|
Fine - Welcome https://cyclic-prev.js.org |
|
@abhisekp I've just saw that this PR needs to be rebased before I can merge. I've just added it manually |
Repository: https://github.com/abhisekp/cyclic-prev
npm package: https://www.npmjs.com/package/cyclic-prev
GitHub Pages uses a GitHub Actions deployment and its custom domain has been saved as cyclic-prev.js.org in Pages settings. The source CNAME file and generated gh-pages artifact record the same domain. Assets are local and relative; the site serves its own content at the custom domain without redirecting away from JS.ORG. The GitHub Pages URL may redirect to the requested domain while DNS activation is pending.
This request adds exactly one alphabetically ordered line to cnames_active.js:
"cyclic-prev": "abhisekp.github.io/cyclic-prev", matching the cyclic-next request in #12713.The dedicated add-cyclic-prev branch starts from upstream master and contains only this entry, keeping the existing cyclic-next request in #12713 unchanged.