@scalar/api-client 0.7.23 → 0.7.24

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @scalar/api-client
2
2
 
3
+ ## 0.7.24
4
+
5
+ ### Patch Changes
6
+
7
+ - 2f0b2f01: refactor: move json helpers to separate files
8
+
3
9
  ## 0.7.23
4
10
 
5
11
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"Response.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Response/Response.vue.ts"],"names":[],"mappings":";AA4RA,wBAAkD"}
1
+ {"version":3,"file":"Response.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/ApiClient/Response/Response.vue.ts"],"names":[],"mappings":";AA8QA,wBAAkD"}
@@ -1,5 +1,6 @@
1
1
  export * from './concatenateUrlAndPath';
2
2
  export * from './createPlaceholderRequest';
3
+ export * from './isJsonString';
3
4
  export * from './mapFromArray';
4
5
  export * from './normalizePath';
5
6
  export * from './normalizeRequestMethod';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA;AACvC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,0BAA0B,CAAA;AACxC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Check if value is a valid JSON string
3
+ */
4
+ export declare const isJsonString: (value?: any) => boolean;
5
+ //# sourceMappingURL=isJsonString.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isJsonString.d.ts","sourceRoot":"","sources":["../../src/helpers/isJsonString.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,YAAY,WAAY,GAAG,YAYvC,CAAA"}
package/dist/index.js CHANGED
@@ -4015,6 +4015,17 @@ const concatenateUrlAndPath = (url, path) => {
4015
4015
  const pathWithoutSlash = path.startsWith("/") ? path.slice(1) : path;
4016
4016
  return [urlWithSlash, pathWithoutSlash].join("");
4017
4017
  };
4018
+ const isJsonString = (value) => {
4019
+ if (typeof value !== "string") {
4020
+ return false;
4021
+ }
4022
+ try {
4023
+ JSON.parse(value);
4024
+ } catch {
4025
+ return false;
4026
+ }
4027
+ return true;
4028
+ };
4018
4029
  function mapFromArray(arr, key, valueKey) {
4019
4030
  const obj = {};
4020
4031
  arr.forEach((entry) => {
@@ -8756,17 +8767,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
8756
8767
  const cookies2 = (_a = activeResponse2.value) == null ? void 0 : _a.cookies;
8757
8768
  return cookies2 ? Object.keys(cookies2).map((key) => ({ name: key, value: cookies2[key] })) : [];
8758
8769
  });
8759
- const isJsonString = (value) => {
8760
- if (typeof value !== "string") {
8761
- return false;
8762
- }
8763
- try {
8764
- JSON.parse(value);
8765
- } catch {
8766
- return false;
8767
- }
8768
- return true;
8769
- };
8770
8770
  const responseData = computed(() => {
8771
8771
  var _a;
8772
8772
  const value = (_a = activeResponse2.value) == null ? void 0 : _a.data;
@@ -8926,6 +8926,7 @@ export {
8926
8926
  createPlaceholderRequest,
8927
8927
  httpHeaders,
8928
8928
  httpStatusCodes,
8929
+ isJsonString,
8929
8930
  mapFromArray,
8930
8931
  normalizePath,
8931
8932
  normalizeRequestMethod,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scalar/api-client",
3
3
  "description": "the open source API testing client",
4
- "version": "0.7.23",
4
+ "version": "0.7.24",
5
5
  "author": "Scalar (https://github.com/scalar)",
6
6
  "bugs": "https://github.com/scalar/scalar/issues/new",
7
7
  "dependencies": {