Skip to content

Adding a bunch of new helpers & re-arrange exports

Choose a tag to compare

@thetutlage thetutlage released this 07 Feb 19:46

Breaking Changes

The version 3.0 re-format the exports to expose an "helpers" subpath to be used within the AdonisJS apps as well.

The idea is to separate helpers that we need to share with AdonisJS core inside its own module, accessible as ‌@poppinss/utils/build/helpers.

Inside helpers subpath

Following modules are now moved to a subpath.

  • MessageBuilder
  • base64
  • compose
  • fsReadAll
  • interpolate
  • requireAll
  • resolveDir
  • resolveFrom
// Earlier
import {
  MessageBuilder,
  base64,
  compose,
  fsReadAll,
  interpolate,
  requireAll,
  resolveDir,
  resolveFrom,
  safeEqual
} from '@poppinss/utils'

// After version 3.0
import {
  MessageBuilder,
  base64,
  compose,
  fsReadAll,
  interpolate,
  requireAll,
  resolveDir,
  resolveFrom,
  safeEqual
} from '@poppinss/utils/build/helpers'

randomString

The randomString is now part of the string helpers.

// Earlier
import { randomString } from '@poppinss/utils'
randomString(32)

// After version 3.0
import { string } from '@poppinss/utils/build/helpers'
string.generateRandom(32)

lodash

The following lodash functions have been removed with new alternatives.

  • snakeCase
  • camelCase
  • startCase
// Earlier
import { lodash } from '@poppinss/utils'

lodash.snakeCase()
lodash.camelCase()
lodash.startCase()

// After version 3.0
import { string } from '@poppinss/utils/build/helpers'

string.snakeCase()
string.camelCase()
string.titleCase()

Commits

  • chore: generate lodash builder before typescript build 0c2575b
  • docs(README): fix typos 754e087
  • feat: adding bunch of new helpers and reformatting exports 081029e
  • chore: remove redundant typedoc.js file 82baa6f
  • style: fix linter errors 3cee2df
  • chore: reformat source files fec4cd4
  • chore: remove npm-audit hook in favor of synk 18b32b4

v2.5.10...v3.0.0