摘要:
Example 1: import mongoose from 'mongoose' const itemSchema = new mongoose.Schema( { name: { type: String, required: true, trim: true, maxlength: 50 } 阅读全文
摘要:
server.js: import itemRouter from './resources/item/item.router' export const app = express() app.use('/api/item', itemRouter) item.router.js import { 阅读全文
摘要:
In VSCode, install REST Clinet Extension: Create API_EXAMPLE.http file in root folder: ### Get mock GET http://localhost:3000/data HTTP/1.1 ### Post m 阅读全文
摘要:
type Corner = `${'top' | 'bottom'} - ${'left' | 'right'}` type Corner = Capitalize<`${'top' | 'bottom'} - ${'left' | 'right'}`> // "Top - left" | "Top 阅读全文
摘要:
V3: type JSONValue = | string | number | boolean | null | JSONArray | JSONObject; type JSONArray = JSONValue[]; type JSONObect = { [k: string]: JSONVa 阅读全文
摘要:
Let's see the unlabelled tuple type: type Address = [ number, string, string, number, ] function printAddress(...address: Address) { console.log(addre 阅读全文