0%

好软推荐~~~这里列出的都是我使用过的,并且觉得还不错的软件 💡 PS. 本页面长期处于更新状态~~ 文本处理 Typora 超级好用的 Markdown 编辑器 Notepad3 用来代替 Windows 自带的记事

用例如下: import { Type } from '@sinclair/typebox'; import { TypeCompiler } from '@sinclair/typebox/compiler'; const schema = Type.Object({ email: Type.String({ format: 'email' }), }); const value = { email: 'test@example.org', }; const C = TypeCompiler.Compile(schema); const valid = C.Check(value); const errors = C.Errors(value).First(); console.log('isValid:', valid); console.log(errors); // 输出结果 // isValid: false // { // type: 49, // schema: { format: 'email', type: 'string', [Symbol(TypeBox.Kind)]:

TypeBox 是一个用于在 TypeScript 中动态创建 JSON Schema 的工具库,性能很高,Elysia.js 校验参数时底层依赖的就是这个库。 类似 Zod,官方提供了一个 SetErrorFunction 方法来自定义

去 https://www.postgresql.org/download/windows/ 下载压缩包,有安装版和压缩档版,个人习惯使用便携版本,下载后解压到指定目录即可。 ​​ 初始化数据目录: 在解压后的 PostgreSQL 根目录下新建 data​ 文

示例代码如下: getDriverRoute() { myAmapFun.getDrivingRoute({ origin: `${this.startPoint.longitude},${this.startPoint.latitude}`, destination: `${this.endPoint.longitude},${this.endPoint.latitude}`, strategy: 5, success: (res) => { const points = []; const { steps } = res.paths[0]; for (let item of steps) { item.polyline = item.polyline.split(";"); for (let line of item.polyline) { points.push({ longitude: line.split(",")[0], latitude: line.split(",")[1], }); } } this.polyline = [ { points: points, color: "#12c983", width: 8, arrowLine: false, }, ]; }, }); }