@symbo.ls/fetch 2.11.279 → 2.11.310

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/cjs/index.js CHANGED
@@ -38,8 +38,8 @@ var utils = __toESM(require("@domql/utils"), 1);
38
38
  var globals = __toESM(require("@domql/globals"), 1);
39
39
  const { overwriteDeep, deepDestringify } = utils;
40
40
  const { window } = globals;
41
- const IS_DEVELOPMENT = window && window.location ? window.location.host.includes("dev.") || window.location.host.includes("symbo.ls") : true;
42
- const SERVER_URL = IS_DEVELOPMENT ? "http://localhost:13335/" : "https://api.symbols.app/";
41
+ const IS_DEVELOPMENT = window && window.location ? window.location.host.includes("dev.") : true;
42
+ const SERVER_URL = IS_DEVELOPMENT ? "http://localhost:13335/get/" : "https://api.symbols.app/get/";
43
43
  const defaultOptions = {
44
44
  endpoint: SERVER_URL
45
45
  };
@@ -75,7 +75,15 @@ const fetchProject = async (key, options) => {
75
75
  overwriteDeep(options[editor.serviceRoute], evalData);
76
76
  }
77
77
  } else {
78
- ["state", "designSystem", "components", "snippets", "pages", "utils", "functions"].forEach((key2) => {
78
+ [
79
+ "state",
80
+ "designSystem",
81
+ "components",
82
+ "snippets",
83
+ "pages",
84
+ "utils",
85
+ "functions"
86
+ ].forEach((key2) => {
79
87
  overwriteDeep(options[key2], evalData[key2.toLowerCase()]);
80
88
  });
81
89
  }
package/index.js CHANGED
@@ -2,17 +2,17 @@
2
2
 
3
3
  import * as utils from '@domql/utils'
4
4
  import * as globals from '@domql/globals'
5
-
6
5
  const { overwriteDeep, deepDestringify } = utils
7
6
  const { window } = globals
8
7
 
9
- const IS_DEVELOPMENT = window && window.location
10
- ? window.location.host.includes('dev.') || window.location.host.includes('symbo.ls')
11
- : process.env.NODE_ENV === 'development'
8
+ const IS_DEVELOPMENT =
9
+ window && window.location
10
+ ? window.location.host.includes('dev.')
11
+ : process.env.NODE_ENV === 'development'
12
12
 
13
13
  const SERVER_URL = IS_DEVELOPMENT
14
- ? 'http://localhost:13335/'
15
- : 'https://api.symbols.app/'
14
+ ? 'http://localhost:13335/get/'
15
+ : 'https://api.symbols.app/get/'
16
16
 
17
17
  const defaultOptions = {
18
18
  endpoint: SERVER_URL
@@ -24,7 +24,7 @@ export const fetchRemote = async (key, options = defaultOptions) => {
24
24
  const baseUrl = options.endpoint || SERVER_URL
25
25
  const route = options.serviceRoute
26
26
  ? utils.isArray(options.serviceRoute)
27
- ? options.serviceRoute.map(v => v.toLowerCase()).join(',')
27
+ ? options.serviceRoute.map((v) => v.toLowerCase()).join(',')
28
28
  : options.serviceRoute
29
29
  : ''
30
30
 
@@ -34,6 +34,7 @@ export const fetchRemote = async (key, options = defaultOptions) => {
34
34
  method: 'GET',
35
35
  headers: { 'Content-Type': 'application/json', 'X-AppKey': key }
36
36
  })
37
+
37
38
  return await response.json()
38
39
  } catch (e) {
39
40
  if (utils.isFunction(options.onError)) return options.onError(e)
@@ -52,14 +53,22 @@ export const fetchProject = async (key, options) => {
52
53
 
53
54
  if (editor.serviceRoute) {
54
55
  if (utils.isArray(editor.serviceRoute)) {
55
- editor.serviceRoute.forEach(route => {
56
+ editor.serviceRoute.forEach((route) => {
56
57
  overwriteDeep(options[route], evalData[route.toLowerCase()])
57
58
  })
58
59
  } else {
59
60
  overwriteDeep(options[editor.serviceRoute], evalData)
60
61
  }
61
62
  } else {
62
- ['state', 'designSystem', 'components', 'snippets', 'pages', 'utils', 'functions'].forEach(key => {
63
+ [
64
+ 'state',
65
+ 'designSystem',
66
+ 'components',
67
+ 'snippets',
68
+ 'pages',
69
+ 'utils',
70
+ 'functions'
71
+ ].forEach((key) => {
63
72
  overwriteDeep(options[key], evalData[key.toLowerCase()])
64
73
  })
65
74
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/fetch",
3
- "version": "2.11.279",
3
+ "version": "2.11.310",
4
4
  "license": "MIT",
5
- "gitHead": "930c65852b7a939a2c3f1e4a6401ddf90919b33d",
5
+ "gitHead": "3e774509842b471eda7cd8d34ea79bd8c70c79a9",
6
6
  "type": "module",
7
7
  "module": "index.js",
8
8
  "main": "index.js",