human-ids 1.0.10 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [1.0.11] - 2023-07-07
8
+
9
+ ### Fixed
10
+ - Fixed bug with custom dictionaries
7
11
  ## [1.0.10] - 2023-07-07
8
12
 
9
13
  ### Added
package/index.d.ts CHANGED
@@ -12,13 +12,13 @@ declare module 'human-ids' {
12
12
  completeWithZeros?: boolean;
13
13
  };
14
14
  dictionary?: {
15
- adjectives?: {
15
+ adjectives: {
16
16
  [key: string]: string[];
17
17
  };
18
- colors?: {
18
+ colors: {
19
19
  [key: string]: string[];
20
20
  };
21
- nouns?: {
21
+ nouns: {
22
22
  [key: string]: string[];
23
23
  }
24
24
  };
package/index.js CHANGED
@@ -40,15 +40,15 @@ function generateId(userSettings = {}) {
40
40
  }
41
41
 
42
42
  function getAdjectives() {
43
- return settings.dictionary && settings.dictionary.adjectives ? settings.dictionary.adjectives : {};
43
+ return settings.dictionary && settings.dictionary.adjectives ? settings.dictionary.adjectives : dictionaries[lang].adjectives;
44
44
  }
45
45
 
46
46
  function getColors() {
47
- return settings.dictionary && settings.dictionary.colors ? settings.dictionary.colors : {};
47
+ return settings.dictionary && settings.dictionary.colors ? settings.dictionary.colors : dictionaries[lang].colors;
48
48
  }
49
49
 
50
50
  function getNouns() {
51
- return settings.dictionary && settings.dictionary.nouns ? settings.dictionary.nouns : {};
51
+ return settings.dictionary && settings.dictionary.nouns ? settings.dictionary.nouns : dictionaries[lang].nouns;
52
52
  }
53
53
 
54
54
  const parts = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "human-ids",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "A library to generate human readable IDs",
5
5
  "main": "index.js",
6
6
  "scripts": {