@jayfong/x-server 2.95.2 → 2.96.1

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.
@@ -192,6 +192,19 @@ class ApiGenerator {
192
192
  let valueSymbolName = valueSymbol?.getName() || '';
193
193
  const comment = this.getComment(keySymbol);
194
194
  let isRequired = keySymbol ? !(keySymbol.getFlags() & _tsMorph.ts.SymbolFlags.Optional) : false;
195
+ const apiName = keySymbolName || '__type';
196
+
197
+ // Decimal, Prisma 生成的
198
+ if (valueSymbolName === 'Decimal') {
199
+ return {
200
+ name: apiName,
201
+ desc: comment.description,
202
+ required: isRequired,
203
+ type: 'number',
204
+ enum: [],
205
+ children: []
206
+ };
207
+ }
195
208
 
196
209
  // WS
197
210
  if (valueSymbolName === 'SocketStream') {
@@ -261,7 +274,6 @@ class ApiGenerator {
261
274
  const isObject = !isArray && !isString && !isNumber && !isBoolean && hasTypeFlag(_tsMorph.ts.TypeFlags.Object) ||
262
275
  // 交集类型视为对象
263
276
  isIntersection;
264
- const apiName = keySymbolName || '__type';
265
277
  const apiDesc = keySymbol && this.getComment(keySymbol).description || '';
266
278
  const apiEnum = (isUnion ? unionTypes.map(item => item.value) : isLiteral ? [type.value] : []).filter(v => v != null);
267
279
  const apiType = isArray ? 'array' : isString ? 'string' : isNumber ? 'number' : isBoolean ? 'boolean' : 'object';
@@ -187,6 +187,19 @@ export class ApiGenerator {
187
187
  let valueSymbolName = valueSymbol?.getName() || '';
188
188
  const comment = this.getComment(keySymbol);
189
189
  let isRequired = keySymbol ? !(keySymbol.getFlags() & ts.SymbolFlags.Optional) : false;
190
+ const apiName = keySymbolName || '__type';
191
+
192
+ // Decimal, Prisma 生成的
193
+ if (valueSymbolName === 'Decimal') {
194
+ return {
195
+ name: apiName,
196
+ desc: comment.description,
197
+ required: isRequired,
198
+ type: 'number',
199
+ enum: [],
200
+ children: []
201
+ };
202
+ }
190
203
 
191
204
  // WS
192
205
  if (valueSymbolName === 'SocketStream') {
@@ -256,7 +269,6 @@ export class ApiGenerator {
256
269
  const isObject = !isArray && !isString && !isNumber && !isBoolean && hasTypeFlag(ts.TypeFlags.Object) ||
257
270
  // 交集类型视为对象
258
271
  isIntersection;
259
- const apiName = keySymbolName || '__type';
260
272
  const apiDesc = keySymbol && this.getComment(keySymbol).description || '';
261
273
  const apiEnum = (isUnion ? unionTypes.map(item => item.value) : isLiteral ? [type.value] : []).filter(v => v != null);
262
274
  const apiType = isArray ? 'array' : isString ? 'string' : isNumber ? 'number' : isBoolean ? 'boolean' : 'object';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "2.95.2",
3
+ "version": "2.96.1",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",