@rg-dev/stdlib 1.0.46 → 1.0.48

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.
@@ -210,7 +210,7 @@ function doSafe(safe, onError) {
210
210
  try {
211
211
  const result = safe();
212
212
  if (isPromise(result)) {
213
- (_a = result["catch"]) == null ? void 0 : _a.call(
213
+ (_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
214
214
  result,
215
215
  (error) => {
216
216
  if (error instanceof Error) {
package/lib/common-env.js CHANGED
@@ -175,7 +175,7 @@ function doSafe(safe, onError) {
175
175
  try {
176
176
  const result = safe();
177
177
  if (isPromise(result)) {
178
- (_a = result["catch"]) == null ? void 0 : _a.call(
178
+ (_a = result == null ? void 0 : result["catch"]) == null ? void 0 : _a.call(
179
179
  result,
180
180
  (error) => {
181
181
  if (error instanceof Error) {
@@ -46,13 +46,13 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
46
46
  // src/trpc-helpers.ts
47
47
  var trpc_helpers_exports = {};
48
48
  __export(trpc_helpers_exports, {
49
- trpcServerHelpers: () => trpcServerHelpers
49
+ TrpcServerHelpers: () => TrpcServerHelpers
50
50
  });
51
51
  module.exports = __toCommonJS(trpc_helpers_exports);
52
52
  var import_server = require("@trpc/server");
53
53
  var trpcExpress = __toESM(require("@trpc/server/adapters/express"), 1);
54
54
  var import_superjson = __toESM(require("superjson"), 1);
55
- var trpcServerHelpers = class {
55
+ var TrpcServerHelpers = class {
56
56
  static createExpressTrpcServer() {
57
57
  if (globalThis.Headers == void 0) {
58
58
  throw new Error("node version too old?, globalThis.Headers undefined");
@@ -1,39 +1,40 @@
1
+ import * as express from 'express';
1
2
  import * as _trpc_server from '@trpc/server';
2
3
  import { initTRPC } from '@trpc/server';
3
- import * as _trpc_server_dist_unstable_core_do_not_import from '@trpc/server/dist/unstable-core-do-not-import';
4
+ import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
4
5
  import * as trpcExpress from '@trpc/server/adapters/express';
5
6
 
6
- type TrpcExpressRoot = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
7
- declare class trpcServerHelpers {
7
+ type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
8
+ declare class TrpcServerHelpers {
8
9
  static createExpressTrpcServer(): {
9
- _config: _trpc_server_dist_unstable_core_do_not_import.RootConfig<{
10
+ _config: _trpc_server_unstable_core_do_not_import.RootConfig<{
10
11
  ctx: trpcExpress.CreateExpressContextOptions;
11
12
  meta: object;
12
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
13
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
13
14
  transformer: false;
14
15
  }>;
15
- procedure: _trpc_server_dist_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, false>;
16
- middleware: <$ContextOverrides>(fn: _trpc_server_dist_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_dist_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
17
- router: <TInput extends _trpc_server_dist_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_dist_unstable_core_do_not_import.BuiltRouter<{
16
+ procedure: _trpc_server_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, false>;
17
+ middleware: <$ContextOverrides>(fn: _trpc_server_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
18
+ router: <TInput extends _trpc_server_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_unstable_core_do_not_import.BuiltRouter<{
18
19
  ctx: trpcExpress.CreateExpressContextOptions;
19
20
  meta: object;
20
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
21
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
21
22
  transformer: false;
22
- }, _trpc_server_dist_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
23
- mergeRouters: typeof _trpc_server_dist_unstable_core_do_not_import.mergeRouters;
24
- createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_dist_unstable_core_do_not_import.Router<{
23
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
24
+ mergeRouters: typeof _trpc_server_unstable_core_do_not_import.mergeRouters;
25
+ createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_unstable_core_do_not_import.Router<{
25
26
  ctx: trpcExpress.CreateExpressContextOptions;
26
27
  meta: object;
27
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
28
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
28
29
  transformer: false;
29
- }, TRecord>, "_def">) => _trpc_server_dist_unstable_core_do_not_import.RouterCaller<{
30
+ }, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
30
31
  ctx: trpcExpress.CreateExpressContextOptions;
31
32
  meta: object;
32
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
33
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
33
34
  transformer: false;
34
35
  }, TRecord>;
35
36
  };
36
37
  static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
37
38
  }
38
39
 
39
- export { type TrpcExpressRoot, trpcServerHelpers };
40
+ export { type TrpcExpressRootType, TrpcServerHelpers };
@@ -1,39 +1,40 @@
1
+ import * as express from 'express';
1
2
  import * as _trpc_server from '@trpc/server';
2
3
  import { initTRPC } from '@trpc/server';
3
- import * as _trpc_server_dist_unstable_core_do_not_import from '@trpc/server/dist/unstable-core-do-not-import';
4
+ import * as _trpc_server_unstable_core_do_not_import from '@trpc/server/unstable-core-do-not-import';
4
5
  import * as trpcExpress from '@trpc/server/adapters/express';
5
6
 
6
- type TrpcExpressRoot = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
7
- declare class trpcServerHelpers {
7
+ type TrpcExpressRootType = ReturnType<ReturnType<typeof initTRPC.context<trpcExpress.CreateExpressContextOptions>>['create']>;
8
+ declare class TrpcServerHelpers {
8
9
  static createExpressTrpcServer(): {
9
- _config: _trpc_server_dist_unstable_core_do_not_import.RootConfig<{
10
+ _config: _trpc_server_unstable_core_do_not_import.RootConfig<{
10
11
  ctx: trpcExpress.CreateExpressContextOptions;
11
12
  meta: object;
12
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
13
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
13
14
  transformer: false;
14
15
  }>;
15
- procedure: _trpc_server_dist_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_dist_unstable_core_do_not_import.unsetMarker, false>;
16
- middleware: <$ContextOverrides>(fn: _trpc_server_dist_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_dist_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
17
- router: <TInput extends _trpc_server_dist_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_dist_unstable_core_do_not_import.BuiltRouter<{
16
+ procedure: _trpc_server_unstable_core_do_not_import.ProcedureBuilder<trpcExpress.CreateExpressContextOptions, object, object, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, typeof _trpc_server_unstable_core_do_not_import.unsetMarker, false>;
17
+ middleware: <$ContextOverrides>(fn: _trpc_server_unstable_core_do_not_import.MiddlewareFunction<trpcExpress.CreateExpressContextOptions, object, object, $ContextOverrides, unknown>) => _trpc_server_unstable_core_do_not_import.MiddlewareBuilder<trpcExpress.CreateExpressContextOptions, object, $ContextOverrides, unknown>;
18
+ router: <TInput extends _trpc_server_unstable_core_do_not_import.CreateRouterOptions>(input: TInput) => _trpc_server_unstable_core_do_not_import.BuiltRouter<{
18
19
  ctx: trpcExpress.CreateExpressContextOptions;
19
20
  meta: object;
20
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
21
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
21
22
  transformer: false;
22
- }, _trpc_server_dist_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
23
- mergeRouters: typeof _trpc_server_dist_unstable_core_do_not_import.mergeRouters;
24
- createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_dist_unstable_core_do_not_import.Router<{
23
+ }, _trpc_server_unstable_core_do_not_import.DecorateCreateRouterOptions<TInput>>;
24
+ mergeRouters: typeof _trpc_server_unstable_core_do_not_import.mergeRouters;
25
+ createCallerFactory: <TRecord extends _trpc_server.RouterRecord>(router: Pick<_trpc_server_unstable_core_do_not_import.Router<{
25
26
  ctx: trpcExpress.CreateExpressContextOptions;
26
27
  meta: object;
27
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
28
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
28
29
  transformer: false;
29
- }, TRecord>, "_def">) => _trpc_server_dist_unstable_core_do_not_import.RouterCaller<{
30
+ }, TRecord>, "_def">) => _trpc_server_unstable_core_do_not_import.RouterCaller<{
30
31
  ctx: trpcExpress.CreateExpressContextOptions;
31
32
  meta: object;
32
- errorShape: _trpc_server_dist_unstable_core_do_not_import.DefaultErrorShape;
33
+ errorShape: _trpc_server_unstable_core_do_not_import.DefaultErrorShape;
33
34
  transformer: false;
34
35
  }, TRecord>;
35
36
  };
36
37
  static createTrpcExpressMiddleware(opts: Omit<Parameters<typeof trpcExpress.createExpressMiddleware>[0], 'createContext'>): express.Handler;
37
38
  }
38
39
 
39
- export { type TrpcExpressRoot, trpcServerHelpers };
40
+ export { type TrpcExpressRootType, TrpcServerHelpers };
@@ -24,7 +24,7 @@ import {
24
24
  } from "@trpc/server";
25
25
  import * as trpcExpress from "@trpc/server/adapters/express";
26
26
  import superjson from "superjson";
27
- var trpcServerHelpers = class {
27
+ var TrpcServerHelpers = class {
28
28
  static createExpressTrpcServer() {
29
29
  if (globalThis.Headers == void 0) {
30
30
  throw new Error("node version too old?, globalThis.Headers undefined");
@@ -41,5 +41,5 @@ var trpcServerHelpers = class {
41
41
  }
42
42
  };
43
43
  export {
44
- trpcServerHelpers
44
+ TrpcServerHelpers
45
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rg-dev/stdlib",
3
- "version": "1.0.46",
3
+ "version": "1.0.48",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "typesVersions": {
15
15
  "*": {
16
- "lib/trpc-helpers": [
16
+ "lib/trpc-helpers": [
17
17
  "lib/trpc-helpers.d.ts"
18
18
  ],
19
19
  "lib/common-env": [
@@ -33,8 +33,8 @@
33
33
  "types": "./lib/index.d.cts",
34
34
  "type": "module",
35
35
  "exports": {
36
- "./lib/trpc-helpers":{
37
- "import": "./lib/trpc-helpers.js",
36
+ "./lib/trpc-helpers": {
37
+ "import": "./lib/trpc-helpers.js",
38
38
  "require": "./lib/trpc-helpers.cjs",
39
39
  "types": "./lib/trpc-helpers.d.ts"
40
40
  },
@@ -67,6 +67,7 @@
67
67
  "devDependencies": {
68
68
  "@trpc/server": "^11.1.1",
69
69
  "@types/command-exists": "^1.2.3",
70
+ "@types/express": "^5.0.6",
70
71
  "@types/fs-extra": "^11.0.4",
71
72
  "@types/node": "^18.19.3",
72
73
  "builtin-modules": "^3.3.0",