@stackframe/stack-shared 2.7.23 → 2.7.25

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,9 @@
1
1
  # @stackframe/stack-shared
2
2
 
3
+ ## 2.7.25
4
+
5
+ ## 2.7.24
6
+
3
7
  ## 2.7.23
4
8
 
5
9
  ### Patch Changes
@@ -171,6 +171,10 @@ export const adaptSchema = yupMixed();
171
171
  * Yup's URL schema does not recognize some URLs (including `http://localhost`) as a valid URL. This schema is a workaround for that.
172
172
  */
173
173
  export const urlSchema = yupString().test({
174
+ name: 'no-spaces',
175
+ message: (params) => `${params.path} contains spaces`,
176
+ test: (value) => value == null || !value.includes(' ')
177
+ }).test({
174
178
  name: 'url',
175
179
  message: (params) => `${params.path} is not a valid URL`,
176
180
  test: (value) => value == null || isValidUrl(value)
@@ -75,7 +75,6 @@ import.meta.vitest?.test("groupBy", ({ expect }) => {
75
75
  expect(grouped.get("odd")).toEqual([1, 3, 5]);
76
76
  // Check the actual lengths of the words to ensure our test is correct
77
77
  const words = ["apple", "banana", "cherry", "date", "elderberry"];
78
- console.log("Word lengths:", words.map(w => `${w}: ${w.length}`));
79
78
  const byLength = groupBy(words, (w) => w.length);
80
79
  // Adjust expectations based on actual word lengths
81
80
  expect(byLength.get(5)).toEqual(["apple"]);
@@ -57,37 +57,6 @@ export function logged(name, toLog, options = {}) {
57
57
  });
58
58
  return proxy;
59
59
  }
60
- import.meta.vitest?.test("logged", ({ expect }) => {
61
- // Test with a simple object
62
- const obj = {
63
- value: 42,
64
- method(x) { return x * 2; }
65
- };
66
- const loggedObj = logged("testObj", obj);
67
- // Test property access
68
- expect(loggedObj.value).toBe(42);
69
- // Test method call
70
- const result = loggedObj.method(21);
71
- expect(result).toBe(42);
72
- // Test property setting
73
- loggedObj.value = 100;
74
- expect(loggedObj.value).toBe(100);
75
- // Test with a promise-returning method
76
- const asyncObj = {
77
- async asyncMethod(x) { return x * 3; }
78
- };
79
- const loggedAsyncObj = logged("asyncObj", asyncObj);
80
- // Test async method
81
- const promise = loggedAsyncObj.asyncMethod(7);
82
- expect(promise instanceof Promise).toBe(true);
83
- // Test error handling
84
- const errorObj = {
85
- throwError() { throw new Error("Test error"); }
86
- };
87
- const loggedErrorObj = logged("errorObj", errorObj);
88
- // Test error throwing
89
- expect(() => loggedErrorObj.throwError()).toThrow("Test error");
90
- });
91
60
  export function createLazyProxy(factory) {
92
61
  let cache = undefined;
93
62
  let initialized = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackframe/stack-shared",
3
- "version": "2.7.23",
3
+ "version": "2.7.25",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "type": "module",