diff --git a/packages/bussiness-model/cart.ts b/packages/bussiness-model/cart.ts new file mode 100644 index 0000000..617e099 --- /dev/null +++ b/packages/bussiness-model/cart.ts @@ -0,0 +1,5 @@ +class Cart{ + +} + +export default Cart \ No newline at end of file diff --git a/packages/bussiness-model/readme.md b/packages/bussiness-model/readme.md new file mode 100644 index 0000000..b646444 --- /dev/null +++ b/packages/bussiness-model/readme.md @@ -0,0 +1 @@ +## 业务模型相关 \ No newline at end of file diff --git a/packages/codec/readme.md b/packages/codec/readme.md new file mode 100644 index 0000000..03be399 --- /dev/null +++ b/packages/codec/readme.md @@ -0,0 +1,18 @@ +## about encode decode +所谓编码, 就是发送方将原文转换成另一种形式, 然后接收方使用解码算法进行解码获取到原文, 通常用于 信息加密, 信息压缩 等领域 + +1. HTML 编解码 + +通常对html编码常常ys + +`'` 转码成 `'` + +2. Unicode 编解码 + + +3. base64 编解码 + + +4. jwt Token 编解码 + +5. ASCII 编解码 \ No newline at end of file diff --git a/packages/codec/url-encode.ts b/packages/codec/url-encode.ts new file mode 100644 index 0000000..e69de29 diff --git a/packages/web/readme.md b/packages/web/readme.md index ebd50ed..aacbd94 100644 --- a/packages/web/readme.md +++ b/packages/web/readme.md @@ -1 +1,5 @@ # js web相关utils (需要依赖平台api) + +1. 懒加载图片 lozad (依赖 IntersectionObserver特性) + +2. 货币千分符($100,000.11) diff --git a/packages/web/rtl/readme.md b/packages/web/rtl/readme.md index f2dcae2..56d134a 100644 --- a/packages/web/rtl/readme.md +++ b/packages/web/rtl/readme.md @@ -2,8 +2,16 @@ 关于Unicode 编码 控制文本方向的逻辑 +## 备注 +```js +let originalString = "شعر مستعار-بشري-طويل-للغاية"; +let newString = originalString.replace(/-/g, ' '); // success +// let newString = originalString.replace('-', ' ') // error +console.log(newString); +``` + ## about https://juejin.cn/post/7314921235925565490 https://juejin.cn/post/7124887769796591653 \ No newline at end of file diff --git a/src/thousandify.js b/packages/web/thousandify.js similarity index 97% rename from src/thousandify.js rename to packages/web/thousandify.js index 3eeb7b5..1890d06 100644 --- a/src/thousandify.js +++ b/packages/web/thousandify.js @@ -47,11 +47,11 @@ export function thousandify(amount, option) { export function generatePriceTemplate(price, target) { const [intPartStr, decimalStr] = thousandify(price) const templateText = ` -
+
{{intPartStr}} . {{decimalStr}} -
+ ` const compiled = _.template(templateText) diff --git a/readme.md b/readme.md index 3e3e6a7..db6a965 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,3 @@ -## jskit \ No newline at end of file +## jskit + +- 0 depend \ No newline at end of file diff --git a/src/index.js b/src/index.js index 7ef12af..94e5b7c 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,4 @@ -import { thousandify, generatePriceTemplate } from './thousandify.js'; +import { thousandify, generatePriceTemplate } from '../packages/web/thousandify.js'; import { SignalType } from './useSignal.ts'; import * as webBom from '../packages/web/index.js'; import springer from '../packages/animation/springer.js';