Commit 7fb9e0c5 authored by nanahira's avatar nanahira

improves

parent 1f42abcc
Pipeline #6334 passed with stages
in 1 minute and 9 seconds
{
"name": "koishi-utils-schemagen",
"version": "1.1.4",
"version": "1.1.5",
"description": "在 Koishi.js 中,使用类装饰器定义 Schema",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
......@@ -25,7 +25,7 @@
"koishijs",
"utils-schema"
],
"author": "Nanahira",
"author": "Nanahira <nanahira@momobako.com>",
"license": "MIT",
"peerDependencies": {
"koishi": "^4.0.0-alpha.10",
......
export const SchemaMetaKey = '_koishi_schema_meta';
export const SchemaKeysMetaKey = '_koishi_schemakeys_meta';
export const SchemaClassKey = '_koishi_schema_class_meta';
export const SchemaMetaKey = Symbol('_koishi_schema_meta');
export const SchemaKeysMetaKey = Symbol('_koishi_schemakeys_meta');
export const SchemaClassKey = Symbol('_koishi_schema_class_meta');
......@@ -34,12 +34,7 @@ function getStringFromNativeType(nativeType: any) {
if (!nativeTypeString.startsWith('function ')) {
return;
}
const firstLeftBracketPos = nativeTypeString.indexOf('()');
if (firstLeftBracketPos === -1) {
return;
}
const typeString = nativeTypeString.slice(9, firstLeftBracketPos);
return typeString.toLowerCase();
return nativeType.name?.toLowerCase();
}
export function DefineSchema(options: SchemaOptions = {}): PropertyDecorator {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment