alchemy 0.57.2 → 0.58.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/src/destroy.ts CHANGED
@@ -175,18 +175,14 @@ export async function destroy<Type extends string>(
175
175
  }
176
176
  }
177
177
 
178
- const destroyOptions = {
179
- ...options,
180
- strategy: instance[DestroyStrategy] ?? "sequential",
181
- };
182
178
  if (nestedScope) {
183
- await destroy(nestedScope, destroyOptions);
179
+ await destroy(nestedScope, {
180
+ ...options,
181
+ strategy: instance[DestroyStrategy] ?? "sequential",
182
+ });
184
183
  }
185
184
 
186
185
  if (options?.replace == null) {
187
- if (nestedScope) {
188
- await destroy(nestedScope, destroyOptions);
189
- }
190
186
  await scope.deleteResource(instance[ResourceID]);
191
187
  } else {
192
188
  let pendingDeletions =
package/src/secret.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { inspect } from "node:util";
1
2
  import { alchemy } from "./alchemy.ts";
2
3
 
3
4
  declare global {
@@ -70,6 +71,20 @@ export class Secret<T = string> {
70
71
  ) {
71
72
  globalSecrets[name] = this;
72
73
  }
74
+
75
+ /**
76
+ * Override toString to prevent accidental exposure of secret values
77
+ */
78
+ toString(): string {
79
+ return `Secret(${this.name ?? ""})`;
80
+ }
81
+
82
+ /**
83
+ * Custom inspect implementation for console.log to prevent exposing secrets
84
+ */
85
+ [inspect.custom](): string {
86
+ return this.toString();
87
+ }
73
88
  }
74
89
 
75
90
  /**