@deltares/fews-web-oc-utils 2.2.1 → 2.3.0

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
@@ -24,12 +24,24 @@ Build only cjs bundle
24
24
  npm run build:cjs
25
25
  ```
26
26
 
27
- ### Lints and fixes files
27
+ ### Check formatting, lint and types
28
+
29
+ ```
30
+ npm run check
31
+ ```
32
+
33
+ ### Lint
28
34
 
29
35
  ```
30
36
  npm run lint
31
37
  ```
32
38
 
39
+ ### Format files
40
+
41
+ ```
42
+ npm run format
43
+ ```
44
+
33
45
  ### Run tests
34
46
 
35
47
  Get the coverage report
@@ -22,12 +22,7 @@ var e = class {
22
22
  webserviceUrl;
23
23
  transformRequest;
24
24
  constructor(e, t) {
25
- if (this.webserviceUrl = e, t === void 0) {
26
- async function e(e) {
27
- return e;
28
- }
29
- this.transformRequest = e;
30
- } else this.transformRequest = t;
25
+ this.webserviceUrl = e, this.transformRequest = t ?? ((e) => Promise.resolve(e));
31
26
  }
32
27
  async getDataWithParser(e, t, n) {
33
28
  let r = t.relativeUrl ? this.webserviceUrl + e : e, i = {}, a = {};
@@ -49,10 +44,9 @@ var e = class {
49
44
  }
50
45
  async postData(n, r, i) {
51
46
  let a = new e();
52
- return a.relativeUrl = !n.startsWith("http"), this.postDataWithParser(n, a, new t(), r, {
53
- "Content-Type": "application/json",
54
- ...i
55
- });
47
+ a.relativeUrl = !n.startsWith("http");
48
+ let o = new Headers(i);
49
+ return o.has("Content-Type") || o.set("Content-Type", "application/json"), this.postDataWithParser(n, a, new t(), r, o);
56
50
  }
57
51
  async processResponse(e, t, n, r) {
58
52
  e.responseCode = t.status, e.contentType = t.headers.get("content-type");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deltares/fews-web-oc-utils",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Util Library for common Web OC functionality",
5
5
  "author": {
6
6
  "name": "Werner Kramer",
@@ -23,33 +23,28 @@
23
23
  }
24
24
  },
25
25
  "scripts": {
26
- "build": "vite build && tsc -p tsconfig.build.json",
26
+ "build": "vp build && tsc -p tsconfig.build.json",
27
27
  "doc": "typedoc src/index.ts",
28
- "lint": "npm run prettier",
29
- "prettier": "prettier . --check",
30
- "format": "prettier . --write",
31
- "test:unit": "vitest run test/unit",
32
- "test:e2e": "vitest run test/e2e",
33
- "test": "vitest"
28
+ "check": "vp check",
29
+ "lint": "vp lint",
30
+ "format": "vp fmt .",
31
+ "test:unit": "vp test run test/unit",
32
+ "test:e2e": "vp test run test/e2e",
33
+ "test": "vp test"
34
34
  },
35
35
  "devDependencies": {
36
- "@eslint/js": "^10.0.1",
37
36
  "@types/node": "^24.19.2",
38
- "eslint": "^10.13.0",
39
- "eslint-config-prettier": "^10.1.8",
40
37
  "fetch-mock": "^12.6.0",
41
- "globals": "^17.13.0",
42
38
  "json-schema-to-typescript": "^16.0.0",
43
- "prettier": "^3.9.10",
44
39
  "tslib": "^2.8.1",
45
40
  "typedoc": "^0.28.20",
46
41
  "typescript": "^6.0.3",
47
- "typescript-eslint": "^8.72.1",
48
- "vite": "^8.3.5",
49
- "vitest": "^5.0.5"
42
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
43
+ "vite-plus": "1.4.0",
44
+ "vitest": "5.0.5"
50
45
  },
51
46
  "engines": {
52
- "node": ">=22.0.0"
47
+ "node": "^22.18.0 || ^24.11.0 || >=26.0.0"
53
48
  },
54
49
  "files": [
55
50
  "dist/*"
@@ -65,7 +60,8 @@
65
60
  "access": "public",
66
61
  "registry": "https://registry.npmjs.org"
67
62
  },
68
- "volta": {
69
- "node": "24.14.1"
63
+ "overrides": {
64
+ "vite": "npm:@voidzero-dev/vite-plus-core@1.4.0",
65
+ "vitest": "5.0.5"
70
66
  }
71
67
  }