Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/samchon/typia into v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samchon committed Oct 11, 2024
2 parents be50227 + f1ad1a5 commit 0a8f5e2
Show file tree
Hide file tree
Showing 89 changed files with 889 additions and 320 deletions.
23 changes: 23 additions & 0 deletions debug/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@typia/debug",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node index",
"prepare": "ts-patch install && typia patch"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/uuid": "^10.0.0",
"ts-node": "^10.9.2",
"ts-patch": "^3.2.0",
"typescript": "^5.4.2"
},
"dependencies": {
"tstl": "^3.0.0",
"typia": "../typia-6.11.1.tgz",
"uuid": "^10.0.0"
}
}
12 changes: 12 additions & 0 deletions debug/src/protobuf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import typia from "typia";

interface MyObj {
private: boolean | null;
}

const encode = typia.protobuf.createEncode<MyObj>();
console.log(
encode({
private: true,
}),
);
4 changes: 4 additions & 0 deletions errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
"typescript": "^5.3.2"
},
"dependencies": {
<<<<<<< HEAD
"typia": "../typia-7.0.0-dev.20241011.tgz"
=======
"typia": "../typia-6.11.2.tgz"
>>>>>>> f1ad1a5748990c9ce0ab1d28de70ca83c5d76864
}
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"name": "typia",
<<<<<<< HEAD
"version": "7.0.0-dev.20241011",
=======
"version": "6.11.2",
>>>>>>> f1ad1a5748990c9ce0ab1d28de70ca83c5d76864
"description": "Superfast runtime validators with only one line",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
Expand Down Expand Up @@ -67,7 +71,7 @@
},
"homepage": "https://typia.io",
"dependencies": {
"@samchon/openapi": "^1.1.0",
"@samchon/openapi": "^1.1.1",
"commander": "^10.0.0",
"comment-json": "^4.2.3",
"inquirer": "^8.2.5",
Expand Down
14 changes: 0 additions & 14 deletions src/factories/ProtobufFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import { TransformerError } from "../transformers/TransformerError";

import { ValidationPipe } from "../typings/ValidationPipe";

import { Escaper } from "../utils/Escaper";

import { MetadataCollection } from "./MetadataCollection";
import { MetadataFactory } from "./MetadataFactory";

Expand Down Expand Up @@ -175,18 +173,6 @@ export namespace ProtobufFactory {
noSupport(
"object type with mixed static and dynamic key typed properties. Keep statics or dynamic only.",
);
// STATIC PROPERTY, BUT INVALID KEY NAME
if (
meta.objects.length &&
meta.objects.some((obj) =>
obj.properties.some(
(p) =>
p.key.isSoleLiteral() === true &&
Escaper.variable(p.key.getSoleLiteral()!) === false,
),
)
)
noSupport(`object type with invalid static key name.`);
// DYNAMIC OBJECT, BUT PROPERTY VALUE TYPE IS ARRAY
if (
meta.objects.length &&
Expand Down
9 changes: 2 additions & 7 deletions src/internal/$ProtobufSizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,5 @@ export class $ProtobufSizer implements $IProtobufWriter {
}
}

const strlen = (s: string): number => {
let b: number;
let i: number;
let c: number;
for (b = i = 0; (c = s.charCodeAt(i++)); b += c >> 11 ? 3 : c >> 7 ? 2 : 1);
return b;
};
export const strlen = (str: string): number => new Blob([str]).size;

4 changes: 2 additions & 2 deletions src/programmers/internal/llm_schema_object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ export const llm_schema_object = (props: {
/**
* @internal
*/
const join = (extra: ISuperfluous): ILlmSchema | undefined => {
const join = (extra: ISuperfluous): ILlmSchema | false => {
// LIST UP METADATA
const elements: [Metadata, ILlmSchema][] = Object.values(
extra.patternProperties || {},
);
if (extra.additionalProperties) elements.push(extra.additionalProperties);

// SHORT RETURN
if (elements.length === 0) return undefined;
if (elements.length === 0) return false;
else if (elements.length === 1) return elements[0]![1]!;

// MERGE METADATA AND GENERATE VULNERABLE SCHEMA
Expand Down
4 changes: 4 additions & 0 deletions test-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
"typescript": "^5.4.5"
},
"dependencies": {
<<<<<<< HEAD
"typia": "../typia-7.0.0-dev.20241011.tgz"
=======
"typia": "../typia-6.11.2.tgz"
>>>>>>> f1ad1a5748990c9ce0ab1d28de70ca83c5d76864
}
}
6 changes: 5 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"rimraf": "^5.0.5",
"ts-node": "^10.9.2",
"ts-patch": "^3.2.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"dependencies": {
"cli": "^1.0.1",
Expand All @@ -53,6 +53,10 @@
"suppress-warnings": "^1.0.2",
"tstl": "^3.0.0",
"uuid": "^9.0.1",
<<<<<<< HEAD
"typia": "../typia-7.0.0-dev.20241011.tgz"
=======
"typia": "../typia-6.11.2.tgz"
>>>>>>> f1ad1a5748990c9ce0ab1d28de70ca83c5d76864
}
}
3 changes: 2 additions & 1 deletion test/schemas/llm/type/ArrayAny.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
"nullables1",
"nullables2",
"union"
]
],
"additionalProperties": false
}
18 changes: 12 additions & 6 deletions test/schemas/llm/type/ArrayHierarchical.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
},
"departments": {
"type": "array",
Expand Down Expand Up @@ -56,7 +57,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
},
"employees": {
"type": "array",
Expand Down Expand Up @@ -89,7 +91,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
}
},
"nullable": false,
Expand All @@ -99,7 +102,8 @@
"age",
"grade",
"employeed_at"
]
],
"additionalProperties": false
}
}
},
Expand All @@ -110,7 +114,8 @@
"sales",
"created_at",
"employees"
]
],
"additionalProperties": false
}
}
},
Expand All @@ -121,6 +126,7 @@
"name",
"established_at",
"departments"
]
],
"additionalProperties": false
}
}
21 changes: 14 additions & 7 deletions test/schemas/llm/type/ArrayHierarchicalPointer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
},
"departments": {
"type": "array",
Expand Down Expand Up @@ -59,7 +60,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
},
"employees": {
"type": "array",
Expand Down Expand Up @@ -92,7 +94,8 @@
"required": [
"time",
"zone"
]
],
"additionalProperties": false
}
},
"nullable": false,
Expand All @@ -102,7 +105,8 @@
"age",
"grade",
"employeed_at"
]
],
"additionalProperties": false
}
}
},
Expand All @@ -113,7 +117,8 @@
"sales",
"created_at",
"employees"
]
],
"additionalProperties": false
}
}
},
Expand All @@ -124,12 +129,14 @@
"name",
"established_at",
"departments"
]
],
"additionalProperties": false
}
}
},
"nullable": false,
"required": [
"value"
]
],
"additionalProperties": false
}
6 changes: 4 additions & 2 deletions test/schemas/llm/type/ArraySimple.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"name",
"body",
"rank"
]
],
"additionalProperties": false
}
}
},
Expand All @@ -38,6 +39,7 @@
"name",
"email",
"hobbies"
]
],
"additionalProperties": false
}
}
3 changes: 2 additions & 1 deletion test/schemas/llm/type/ClassGetter.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"id",
"name",
"dead"
]
],
"additionalProperties": false
}
3 changes: 2 additions & 1 deletion test/schemas/llm/type/ClassMethod.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
"required": [
"name",
"age"
]
],
"additionalProperties": false
}
3 changes: 2 additions & 1 deletion test/schemas/llm/type/ClassPropertyAssignment.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
"note",
"editable",
"incremental"
]
],
"additionalProperties": false
}
6 changes: 4 additions & 2 deletions test/schemas/llm/type/CommentTagArray.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@
"both",
"equal",
"unique"
]
],
"additionalProperties": false
}
}
},
"nullable": false,
"required": [
"value"
]
],
"additionalProperties": false
}
3 changes: 2 additions & 1 deletion test/schemas/llm/type/CommentTagArrayUnion.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"minItems",
"maxItems",
"both"
]
],
"additionalProperties": false
}
}
6 changes: 4 additions & 2 deletions test/schemas/llm/type/CommentTagAtomicUnion.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
"nullable": false,
"required": [
"value"
]
],
"additionalProperties": false
}
}
},
"nullable": false,
"required": [
"value"
]
],
"additionalProperties": false
}
Loading

0 comments on commit 0a8f5e2

Please sign in to comment.