xshell 1.2.64 → 1.2.65

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.
package/net.d.ts CHANGED
@@ -278,5 +278,5 @@ export declare class RemoteClient {
278
278
  [inspect.custom](): {
279
279
  remote: string;
280
280
  websocket: string;
281
- } & Omit<this, "call" | typeof import("util").inspect.custom | "websocket" | "remote" | "send">;
281
+ } & Omit<this, typeof import("util").inspect.custom | "call" | "websocket" | "remote" | "send">;
282
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.2.64",
3
+ "version": "1.2.65",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/path.d.ts CHANGED
@@ -54,7 +54,7 @@ export declare function extname(path: string): string;
54
54
  /** `/` */
55
55
  export declare const sep = "/";
56
56
  /** The platform-specific file delimiter. ';' or ':'. */
57
- export declare const delimiter: ";" | ":";
57
+ export declare const delimiter: ":" | ";";
58
58
  /** Returns an object from a path string - the opposite of format().
59
59
  @param path path to evaluate.
60
60
  @throws {TypeError} if `path` is not a string. */
@@ -81,7 +81,7 @@ export declare let path: {
81
81
  basename: typeof basename;
82
82
  extname: typeof extname;
83
83
  sep: string;
84
- delimiter: ";" | ":";
84
+ delimiter: ":" | ";";
85
85
  parse: typeof parse;
86
86
  format: typeof format;
87
87
  toNamespacedPath: typeof toNamespacedPath;
@@ -180,6 +180,8 @@ declare global {
180
180
  /** 去除重复元素(可按 mapper 选择或计算某个值来去重),重复值保留最后出现的那个
181
181
  - mapper?: 可以是 key (string, number, symbol) 或 (obj: any) => any */
182
182
  unique(this: T[], mapper?: keyof T | Mapper<T>): T[];
183
+ /** map 并 select 对象中的某个属性,返回属性数组 */
184
+ select<TKey extends keyof T = keyof T>(this: T[], key: TKey): T[TKey][];
183
185
  /**
184
186
  - trim_line?: `true`
185
187
  - rm_empty_lines?: `true`
@@ -485,6 +485,9 @@ if (!globalThis.my_prototype_defined) {
485
485
  },
486
486
  join_lines(append = Boolean(this.length)) {
487
487
  return `${this.join('\n')}${append ? '\n' : ''}`;
488
+ },
489
+ select(key) {
490
+ return this.map(select(key));
488
491
  }
489
492
  })
490
493
  });