silgi 0.10.5 → 0.10.7

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.
@@ -1,4 +1,4 @@
1
- const version = "0.10.5";
1
+ const version = "0.10.7";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -592,13 +592,13 @@ async function prepareServerFiles(silgi) {
592
592
  delete importItems["#silgi/vfs"];
593
593
  }
594
594
  if (scanned.services.length > 0) {
595
- importItems["silgi/core"].import.push({ name: "mergeServices", key: "mergeServices" });
595
+ importItems.silgi.import.push({ name: "mergeServices", key: "mergeServices" });
596
596
  }
597
597
  if (scanned.shareds.length > 0) {
598
- importItems["silgi/core"].import.push({ name: "mergeShared", key: "mergeShared" });
598
+ importItems.silgi.import.push({ name: "mergeShared", key: "mergeShared" });
599
599
  }
600
600
  if (scanned.schemas.length > 0) {
601
- importItems["silgi/core"].import.push({ name: "mergeSchemas", key: "mergeSchemas" });
601
+ importItems.silgi.import.push({ name: "mergeSchemas", key: "mergeSchemas" });
602
602
  }
603
603
  for (const key in importItems) {
604
604
  importItems[key].import = deduplicateImportsByKey(importItems[key].import);
@@ -1,4 +1,4 @@
1
- const version = "0.10.5";
1
+ const version = "0.10.7";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -1,4 +1,4 @@
1
- const version = "0.10.5";
1
+ const version = "0.10.7";
2
2
  const peerDependencies = {
3
3
  "@fastify/deepmerge": "^2.0.2",
4
4
  "@nuxt/kit": "^3.15.3",
@@ -9,7 +9,7 @@ export function createSilgiFetch(options, localFetch) {
9
9
  method: opts?.method || "get"
10
10
  };
11
11
  const $fetch = getFetch(url, finalOpts, localFetch);
12
- return $fetch(fillPath(url, opts.params), finalOpts);
12
+ return $fetch(fillPath(url, opts?.params), finalOpts);
13
13
  };
14
14
  }
15
15
  export function silgi$fetch(url, opts) {
@@ -18,7 +18,7 @@ export function silgi$fetch(url, opts) {
18
18
  method: opts?.method || "get"
19
19
  };
20
20
  const $fetch = getFetch(url, finalOpts);
21
- return $fetch(fillPath(url, opts.params), finalOpts);
21
+ return $fetch(fillPath(url, opts?.params), finalOpts);
22
22
  }
23
23
  function getFetch(url, opts, localFetch) {
24
24
  if (import.meta.server && localFetch) {
@@ -29,16 +29,15 @@ function getFetch(url, opts, localFetch) {
29
29
  return globalThis.$fetch;
30
30
  }
31
31
  function fillPath(path, params) {
32
- if (!params) {
33
- if (path.includes(":"))
34
- throw new Error("Parametreler dogru kullanmal\u0131s\u0131n\u0131z");
32
+ if (!params || Object.keys(params).length === 0) {
35
33
  return path;
36
34
  }
37
- if (!path.includes(":"))
38
- throw new Error("Path parametler : ile belirtilmelidir");
39
35
  let result = path;
40
36
  for (const [key, value] of Object.entries(params)) {
41
- result = result.replace(`:${key}`, value);
37
+ const pattern = `:${key}`;
38
+ if (result.includes(pattern)) {
39
+ result = result.replace(pattern, value);
40
+ }
42
41
  }
43
42
  return result;
44
43
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "silgi",
3
3
  "type": "module",
4
- "version": "0.10.5",
4
+ "version": "0.10.7",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "exports": {
@@ -133,7 +133,7 @@
133
133
  "knitwork": "^1.2.0",
134
134
  "mlly": "^1.7.4",
135
135
  "ofetch": "^1.4.1",
136
- "ohash": "^2.0.8",
136
+ "ohash": "^2.0.9",
137
137
  "pathe": "^2.0.3",
138
138
  "picocolors": "^1.1.1",
139
139
  "pkg-types": "^2.0.1",
@@ -147,7 +147,7 @@
147
147
  "untyped": "^2.0.0"
148
148
  },
149
149
  "devDependencies": {
150
- "@antfu/eslint-config": "^4.3.0",
150
+ "@antfu/eslint-config": "^4.4.0",
151
151
  "@nuxt/kit": "^3.15.4",
152
152
  "@nuxt/schema": "^3.15.4",
153
153
  "@types/node": "^22.13.8",