@fast-china/utils 2.1.6 → 2.1.8

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -2
  3. package/README.zh.md +4 -2
  4. package/THIRD_PARTY_LICENSES.md +26 -0
  5. package/dist/crypto/index.mjs +2240 -33
  6. package/dist/crypto/index.mjs.map +1 -1
  7. package/dist/dom/index.mjs +2 -0
  8. package/dist/env/index.mjs +4 -4
  9. package/dist/env/index.mjs.map +1 -1
  10. package/dist/index.d.mts +1918 -32
  11. package/dist/index.global.min.js +2 -2
  12. package/dist/index.global.min.js.map +1 -1
  13. package/dist/index.mjs +2 -0
  14. package/dist/internal/runtime.mjs +21 -1
  15. package/dist/internal/runtime.mjs.map +1 -1
  16. package/dist/logger/index.mjs +2 -2
  17. package/dist/logger/index.mjs.map +1 -1
  18. package/dist/storage/index.mjs +2 -2
  19. package/dist/storage/index.mjs.map +1 -1
  20. package/dist/string/index.mjs +2 -2
  21. package/dist/string/index.mjs.map +1 -1
  22. package/dist/vue/index.mjs +15 -0
  23. package/dist/vue/now.mjs +2 -2
  24. package/dist/vue/now.mjs.map +1 -1
  25. package/package.json +4 -6
  26. package/dist/array/index.d.mts +0 -94
  27. package/dist/async/index.d.mts +0 -145
  28. package/dist/base64/index.d.mts +0 -106
  29. package/dist/color/index.d.mts +0 -89
  30. package/dist/crypto/index.d.mts +0 -327
  31. package/dist/date/index.d.mts +0 -190
  32. package/dist/dom/style.d.mts +0 -29
  33. package/dist/env/index.d.mts +0 -62
  34. package/dist/function/index.d.mts +0 -13
  35. package/dist/identity/index.d.mts +0 -77
  36. package/dist/internal/text.d.mts +0 -15
  37. package/dist/logger/index.d.mts +0 -90
  38. package/dist/number/index.d.mts +0 -89
  39. package/dist/object/index.d.mts +0 -114
  40. package/dist/storage/index.d.mts +0 -115
  41. package/dist/string/index.d.mts +0 -141
  42. package/dist/vue/breakpoints.d.mts +0 -21
  43. package/dist/vue/element-size.d.mts +0 -25
  44. package/dist/vue/emits.d.mts +0 -23
  45. package/dist/vue/event-listener.d.mts +0 -16
  46. package/dist/vue/expose.d.mts +0 -11
  47. package/dist/vue/func.d.mts +0 -13
  48. package/dist/vue/index.d.mts +0 -15
  49. package/dist/vue/install.d.mts +0 -50
  50. package/dist/vue/now.d.mts +0 -13
  51. package/dist/vue/props.d.mts +0 -22
  52. package/dist/vue/render.d.mts +0 -11
  53. package/dist/vue/resize-observer.d.mts +0 -15
  54. package/dist/vue/slots.d.mts +0 -18
  55. package/dist/vue/window-size.d.mts +0 -16
  56. package/dist/vue/with.d.mts +0 -11
  57. package/docs/API.md +0 -155
  58. package/docs/API.zh-CN.md +0 -154
  59. package/docs/DEVELOPMENT_RELEASE.zh-CN.md +0 -65
  60. package/docs/RUNTIME_CONTRACT.md +0 -44
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to Fast.Utils are documented in this file.
4
4
 
5
+ ## [2.1.8] - 2026-09-14
6
+
7
+ ### Fixed
8
+
9
+ - Resolved uni-app injected `uni` and App-Plus `plus` identifiers at call time, with `globalThis` property fallbacks, so supported runtime APIs remain detectable when the host does not expose them as global object properties.
10
+
11
+ ## [2.1.7] - 2026-09-14
12
+
13
+ ### Changed
14
+
15
+ - Bundled CryptoJS into the ESM package output to avoid CommonJS subpath resolution failures in strict ESM and uni-app toolchains while preserving module-level tree-shaking.
16
+
5
17
  ## [2.1.6] - 2026-09-13
6
18
 
7
19
  ### Added
@@ -120,6 +132,8 @@ All notable changes to Fast.Utils are documented in this file.
120
132
 
121
133
  - Added authenticated ciphertext validation, bounded crypto parameters and payloads, unbiased Web Crypto randomness, prototype-safe query/object transforms, and namespace-scoped Storage cleanup.
122
134
 
135
+ [2.1.8]: https://github.com/China-xiaoFang/Fast.Utils/compare/v2.1.7...v2.1.8
136
+ [2.1.7]: https://github.com/China-xiaoFang/Fast.Utils/compare/v2.1.6...v2.1.7
123
137
  [2.1.6]: https://github.com/China-xiaoFang/Fast.Utils/compare/v2.1.5...v2.1.6
124
138
  [2.1.5]: https://github.com/China-xiaoFang/Fast.Utils/compare/v2.1.4...v2.1.5
125
139
  [2.1.4]: https://github.com/China-xiaoFang/Fast.Utils/compare/v2.1.3...v2.1.4
package/README.md CHANGED
@@ -59,7 +59,7 @@ configureStorage({
59
59
  });
