[2 认识迪士特之前的生活
您是否曾经尝试在模板文字中编写多行段落,但意识到它保留了凹痕,最终使用\ n?
$ bun index.ts
-200好
请求成功了。 “成功”的结果含义取决于HTTP方法:
*获取:资源已被获取...
*头:表示标题是...
*放置或发布:描述...的资源
*跟踪:消息主体包含...
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 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...函数dimend(){ const描述=' - 200 ok \ n' '请求成功了。 “成功”的结果含义取决于http方法:\ n \ n' ' *获取:资源已被获取... \ n' ' *头:表示标题为... \ n' ' * put或post:描述... \ 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...现在你知道迪士特
,但是现在,您不必再与自己进行谈判了。只需使用destent。
从'dedent'导入dettent 函数解释(){ const描述= dedent` -200好 请求成功了。 “成功”的结果含义取决于HTTP方法: *获取:资源已被获取... *头:表示标题是... *放置或发布:描述...的资源 *跟踪:消息主体包含... ` console.log(描述) } 解释()
$ bun index.ts
-200好
请求成功了。 “成功”的结果含义取决于HTTP方法:
*获取:资源已被获取...
*头:表示标题是...
*放置或发布:描述...的资源
*跟踪:消息主体包含...
import dedent from 'dedent' function explain() { const description = dedent` - 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 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好 请求成功了。 “成功”的结果含义取决于HTTP方法: *获取:资源已在消息主体中获取和传输。 *头:表示标题包含在没有任何消息主体的响应中。 *放置或发布:描述动作结果的资源在消息正文中传输。 *跟踪:消息主体包含服务器接收的请求消息。 - 201创建 该请求成功,因此创建了新的资源。 这通常是在发布请求后发送的响应,或某些提出请求。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3