@noeldemartin/solid-utils 0.4.0-next.088119819f89e5ceabdc6c32a91004b4f85c7fd7 → 0.4.0-next.30aceafb9d58f505d02a146d8e81f2e3a041b92f
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/noeldemartin-solid-utils.cjs.js +1 -1
- package/dist/noeldemartin-solid-utils.cjs.js.map +1 -1
- package/dist/noeldemartin-solid-utils.d.ts +0 -20
- 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 +16 -16
- package/dist/noeldemartin-solid-utils.umd.js.map +1 -1
- package/package.json +2 -3
- package/src/helpers/vocabs.ts +1 -0
- package/src/testing/index.ts +0 -1
- package/src/testing/faking.ts +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noeldemartin/solid-utils",
|
|
3
|
-
"version": "0.4.0-next.
|
|
3
|
+
"version": "0.4.0-next.30aceafb9d58f505d02a146d8e81f2e3a041b92f",
|
|
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",
|
|
@@ -31,10 +31,9 @@
|
|
|
31
31
|
"homepage": "https://github.com/noeldemartin/solid-utils",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.14.0",
|
|
34
|
-
"@noeldemartin/faker": "^7.6.0",
|
|
35
34
|
"@noeldemartin/solid-utils-external": "^0.1.1",
|
|
36
35
|
"@noeldemartin/utils": "^0.5.1",
|
|
37
|
-
"@types
|
|
36
|
+
"@rdfjs/types": "^1.1.0",
|
|
38
37
|
"core-js": "^3.12.1",
|
|
39
38
|
"md5": "^2.3.0"
|
|
40
39
|
},
|
package/src/helpers/vocabs.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface ExpandIRIOptions {
|
|
|
8
8
|
const knownPrefixes: RDFContext = {
|
|
9
9
|
acl: 'http://www.w3.org/ns/auth/acl#',
|
|
10
10
|
foaf: 'http://xmlns.com/foaf/0.1/',
|
|
11
|
+
ldp: 'http://www.w3.org/ns/ldp#',
|
|
11
12
|
pim: 'http://www.w3.org/ns/pim/space#',
|
|
12
13
|
purl: 'http://purl.org/dc/terms/',
|
|
13
14
|
rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
|
package/src/testing/index.ts
CHANGED
package/src/testing/faking.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { faker } from '@noeldemartin/faker';
|
|
2
|
-
import { stringToSlug } from '@noeldemartin/utils';
|
|
3
|
-
|
|
4
|
-
export interface ContainerOptions {
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface DocumentOptions extends ContainerOptions {
|
|
9
|
-
containerUrl: string;
|
|
10
|
-
name: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface ResourceOptions extends DocumentOptions {
|
|
14
|
-
documentUrl: string;
|
|
15
|
-
hash: string;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export function fakeContainerUrl(options: Partial<ContainerOptions> = {}): string {
|
|
19
|
-
const containerSlug = stringToSlug(faker.random.word());
|
|
20
|
-
const baseUrl = options.baseUrl ?? faker.internet.url();
|
|
21
|
-
const parentContainerUrl = baseUrl.endsWith('/') ? baseUrl : baseUrl + '/';
|
|
22
|
-
|
|
23
|
-
return parentContainerUrl + containerSlug + '/';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function fakeDocumentUrl(options: Partial<DocumentOptions> = {}): string {
|
|
27
|
-
const containerUrl = options.containerUrl ?? fakeContainerUrl(options);
|
|
28
|
-
const name = options.name ?? faker.random.word();
|
|
29
|
-
|
|
30
|
-
return containerUrl + stringToSlug(name);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export function fakeResourceUrl(options: Partial<ResourceOptions> = {}): string {
|
|
34
|
-
const documentUrl = options.documentUrl ?? fakeDocumentUrl(options);
|
|
35
|
-
const hash = options.hash ?? 'it';
|
|
36
|
-
|
|
37
|
-
return documentUrl + '#' + hash;
|
|
38
|
-
}
|