fn-ui-avatars 1.0.2 → 1.0.4
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/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -33,7 +33,7 @@ var DEFAULT_OPTIONS = {
|
|
|
33
33
|
rounded: true,
|
|
34
34
|
color: "fff",
|
|
35
35
|
format: "svg",
|
|
36
|
-
baseUrl: "https://
|
|
36
|
+
baseUrl: "https://ui-avatars.com/api/"
|
|
37
37
|
};
|
|
38
38
|
function hashCode(str) {
|
|
39
39
|
let hash = 0;
|
|
@@ -73,7 +73,7 @@ function getAvatarUrl(name, options = {}) {
|
|
|
73
73
|
].join("&");
|
|
74
74
|
return `${opts.baseUrl}?${query}`;
|
|
75
75
|
}
|
|
76
|
-
function loadAvatars(selector = "img.fn-ui-
|
|
76
|
+
function loadAvatars(selector = "img.fn-ui-avatars", options = {}) {
|
|
77
77
|
if (typeof document === "undefined") {
|
|
78
78
|
throw new Error("fn-ui-avatars: loadAvatars() requires a browser environment.");
|
|
79
79
|
}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var DEFAULT_OPTIONS = {
|
|
|
6
6
|
rounded: true,
|
|
7
7
|
color: "fff",
|
|
8
8
|
format: "svg",
|
|
9
|
-
baseUrl: "https://
|
|
9
|
+
baseUrl: "https://ui-avatars.com/api/"
|
|
10
10
|
};
|
|
11
11
|
function hashCode(str) {
|
|
12
12
|
let hash = 0;
|
|
@@ -46,7 +46,7 @@ function getAvatarUrl(name, options = {}) {
|
|
|
46
46
|
].join("&");
|
|
47
47
|
return `${opts.baseUrl}?${query}`;
|
|
48
48
|
}
|
|
49
|
-
function loadAvatars(selector = "img.fn-ui-
|
|
49
|
+
function loadAvatars(selector = "img.fn-ui-avatars", options = {}) {
|
|
50
50
|
if (typeof document === "undefined") {
|
|
51
51
|
throw new Error("fn-ui-avatars: loadAvatars() requires a browser environment.");
|
|
52
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fn-ui-avatars",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Automatically generate consistent, colorful avatars using UI-Avatars API",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"tsup": "^8.5.1",
|
|
50
50
|
"typescript": "^6.0.3"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|