@comunica/actor-dereference-file 3.0.1-alpha.45.0 → 3.0.1

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/README.md CHANGED
@@ -22,7 +22,7 @@ After installing, this package can be added to your engine's configuration as fo
22
22
  {
23
23
  "@context": [
24
24
  ...
25
- "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-dereference-file/^3.0.0/components/context.jsonld"
25
+ "https://linkedsoftwaredependencies.org/bundles/npm/@comunica/actor-dereference-file/^3.0.0/components/context.jsonld"
26
26
  ],
27
27
  "actors": [
28
28
  ...
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "@context": [
3
- "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^5.0.0/components/context.jsonld",
3
+ "https://linkedsoftwaredependencies.org/bundles/npm/componentsjs/^6.0.0/components/context.jsonld",
4
4
  {
5
5
  "npmd": "https://linkedsoftwaredependencies.org/bundles/npm/",
6
6
  "cadf": "npmd:@comunica/actor-dereference-file/^3.0.0/",
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ActorDereferenceFile = void 0;
4
- const fs_1 = require("fs");
5
- const url_1 = require("url");
4
+ const node_fs_1 = require("node:fs");
5
+ const node_url_1 = require("node:url");
6
6
  const bus_dereference_1 = require("@comunica/bus-dereference");
7
7
  /**
8
8
  * A comunica File Dereference Actor.
@@ -13,9 +13,10 @@ class ActorDereferenceFile extends bus_dereference_1.ActorDereference {
13
13
  }
14
14
  async test({ url }) {
15
15
  try {
16
- (0, fs_1.accessSync)(getPath(url), fs_1.constants.F_OK);
16
+ (0, node_fs_1.accessSync)(getPath(url), node_fs_1.constants.F_OK);
17
17
  }
18
18
  catch (error) {
19
+ // eslint-disable-next-line ts/restrict-template-expressions
19
20
  throw new Error(`This actor only works on existing local files. (${error})`);
20
21
  }
21
22
  return true;
@@ -27,14 +28,14 @@ class ActorDereferenceFile extends bus_dereference_1.ActorDereference {
27
28
  async run({ url }) {
28
29
  const requestTimeStart = Date.now();
29
30
  return {
30
- data: (0, fs_1.createReadStream)(getPath(url)),
31
+ data: (0, node_fs_1.createReadStream)(getPath(url)),
31
32
  // This should always be after the creation of the read stream
32
33
  requestTime: Date.now() - requestTimeStart,
33
34
  exists: true,
34
- url: ActorDereferenceFile.isURI(url) ? url : (0, url_1.pathToFileURL)(url).href,
35
+ url: ActorDereferenceFile.isURI(url) ? url : (0, node_url_1.pathToFileURL)(url).href,
35
36
  };
36
37
  }
37
38
  }
38
39
  exports.ActorDereferenceFile = ActorDereferenceFile;
39
- const getPath = (url) => url.startsWith('file://') ? (0, url_1.fileURLToPath)(url) : url;
40
+ const getPath = (url) => url.startsWith('file://') ? (0, node_url_1.fileURLToPath)(url) : url;
40
41
  //# sourceMappingURL=ActorDereferenceFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ActorDereferenceFile.js","sourceRoot":"","sources":["ActorDereferenceFile.ts"],"names":[],"mappings":";;;AAAA,2BAA6D;AAC7D,6BAAmD;AAEnD,+DAA6D;AAG7D;;GAEG;AACH,MAAa,oBAAqB,SAAQ,kCAAgB;IACxD,YAAmB,IAA2B;QAC5C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAsB;QAC3C,IAAI;YACF,IAAA,eAAU,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE,cAAS,CAAC,IAAI,CAAC,CAAC;SAC1C;QAAC,OAAO,KAAc,EAAE;YACvB,MAAM,IAAI,KAAK,CAAC,mDAAmD,KAAK,GAAG,CAAC,CAAC;SAC9E;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,GAAW;QAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAsB;QAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACpC,OAAO;YACL,IAAI,EAAE,IAAA,qBAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,8DAA8D;YAC9D,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,gBAAgB;YAC1C,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,mBAAa,EAAC,GAAG,CAAC,CAAC,IAAI;SACrE,CAAC;IACJ,CAAC;CACF;AA7BD,oDA6BC;AAED,MAAM,OAAO,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAa,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC","sourcesContent":["import { accessSync, createReadStream, constants } from 'fs';\nimport { fileURLToPath, pathToFileURL } from 'url';\nimport type { IActionDereference, IActorDereferenceArgs, IActorDereferenceOutput } from '@comunica/bus-dereference';\nimport { ActorDereference } from '@comunica/bus-dereference';\nimport type { IActorTest } from '@comunica/core';\n\n/**\n * A comunica File Dereference Actor.\n */\nexport class ActorDereferenceFile extends ActorDereference {\n public constructor(args: IActorDereferenceArgs) {\n super(args);\n }\n\n public async test({ url }: IActionDereference): Promise<IActorTest> {\n try {\n accessSync(getPath(url), constants.F_OK);\n } catch (error: unknown) {\n throw new Error(`This actor only works on existing local files. (${error})`);\n }\n return true;\n }\n\n private static isURI(str: string): boolean {\n const URIRegex = /\\w[\\w+.-]*:.*/u;\n return URIRegex.exec(str) !== null;\n }\n\n public async run({ url }: IActionDereference): Promise<IActorDereferenceOutput> {\n const requestTimeStart = Date.now();\n return {\n data: createReadStream(getPath(url)),\n // This should always be after the creation of the read stream\n requestTime: Date.now() - requestTimeStart,\n exists: true,\n url: ActorDereferenceFile.isURI(url) ? url : pathToFileURL(url).href,\n };\n }\n}\n\nconst getPath = (url: string): string => url.startsWith('file://') ? fileURLToPath(url) : url;\n"]}
1
+ {"version":3,"file":"ActorDereferenceFile.js","sourceRoot":"","sources":["ActorDereferenceFile.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,uCAAwD;AAExD,+DAA6D;AAG7D;;GAEG;AACH,MAAa,oBAAqB,SAAQ,kCAAgB;IACxD,YAAmB,IAA2B;QAC5C,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAsB;QAC3C,IAAI,CAAC;YACH,IAAA,oBAAU,EAAC,OAAO,CAAC,GAAG,CAAC,EAAE,mBAAS,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,4DAA4D;YAC5D,MAAM,IAAI,KAAK,CAAC,mDAAmD,KAAK,GAAG,CAAC,CAAC;QAC/E,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,GAAW;QAC9B,MAAM,QAAQ,GAAG,gBAAgB,CAAC;QAClC,OAAO,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,EAAsB;QAC1C,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACpC,OAAO;YACL,IAAI,EAAE,IAAA,0BAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YACpC,8DAA8D;YAC9D,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,gBAAgB;YAC1C,MAAM,EAAE,IAAI;YACZ,GAAG,EAAE,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAC,IAAI;SACrE,CAAC;IACJ,CAAC;CACF;AA9BD,oDA8BC;AAED,MAAM,OAAO,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC","sourcesContent":["import { accessSync, createReadStream, constants } from 'node:fs';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\nimport type { IActionDereference, IActorDereferenceArgs, IActorDereferenceOutput } from '@comunica/bus-dereference';\nimport { ActorDereference } from '@comunica/bus-dereference';\nimport type { IActorTest } from '@comunica/core';\n\n/**\n * A comunica File Dereference Actor.\n */\nexport class ActorDereferenceFile extends ActorDereference {\n public constructor(args: IActorDereferenceArgs) {\n super(args);\n }\n\n public async test({ url }: IActionDereference): Promise<IActorTest> {\n try {\n accessSync(getPath(url), constants.F_OK);\n } catch (error: unknown) {\n // eslint-disable-next-line ts/restrict-template-expressions\n throw new Error(`This actor only works on existing local files. (${error})`);\n }\n return true;\n }\n\n private static isURI(str: string): boolean {\n const URIRegex = /\\w[\\w+.-]*:.*/u;\n return URIRegex.exec(str) !== null;\n }\n\n public async run({ url }: IActionDereference): Promise<IActorDereferenceOutput> {\n const requestTimeStart = Date.now();\n return {\n data: createReadStream(getPath(url)),\n // This should always be after the creation of the read stream\n requestTime: Date.now() - requestTimeStart,\n exists: true,\n url: ActorDereferenceFile.isURI(url) ? url : pathToFileURL(url).href,\n };\n }\n}\n\nconst getPath = (url: string): string => url.startsWith('file://') ? fileURLToPath(url) : url;\n"]}
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
1
  {
2
2
  "name": "@comunica/actor-dereference-file",
3
- "version": "3.0.1-alpha.45.0",
3
+ "version": "3.0.1",
4
4
  "description": "A file dereference actor",
5
5
  "lsd:module": true,
6
- "main": "lib/index.js",
7
- "typings": "lib/index",
6
+ "license": "MIT",
7
+ "homepage": "https://comunica.dev/",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/comunica/comunica.git",
11
11
  "directory": "packages/actor-dereference-file"
12
12
  },
13
- "publishConfig": {
14
- "access": "public"
13
+ "bugs": {
14
+ "url": "https://github.com/comunica/comunica/issues"
15
15
  },
16
- "sideEffects": false,
17
16
  "keywords": [
18
17
  "comunica",
19
18
  "actor",
20
19
  "dereference",
21
20
  "file"
22
21
  ],
23
- "license": "MIT",
24
- "bugs": {
25
- "url": "https://github.com/comunica/comunica/issues"
22
+ "sideEffects": false,
23
+ "main": "lib/index.js",
24
+ "typings": "lib/index",
25
+ "publishConfig": {
26
+ "access": "public"
26
27
  },
27
- "homepage": "https://comunica.dev/",
28
28
  "files": [
29
29
  "components",
30
30
  "lib/**/*.d.ts",
31
31
  "lib/**/*.js",
32
32
  "lib/**/*.js.map"
33
33
  ],
34
- "dependencies": {
35
- "@comunica/bus-dereference": "3.0.1-alpha.45.0",
36
- "@comunica/core": "3.0.1-alpha.45.0"
37
- },
38
34
  "scripts": {
39
35
  "build": "npm run build:ts && npm run build:components",
40
36
  "build:ts": "node \"../../node_modules/typescript/bin/tsc\"",
41
37
  "build:components": "componentsjs-generator"
42
38
  },
43
- "gitHead": "b5a3900c24e29fa7b3243ab50bc9745d286fbce8"
39
+ "dependencies": {
40
+ "@comunica/bus-dereference": "^3.0.1",
41
+ "@comunica/core": "^3.0.1"
42
+ },
43
+ "gitHead": "9c0b537cd927d29590c287fe882185d88a65461b"
44
44
  }