@i.un/libs 1.0.8 → 1.0.10

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.
@@ -232,4 +232,22 @@ export declare function getContactInfo(): {
232
232
  companyPicture: string;
233
233
  location: string | undefined;
234
234
  };
235
+ /**
236
+ * 把选择器调试函数挂到 window 上,方便在 LinkedIn 页面控制台里直接调用。
237
+ *
238
+ * 改为显式调用而非模块顶层副作用,原因有二:
239
+ * - 本库也会被打进 Service Worker / Node 测试,那里没有 window,
240
+ * 顶层直接访问会在脚本求值阶段抛 ReferenceError
241
+ * (扩展表现为 "Service worker registration failed. Status code: 15")
242
+ * - 库不该无条件污染消费方的全局作用域,撞名很难排查
243
+ *
244
+ * @example
245
+ * ```ts
246
+ * // 只在需要调试的 content script 里调一次
247
+ * exposeLinkedinDebugHelpers();
248
+ * // 然后在页面控制台:
249
+ * // getElement({ page: "profilePage", key: "fullName" })
250
+ * ```
251
+ */
252
+ export declare function exposeLinkedinDebugHelpers(): void;
235
253
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@i.un/libs",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "一个实用的ts函数库",
5
5
  "type": "module",
6
6
  "source": "src/index.ts",
@@ -18,6 +18,7 @@
18
18
  "build": "microbundle --tsconfig tsconfig.build.json && npm run link",
19
19
  "dev": "microbundle watch",
20
20
  "test": "jest",
21
+ "check:readme": "node scripts/check-readme.mjs",
21
22
  "doc": "typedoc",
22
23
  "link": "yalc publish && yalc push"
23
24
  },
@@ -42,11 +43,11 @@
42
43
  "ts-node": "^10.9.2",
43
44
  "tslib": "^2.8.1",
44
45
  "typedoc": "^0.26.11",
45
- "typescript": "^5.8.3",
46
+ "typescript": "^6.0.3",
46
47
  "yalc": "1.0.0-pre.53"
47
48
  },
48
49
  "repository": {
49
50
  "type": "git",
50
51
  "url": "git+https://github.com/zhyswan/libs.git"
51
52
  }
52
- }
53
+ }