60
60
  ```
61
61
 
62
- The active global configuration is immutable. Repeating the same configuration is idempotent; a conflicting configuration throws. The `crypto` option on `set/get` overrides only that operation and must match when writing and reading the same entry; it does not mutate global configuration. A custom `codec` may be supplied instead of global `crypto`. In uni-app, `Local` automatically uses the global synchronous Storage API; `Session` throws because uni-app has no sessionStorage equivalent. `clear()` removes only keys inside the active prefix.
62
+ The active global configuration is immutable. Repeating the same configuration is idempotent; a conflicting configuration throws. The `crypto` option on `set/get` overrides only that operation and must match when writing and reading the same entry; it does not mutate global configuration. A custom `codec` may be supplied instead of global `crypto`. In uni-app, `Local` automatically resolves the runtime-injected `uni` object and uses its synchronous Storage API; `Session` throws because uni-app has no sessionStorage equivalent. `clear()` removes only keys inside the active prefix.
63
63
 
64
64
  ## Base64
65
65
 
@@ -133,6 +133,8 @@ Base64 and Crypto text decoding/decryption functions return the primitive-string
133
133
 
134
134
  Store passwords with `HashPasswordPBKDF2SHA256` and `VerifyPasswordPBKDF2SHA256`. MD5, SHA-1, AES-CBC, and AES-ECB do not provide password-storage or authenticated-encryption guarantees. See the [API reference](./docs/API.md#crypto) for the complete method list and security boundaries.
135
135
 
136
+ CryptoJS is bundled into the ESM and CDN artifacts for the compatibility hash and AES APIs. Consumers do not install or resolve `crypto-js` subpaths; applications that do not use Crypto APIs can still remove the independent crypto module through Tree Shaking.
137
+
136
138
  ## Vue 3
137
139
 
138
140
  ```ts
@@ -162,7 +164,7 @@ The `object` module includes dependency-free deep cloning and equality plus pred
162
164
  - The package-manager entry is pure ESM; the CDN entry is a separately minified IIFE.
163
165
  - ES2022 modern browsers and WebViews.
164
166
  - Vue 3.5.11 or newer through a required peer dependency.
165
- - uni-app through automatic global `uni` detection when Storage is configured.
167
+ - uni-app through call-time detection of runtime-injected `uni` and App-Plus `plus`, with global-property fallbacks.
166
168
  - No import-time access to `window`, Storage, or `uni`; unsupported calls fail explicitly.
167
169
  - Web Crypto, URL, Intl, TextEncoder, and related platform capabilities are not polyfilled.
168
170
 
package/README.zh.md CHANGED
@@ -59,7 +59,7 @@ configureStorage({
59
59
  });
60
60
  ```
61
61
 
62
- 激活后的全局配置不可变;相同配置重复调用保持幂等,不同配置会抛错。`set/get` 的 `crypto` 选项只覆盖单次操作,读写同一条目时必须保持一致,不会改变全局配置。自定义 `codec` 与全局 `crypto` 不能同时使用。uni-app 中 `Local` 会自动使用全局同步 Storage API;由于没有等价的 sessionStorage,`Session` 会明确抛错。`clear()` 只清理当前前缀。
62
+ 激活后的全局配置不可变;相同配置重复调用保持幂等,不同配置会抛错。`set/get` 的 `crypto` 选项只覆盖单次操作,读写同一条目时必须保持一致,不会改变全局配置。自定义 `codec` 与全局 `crypto` 不能同时使用。uni-app 中 `Local` 会自动解析运行时注入的 `uni` 对象并使用其同步 Storage API;由于没有等价的 sessionStorage,`Session` 会明确抛错。`clear()` 只清理当前前缀。
63
63
 
64
64
  ## Base64
65
65
 
@@ -133,6 +133,8 @@ Base64 与 Crypto 的文本解码/解密入口返回原始字符串类型 `Decod
133
133
 
134
134
  密码存储使用 `HashPasswordPBKDF2SHA256` 和 `VerifyPasswordPBKDF2SHA256`。MD5、SHA-1、AES-CBC 与 AES-ECB 不提供密码存储或认证加密保证。完整方法列表和安全边界见 [API 文档](./docs/API.zh-CN.md#crypto)。
135
135
 
136
+ 兼容哈希与 AES API 使用的 CryptoJS 已内联到 ESM 和 CDN 产物,消费项目无需安装或解析 `crypto-js` 子路径;未使用 Crypto API 的应用仍可通过 Tree Shaking 移除独立的加密模块。
137
+
136
138
  ## Vue 3
137
139
 
138
140
  ```ts
@@ -162,7 +164,7 @@ useEventListener(document, "visibilitychange", () => console.log(document.visibi
162
164
  - 包管理器入口为纯 ESM;CDN 入口为单独压缩的 IIFE。
163
165
  - 面向 ES2022 现代浏览器与 WebView。
164
166
  - Vue 3.5.11 及以上版本通过必须安装的 Peer Dependency 接入。
165
- - 配置 Storage 时自动检测全局 `uni` 并接入 uni-app。
167
+ - 调用时检测运行时注入的 `uni` 和 App-Plus `plus`,并兼容对应全局属性。
166
168
  - 导入阶段不访问 `window`、Storage 或 `uni`;不支持的调用明确失败。
167
169
  - 不注入 Web Crypto、URL、Intl、TextEncoder 等 Polyfill。
168
170
 
@@ -0,0 +1,26 @@
1
+ # Third-Party Licenses
2
+
3
+ ## CryptoJS
4
+
5
+ CryptoJS is licensed under the MIT License.
6
+
7
+ Copyright (c) 2009-2013 Jeff Mott
8
+ Copyright (c) 2013-2016 Evan Vosberg
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in
18
+ all copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26
+ THE SOFTWARE.