@shushed/helpers 0.0.60 → 0.0.62
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/index.js +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -365,6 +365,18 @@ var import_jose = require("jose");
|
|
|
365
365
|
// src-public/runtime.ts
|
|
366
366
|
var import_logging = require("@google-cloud/logging");
|
|
367
367
|
var DEFAULT_BRANCH = "migratedprod";
|
|
368
|
+
var getCircularReplacer = () => {
|
|
369
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
370
|
+
return (key, value) => {
|
|
371
|
+
if (typeof value === "object" && value !== null) {
|
|
372
|
+
if (seen.has(value)) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
seen.add(value);
|
|
376
|
+
}
|
|
377
|
+
return value;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
368
380
|
var Logging = class {
|
|
369
381
|
constructor(workflowId, triggerId, systemEnvName) {
|
|
370
382
|
this.workflowId = workflowId;
|
|
@@ -387,6 +399,8 @@ var Logging = class {
|
|
|
387
399
|
this.errorFn = (...args) => log.entry(Object.assign({
|
|
388
400
|
severity: import_logging.Severity.error
|
|
389
401
|
}, this.metadata), ...args);
|
|
402
|
+
this.logFn = (...args) => console.log(JSON.stringify(args, getCircularReplacer()));
|
|
403
|
+
this.errorFn = (...args) => console.error(JSON.stringify(args, getCircularReplacer()));
|
|
390
404
|
} else {
|
|
391
405
|
this.logFn = console.log;
|
|
392
406
|
this.errorFn = console.error;
|