@noeldemartin/solid-utils 0.2.0-next.ebb53edb2f1f27bc44c4c5ebd38761a0b30d3408 → 0.3.0-next.a444b642b5ee2c1d412a667cb87b853b85115b98
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 +35 -0
- package/dist/noeldemartin-solid-utils.cjs.js +1 -1
- package/dist/noeldemartin-solid-utils.cjs.js.map +1 -1
- package/dist/noeldemartin-solid-utils.d.ts +1 -1
- package/dist/noeldemartin-solid-utils.esm.js +1 -1
- package/dist/noeldemartin-solid-utils.esm.js.map +1 -1
- package/dist/noeldemartin-solid-utils.umd.js +1 -1
- package/dist/noeldemartin-solid-utils.umd.js.map +1 -1
- package/package.json +5 -4
- package/src/helpers/auth.ts +6 -2
- package/src/testing/faking.ts +1 -1
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noeldemartin/solid-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-next.a444b642b5ee2c1d412a667cb87b853b85115b98",
|
|
4
4
|
"description": "My JavaScript utilities for Solid",
|
|
5
5
|
"main": "dist/noeldemartin-solid-utils.cjs.js",
|
|
6
6
|
"module": "dist/noeldemartin-solid-utils.esm.js",
|
|
7
7
|
"browser": "dist/noeldemartin-solid-utils.umd.js",
|
|
8
8
|
"types": "dist/noeldemartin-solid-utils.d.ts",
|
|
9
|
+
"sideEffects": false,
|
|
9
10
|
"scripts": {
|
|
10
11
|
"build": "rm dist -rf && npm run build:js && npm run build:types",
|
|
11
12
|
"build:js": "noeldemartin-build-javascript",
|
|
@@ -30,9 +31,9 @@
|
|
|
30
31
|
"homepage": "https://github.com/noeldemartin/solid-utils",
|
|
31
32
|
"dependencies": {
|
|
32
33
|
"@babel/runtime": "^7.14.0",
|
|
33
|
-
"@
|
|
34
|
-
"@noeldemartin/solid-utils-external": "^0.1.
|
|
35
|
-
"@noeldemartin/utils": "^0.
|
|
34
|
+
"@noeldemartin/faker": "^7.6.0",
|
|
35
|
+
"@noeldemartin/solid-utils-external": "^0.1.1",
|
|
36
|
+
"@noeldemartin/utils": "^0.4.0",
|
|
36
37
|
"@types/rdf-js": "^4.0.1",
|
|
37
38
|
"core-js": "^3.12.1",
|
|
38
39
|
"jest-diff": "^26.6.2",
|
package/src/helpers/auth.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { Fetch } from './io';
|
|
|
9
9
|
|
|
10
10
|
export interface SolidUserProfile {
|
|
11
11
|
webId: string;
|
|
12
|
-
storageUrls: string[];
|
|
12
|
+
storageUrls: [string, ...string[]];
|
|
13
13
|
cloaked: boolean;
|
|
14
14
|
writableProfileUrl: string | null;
|
|
15
15
|
name?: string;
|
|
@@ -106,11 +106,15 @@ async function fetchUserProfile(webId: string, fetch?: Fetch): Promise<SolidUser
|
|
|
106
106
|
parentUrl = urlParentDirectory(parentUrl);
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
if (storageUrls.length === 0) {
|
|
110
|
+
throw new Error(`Could not find any storage for ${webId}.`);
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
return {
|
|
110
114
|
webId,
|
|
111
115
|
cloaked,
|
|
112
116
|
writableProfileUrl,
|
|
113
|
-
storageUrls: arrayUnique(storageUrls),
|
|
117
|
+
storageUrls: arrayUnique(storageUrls) as [string, ...string[]],
|
|
114
118
|
...objectWithoutEmpty({
|
|
115
119
|
name:
|
|
116
120
|
store.statement(webId, 'vcard:fn')?.object.value ??
|
package/src/testing/faking.ts
CHANGED