@dicebear/core 8.0.1 → 8.0.3

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 Florian Körner
3
+ Copyright (c) 2024 Florian Körner
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/lib/index.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * DiceBear (@dicebear/core)
3
3
  *
4
4
  * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)
5
- * Copyright (c) 2023 Florian Körner
5
+ * Copyright (c) 2024 Florian Körner
6
6
  */
7
7
  import * as license from './utils/license.js';
8
8
  import * as escape from './utils/escape.js';
package/lib/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * DiceBear (@dicebear/core)
3
3
  *
4
4
  * Code licensed under MIT (https://github.com/dicebear/dicebear/blob/main/LICENSE)
5
- * Copyright (c) 2023 Florian Körner
5
+ * Copyright (c) 2024 Florian Körner
6
6
  */
7
7
  import * as license from './utils/license.js';
8
8
  import * as escape from './utils/escape.js';
package/lib/utils/svg.js CHANGED
@@ -15,7 +15,7 @@ export function getViewBox(result) {
15
15
  }
16
16
  export function addBackground(result, primaryColor, secondaryColor, type, rotation) {
17
17
  let { width, height, x, y } = getViewBox(result);
18
- const solidBackground = `<rect fill="${primaryColor}" width="${width}" height="${height}" x="${x}" y="${y}" />`;
18
+ const solidBackground = `<rect fill="${escape.xml(primaryColor)}" width="${width}" height="${height}" x="${x}" y="${y}" />`;
19
19
  switch (type) {
20
20
  case 'solid':
21
21
  return solidBackground + result.body;
@@ -23,8 +23,8 @@ export function addBackground(result, primaryColor, secondaryColor, type, rotati
23
23
  return (`<rect fill="url(#backgroundLinear)" width="${width}" height="${height}" x="${x}" y="${y}" />` +
24
24
  `<defs>` +
25
25
  `<linearGradient id="backgroundLinear" gradientTransform="rotate(${rotation} 0.5 0.5)">` +
26
- `<stop stop-color="${primaryColor}"/>` +
27
- `<stop offset="1" stop-color="${secondaryColor}"/>` +
26
+ `<stop stop-color="${escape.xml(primaryColor)}"/>` +
27
+ `<stop offset="1" stop-color="${escape.xml(secondaryColor)}"/>` +
28
28
  `</linearGradient>` +
29
29
  `</defs>` +
30
30
  result.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dicebear/core",
3
- "version": "8.0.1",
3
+ "version": "8.0.3",
4
4
  "description": "An avatar library for designers and developers.",
5
5
  "keywords": [
6
6
  "avatar",
@@ -32,7 +32,7 @@
32
32
  "test": "uvu tests"
33
33
  },
34
34
  "dependencies": {
35
- "@dicebear/converter": "8.0.1",
35
+ "@dicebear/converter": "8.0.3",
36
36
  "@types/json-schema": "^7.0.11"
37
37
  },
38
38
  "devDependencies": {
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "dc11ff0fa0328c521e5769fde4414ad5a6dc7d2d"
50
+ "gitHead": "65dce7264c16355bc13357706e88e16b7be07b52"
51
51
  }