テンプレートの文字通りでマルチラインの段落を書き込もうとしたことはありますか?
function explain() { const description = ` - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the... ` console.log(description) } explain()$ bun index.ts -200 OK リクエストは成功しました。 「成功」の結果の意味は、HTTPメソッドに依存します。 *取得:リソースが取得されました... *ヘッド:表現ヘッダーは... * PUTまたはPOST:説明するリソース... *トレース:メッセージ本文には...
$ bun index.ts - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the...
待って、インデントを削除する必要がありますか?function explain(){ const説明= '-200 ok \ n' 'リクエストは成功しました。 「成功」の結果の意味は、httpメソッドに依存します:\ n \ n ' ' * get:リソースが取得されました... \ n' ' *ヘッド:表現ヘッダーは... \ n'です ' * put or cost:説明するリソース... \ n' ' *トレース:メッセージ本文には... \ n'が含まれています console.log(説明) } 説明する()いや。美しくフォーマットされたコードをあきらめることはできません。
$ bun index.ts - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the...
私はそれを取ります。 ?このため、マルチラインテキストは常に頭痛の種です。
今、あなたはデーデントを知っています
$ bun index.ts - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the...私がしたことは、テンプレートのリテラルの前にdedentを追加することでした。あなたはそれを信じていませんか?
$ bun index.ts - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the...それはすべての不必要なインデントを削除し、予想通りにそれを作ります。
なぜもっと複雑なものを試してみませんか?
function explain() { const description = ` - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the... ` console.log(description) } explain()$ bun index.ts -200 OK リクエストは成功しました。 「成功」の結果の意味は、HTTPメソッドに依存します。 *取得:リソースがメッセージ本文にフェッチされ、送信されました。 *ヘッド:表現ヘッダーは、メッセージ本文なしで応答に含まれています。 * PUTまたはPOST:アクションの結果を説明するリソースは、メッセージ本文に送信されます。 *トレース:メッセージ本文には、サーバーが受信した要求メッセージが含まれています。 -21作成 リクエストは成功し、その結果、新しいリソースが作成されました。 これは通常、郵送リクエストの後に送信される応答、または一部のリクエストです。
$ bun index.ts - 200 OK The request succeeded. The result meaning of "success" depends on the HTTP method: * GET: The resource has been fetched... * HEAD: The representation headers are... * PUT or POST: The resource describing... * TRACE: The message body contains the...soo smoooth!?
免責事項: 提供されるすべてのリソースの一部はインターネットからのものです。お客様の著作権またはその他の権利および利益の侵害がある場合は、詳細な理由を説明し、著作権または権利および利益の証拠を提出して、電子メール [email protected] に送信してください。 できるだけ早く対応させていただきます。
Copyright© 2022 湘ICP备2022001581号-3