@dicebear/core 5.0.0-alpha.32 → 5.0.0-alpha.33

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/lib/schema.js CHANGED
@@ -1,71 +1,58 @@
1
1
  export const schema = {
2
2
  type: 'object',
3
3
  $schema: 'http://json-schema.org/draft-07/schema#',
4
- title: 'Options',
5
4
  properties: {
6
5
  seed: {
7
6
  type: 'string',
8
- examples: ['Jane Doe', 'John Doe'],
9
7
  },
10
8
  flip: {
11
9
  type: 'boolean',
12
10
  default: false,
13
- examples: [true, false],
14
11
  },
15
12
  rotate: {
16
13
  type: 'integer',
17
14
  minimum: 0,
18
15
  maximum: 360,
19
16
  default: 0,
20
- examples: [0, 45, 90, 135, 180, 225, 270, 315],
21
17
  },
22
18
  scale: {
23
19
  type: 'integer',
24
20
  minimum: 0,
25
21
  maximum: 200,
26
22
  default: 100,
27
- examples: [50, 100, 150],
28
23
  },
29
24
  radius: {
30
25
  type: 'integer',
31
26
  minimum: 0,
32
27
  maximum: 50,
33
28
  default: 0,
34
- examples: [0, 10, 20, 30, 40, 50],
35
29
  },
36
30
  size: {
37
31
  type: 'integer',
38
32
  minimum: 1,
39
- examples: [128, 256, 512, 1024],
40
33
  },
41
34
  backgroundColor: {
42
35
  type: 'array',
43
- uniqueItems: true,
44
36
  items: {
45
37
  type: 'string',
46
- pattern: '^#([a-fA-F0-9]{3}|[a-fA-F0-9]{4}|[a-fA-F0-9]{6}|[a-fA-F0-9]{8})$',
38
+ pattern: '^[a-fA-F0-9]{6}$',
47
39
  },
48
- examples: ['ffd5dc', 'ffdfbf', 'c0eade', 'b6e3f4', 'd1d4f9'],
49
40
  },
50
41
  translateX: {
51
42
  type: 'integer',
52
43
  minimum: -100,
53
44
  maximum: 100,
54
45
  default: 0,
55
- examples: [-50, -25, 0, 25, 50],
56
46
  },
57
47
  translateY: {
58
48
  type: 'integer',
59
49
  minimum: -100,
60
50
  maximum: 100,
61
51
  default: 0,
62
- examples: [-50, -25, 0, 25, 50],
63
52
  },
64
53
  clip: {
65
54
  type: 'boolean',
66
55
  default: true,
67
- examples: [true, false],
68
56
  },
69
57
  },
70
- additionalProperties: false,
71
58
  };
package/lib/utils/prng.js CHANGED
@@ -14,11 +14,7 @@ function hashSeed(seed) {
14
14
  }
15
15
  return hash;
16
16
  }
17
- function randomSeed() {
18
- return MIN + Math.floor((MAX - MIN) * Math.random()).toString();
19
- }
20
- export function create(seed) {
21
- seed = seed !== null && seed !== void 0 ? seed : randomSeed();
17
+ export function create(seed = '') {
22
18
  let value = hashSeed(seed) || 1;
23
19
  const next = () => (value = xorshift(value));
24
20
  const integer = (min, max) => {
package/lib/utils/svg.js CHANGED
@@ -15,9 +15,7 @@ export function getViewBox(result) {
15
15
  }
16
16
  export function addBackgroundColor(result, backgroundColor) {
17
17
  let { width, height, x, y } = getViewBox(result);
18
- backgroundColor =
19
- backgroundColor[0] === '#' ? backgroundColor : `#${backgroundColor}`;
20
- return `<rect fill="${backgroundColor}" width="${width}" height="${height}" x="${x}" y="${y}" />${result.body}`;
18
+ return `<rect fill="#${backgroundColor}" width="${width}" height="${height}" x="${x}" y="${y}" />${result.body}`;
21
19
  }
22
20
  export function addScale(result, scale) {
23
21
  let { width, height, x, y } = getViewBox(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "5.0.0-alpha.32",
3
+ "version": "5.0.0-alpha.33",
4
4
  "description": "An avatar library for designers and developers.",
5
5
  "keywords": [
6
6
  "avatar",
@@ -31,7 +31,7 @@
31
31
  "test": "uvu tests"
32
32
  },
33
33
  "dependencies": {
34
- "@dicebear/converter": "^5.0.0-alpha.32",
34
+ "@dicebear/converter": "^5.0.0-alpha.33",
35
35
  "@types/json-schema": "^7.0.7"
36
36
  },
37
37
  "devDependencies": {
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "5a4a06cbb8aca42a5d19da8e704b3a7b3a45d755"
49
+ "gitHead": "88548ee882858c8871c477d83c3ed0bd227c64b0"
50
50
  }