@dintero/sri-to-dist 1.1.12 → 1.1.14

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/lib.d.ts CHANGED
@@ -28,4 +28,4 @@ declare const calculateSha384: (content: Buffer) => string;
28
28
  declare const handleUpdatedHtml: (stdout: NodeJS.WriteStream, outputPath?: string, updatedHtml?: string) => void;
29
29
  declare const toSriScriptTag: (tag: string, integrity: string) => string;
30
30
  declare const alterTag: (tag: string, param: "crossorigin" | "integrity", value: string) => string;
31
- export { extractLinkRel, isSriTag, toHtmlWithSri, getContent, readLocalContent, fetchRemoteContent, calculateSha384, toSriScriptTag, handleUpdatedHtml, alterTag, };
31
+ export { alterTag, calculateSha384, extractLinkRel, fetchRemoteContent, getContent, handleUpdatedHtml, isSriTag, readLocalContent, toHtmlWithSri, toSriScriptTag, };
package/dist/lib.js CHANGED
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.alterTag = exports.handleUpdatedHtml = exports.toSriScriptTag = exports.calculateSha384 = exports.fetchRemoteContent = exports.readLocalContent = exports.getContent = exports.toHtmlWithSri = exports.isSriTag = exports.extractLinkRel = exports.toSriImportMap = exports.extractImports = exports.parseImportMap = exports.isImportMapTag = void 0;
36
+ exports.toSriScriptTag = exports.toHtmlWithSri = exports.readLocalContent = exports.isSriTag = exports.handleUpdatedHtml = exports.getContent = exports.fetchRemoteContent = exports.extractLinkRel = exports.calculateSha384 = exports.alterTag = exports.toSriImportMap = exports.extractImports = exports.parseImportMap = exports.isImportMapTag = void 0;
37
37
  const node_crypto_1 = require("node:crypto");
38
38
  const fs = __importStar(require("node:fs"));
39
39
  const path = __importStar(require("node:path"));
@@ -102,7 +102,7 @@ const parseImportMap = (scriptOrLinkTag) => {
102
102
  // Extract content between script tags
103
103
  const contentRegex = /<script[^>]*>([\s\S]*?)<\/script>/;
104
104
  const contentMatch = scriptOrLinkTag.match(contentRegex);
105
- if (!contentMatch || !contentMatch[1]) {
105
+ if (!contentMatch?.[1]) {
106
106
  throw new Error(`Failed to parse import map for tag ${scriptOrLinkTag}`);
107
107
  }
108
108
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dintero/sri-to-dist",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "HTML tool for adding subresource integrity hashes",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,10 +13,10 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "build": "tsc",
16
- "prepare": "npm run build",
16
+ "prepare": "yarn -s run build",
17
17
  "start": "node bin/sri-to-dist.js",
18
- "test": "vitest run",
19
- "test:watch": "vitest",
18
+ "test": "node --import tsx --test",
19
+ "test:watch": "yarn -s test --watch",
20
20
  "lint": "biome check .",
21
21
  "format": "biome check --write",
22
22
  "prepublishOnly": "yarn run build"
@@ -32,13 +32,12 @@
32
32
  "author": "Sven Nicolai Viig <sven@dintero.com> (http://dintero.com)",
33
33
  "license": "MIT",
34
34
  "devDependencies": {
35
- "@biomejs/biome": "2.4.6",
36
- "@types/node": "24.12.0",
37
- "@types/temp": "0.9.4",
35
+ "@biomejs/biome": "2.4.13",
36
+ "@types/node": "24.12.2",
38
37
  "semantic-release": "25.0.3",
39
38
  "temp": "0.9.4",
40
- "typescript": "5.9.3",
41
- "vitest": "4.0.18"
39
+ "tsx": "4.21.0",
40
+ "typescript": "6.0.3"
42
41
  },
43
42
  "dependencies": {
44
43
  "commander": "14.0.3"