@zwa73/utils 1.0.276 → 1.0.278

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -29,9 +29,9 @@ export declare class Markdown<D extends Record<string, any> = Record<string, any
29
29
  * @param content - 代码内容
30
30
  * @param lang - 代码块语言类型
31
31
  */
32
- static buildCodeBlock(content: string, lang?: string): Promise<string>;
32
+ static buildCodeBlock(content: string, lang?: string): string;
33
33
  /**输出md文本 */
34
- stringify(opt: Exclude<Parameters<typeof stringify>[2], string | number>): Promise<string>;
34
+ stringify(opt?: Exclude<Parameters<typeof stringify>[2], string | number>): Promise<string>;
35
35
  /**根据标题提取块
36
36
  * @param opt - 选项
37
37
  */
@@ -59,8 +59,8 @@ class Markdown {
59
59
  * @param content - 代码内容
60
60
  * @param lang - 代码块语言类型
61
61
  */
62
- static async buildCodeBlock(content, lang) {
63
- return '```' + (lang ?? '') + content + '```';
62
+ static buildCodeBlock(content, lang) {
63
+ return '```' + (lang ?? '') + '\n' + content + '\n```';
64
64
  }
65
65
  /**输出md文本 */
66
66
  async stringify(opt) {
@@ -72,7 +72,7 @@ class Markdown {
72
72
  defaultKeyType: "PLAIN",
73
73
  lineWidth: 0,
74
74
  minContentWidth: 0,
75
- }, opt);
75
+ }, opt ?? {});
76
76
  const yamlText = Object.values(this.data ?? {}).length > 0 ? `---\n${(await getYaml()).stringify(this.data, fxopt)}---\n` : '';
77
77
  return `${yamlText}${this.content}`;
78
78
  //return (await getMatter()).stringify(this.content,this.data);
@@ -1,8 +1,7 @@
1
1
  import http from 'http';
2
- import type { LogLevel } from "@zwa73/js-utils";
2
+ import type { LogLevel, PromiseRetries } from "@zwa73/js-utils";
3
3
  import { PromiseQueue } from "@zwa73/js-utils";
4
4
  import FormData from "form-data";
5
- import type { PromiseRetries } from "./UtilFunctions";
6
5
  import type { AnyString, JToken, MPromise, PartialOption, StatusVerifyFn } from "./UtilInterfaces";
7
6
  /**网络请求返回值 */
8
7
  export type RequestResult<T> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.276",
3
+ "version": "1.0.278",
4
4
  "description": "my utils",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {