diff --git a/README.md b/README.md index eac6ed3..60039f7 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ spaceSlug([ | Function | Type | | ---------- | ---------- | -| `digits` | `(count?: number) => (options: SpaceSlugOptions) => string` | +| `digits` | `(count?: number, noConsecutive?: boolean) => (options: SpaceSlugOptions) => string` | ### :gear: cleanString @@ -153,7 +153,7 @@ spaceSlug([ ## :wrench: Constants -- [defaultWords](#gear-defaultwords) +- [spaceSlugDefaultDictionary](#gear-spaceslugdefaultdictionary) - [spaceSlugDefaultOptions](#gear-spaceslugdefaultoptions) - [noun](#gear-noun) - [adjective](#gear-adjective) @@ -164,11 +164,11 @@ spaceSlug([ - [animal](#gear-animal) - [cosmos](#gear-cosmos) -### :gear: defaultWords +### :gear: spaceSlugDefaultDictionary | Constant | Type | | ---------- | ---------- | -| `defaultWords` | `Record>` | +| `spaceSlugDefaultDictionary` | `Record>` | ### :gear: spaceSlugDefaultOptions diff --git a/src/data/emojis.ts b/src/dictionary/emojis.ts similarity index 100% rename from src/data/emojis.ts rename to src/dictionary/emojis.ts diff --git a/src/data/en/adjectives.ts b/src/dictionary/en/adjectives.ts similarity index 100% rename from src/data/en/adjectives.ts rename to src/dictionary/en/adjectives.ts diff --git a/src/data/en/animals.ts b/src/dictionary/en/animals.ts similarity index 100% rename from src/data/en/animals.ts rename to src/dictionary/en/animals.ts diff --git a/src/data/en/colors.ts b/src/dictionary/en/colors.ts similarity index 100% rename from src/data/en/colors.ts rename to src/dictionary/en/colors.ts diff --git a/src/data/en/cosmos.ts b/src/dictionary/en/cosmos.ts similarity index 100% rename from src/data/en/cosmos.ts rename to src/dictionary/en/cosmos.ts diff --git a/src/data/en/index.ts b/src/dictionary/en/index.ts similarity index 100% rename from src/data/en/index.ts rename to src/dictionary/en/index.ts diff --git a/src/data/en/nouns.ts b/src/dictionary/en/nouns.ts similarity index 100% rename from src/data/en/nouns.ts rename to src/dictionary/en/nouns.ts diff --git a/src/data/en/seasons.ts b/src/dictionary/en/seasons.ts similarity index 100% rename from src/data/en/seasons.ts rename to src/dictionary/en/seasons.ts diff --git a/src/data/en/verbs.ts b/src/dictionary/en/verbs.ts similarity index 100% rename from src/data/en/verbs.ts rename to src/dictionary/en/verbs.ts diff --git a/src/index.ts b/src/index.ts index 28bea81..fb1c4e2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,14 +6,14 @@ import { animals, verbs, cosmos as cosmosWords, -} from './data/en'; +} from './dictionary/en'; -import { emojis } from './data/emojis'; +import { emojis } from './dictionary/emojis'; -export * from './data/emojis'; -export * from './data/en'; +export * from './dictionary/emojis'; +export * from './dictionary/en'; -export const defaultWords: Record = { +export const spaceSlugDefaultDictionary: Record = { en: { seasons, emojis, @@ -29,7 +29,7 @@ export const defaultWords: Record = { export const spaceSlugDefaultOptions: Partial = { locale: 'en', separator: '-', - dictionary: defaultWords, + dictionary: spaceSlugDefaultDictionary, }; export type SpaceSlugDictionary = Partial<{ diff --git a/tests/spaceSlug.test.ts b/tests/spaceSlug.test.ts index fb6c25d..84513c9 100644 --- a/tests/spaceSlug.test.ts +++ b/tests/spaceSlug.test.ts @@ -2,7 +2,7 @@ import { describe, it, expect } from 'vitest'; import { spaceSlug, animal, - defaultWords, + spaceSlugDefaultDictionary, digits, noun, word, @@ -85,11 +85,17 @@ describe('spaceSlug', () => { expect(parts).toHaveLength(4); - expect(defaultWords.en.nouns!.includes(parts[0])).toBeTruthy(); + expect( + spaceSlugDefaultDictionary.en.nouns!.includes(parts[0]) + ).toBeTruthy(); - expect(defaultWords.en.nouns!.includes(parts[1])).toBeTruthy(); + expect( + spaceSlugDefaultDictionary.en.nouns!.includes(parts[1]) + ).toBeTruthy(); - expect(defaultWords.en.animals!.includes(parts[2])).toBeTruthy(); + expect( + spaceSlugDefaultDictionary.en.animals!.includes(parts[2]) + ).toBeTruthy(); expect(parts[3]).toHaveLength(3); });