Skip to content

Commit

Permalink
Merge pull request #288 from dcastil/breaking-feature/155/remove-depr…
Browse files Browse the repository at this point in the history
…ecated-exports

Remove deprecated exports
  • Loading branch information
dcastil authored Aug 19, 2023
2 parents f31447b + a4134f1 commit cb8fabe
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
7 changes: 0 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { twJoin } from './lib/tw-join'

export { createTailwindMerge } from './lib/create-tailwind-merge'
export { getDefaultConfig } from './lib/default-config'
export { extendTailwindMerge } from './lib/extend-tailwind-merge'
Expand All @@ -9,8 +7,3 @@ export { twJoin, type ClassNameValue } from './lib/tw-join'
export { twMerge } from './lib/tw-merge'
export type { Config } from './lib/types'
export * as validators from './lib/validators'

/**
* @deprecated Will be removed in next major version. Use `twJoin` instead.
*/
export const join = twJoin
5 changes: 0 additions & 5 deletions src/lib/validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ export function isArbitraryNumber(value: string) {
return getIsArbitraryValue(value, 'number', isNumber)
}

/**
* @deprecated Will be removed in next major version. Use `isArbitraryNumber` instead.
*/
export const isArbitraryWeight = isArbitraryNumber

export function isNumber(value: string) {
return !Number.isNaN(Number(value))
}
Expand Down
13 changes: 1 addition & 12 deletions tests/public-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
extendTailwindMerge,
fromTheme,
getDefaultConfig,
join,
mergeConfigs,
twJoin,
twMerge,
Expand All @@ -25,7 +24,6 @@ test('has correct export types', () => {
isArbitrarySize: expect.any(Function),
isArbitraryUrl: expect.any(Function),
isArbitraryValue: expect.any(Function),
isArbitraryWeight: expect.any(Function),
isInteger: expect.any(Function),
isLength: expect.any(Function),
isPercent: expect.any(Function),
Expand All @@ -34,7 +32,7 @@ test('has correct export types', () => {
})
expect(mergeConfigs).toStrictEqual(expect.any(Function))
expect(extendTailwindMerge).toStrictEqual(expect.any(Function))
expect(join).toStrictEqual(expect.any(Function))
expect(twJoin).toStrictEqual(expect.any(Function))

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const noRun = () => {
Expand Down Expand Up @@ -149,7 +147,6 @@ test('validators have correct inputs and outputs', () => {
expect(validators.isArbitrarySize('')).toEqual(expect.any(Boolean))
expect(validators.isArbitraryPosition('')).toEqual(expect.any(Boolean))
expect(validators.isArbitraryUrl('')).toEqual(expect.any(Boolean))
expect(validators.isArbitraryWeight('')).toEqual(expect.any(Boolean))
expect(validators.isArbitraryNumber('')).toEqual(expect.any(Boolean))
expect(validators.isArbitraryShadow('')).toEqual(expect.any(Boolean))
})
Expand Down Expand Up @@ -181,14 +178,6 @@ test('fromTheme has correct inputs and outputs', () => {
expect(fromTheme('foo')({ foo: ['hello'] })).toStrictEqual(['hello'])
})

test('join has correct inputs and outputs', () => {
expect(join()).toStrictEqual(expect.any(String))
expect(join('')).toStrictEqual(expect.any(String))
expect(join('', [false, null, undefined, 0, [], [false, [''], '']])).toStrictEqual(
expect.any(String),
)
})

test('twJoin has correct inputs and outputs', () => {
expect(twJoin()).toStrictEqual(expect.any(String))
expect(twJoin('')).toStrictEqual(expect.any(String))
Expand Down

0 comments on commit cb8fabe

Please sign in to comment.