Skip to content

Conversation

ejanusevicius
Copy link
Contributor

@ejanusevicius ejanusevicius commented Sep 4, 2025

Affected Components

  • Content & Marketing
  • Pricing
  • Test
  • Docs
  • Learn
  • Other

Pre-Requisites

  • Code is linted (npm run lint)

Notes for the Reviewer

Fixes the typo where docs state that the $RANDOM_NUMBER helper generates a value between 0 and 1000 (it's actually 0 to 10000).

Below is the actual code (handlebars.registerHelper('$RANDOM_NUMBER', () => random(0, 10000))):

const create = () => {
  const handlebars = Handlebars.create()
  handlebars.registerHelper('$RANDOM_NUMBER', () => random(0, 10000))
  handlebars.registerHelper('$UUID', () => v4())
  handlebars.registerHelper(helpers(['comparison', 'date']))
  handlebars.registerHelper('split', (string, separator, index = -1) => {
    if (index === -1) {
      return string.split(separator);
    }
    return string.split(separator)[index];
  })
  return handlebars
}

const handlebars = create()

export default {...handlebars, create }

Copy link

vercel bot commented Sep 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
checklyhq-com Ready Ready Preview Comment Sep 4, 2025 8:19am

@ejanusevicius ejanusevicius changed the title fix: update randomnumber values fix: update $RANDOM_NUMBER values Sep 4, 2025
@ejanusevicius ejanusevicius merged commit 37469a5 into main Sep 4, 2025
6 checks passed
@ejanusevicius ejanusevicius deleted the edvinas/update-randomnumber-docs branch September 4, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants