Skip to content

Commit

Permalink
chore: add readme and codec pack
Browse files Browse the repository at this point in the history
  • Loading branch information
csrigogogo committed Oct 16, 2024
1 parent 9bee280 commit 0845d2a
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/bussiness-model/cart.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Cart{

}

export default Cart
1 change: 1 addition & 0 deletions packages/bussiness-model/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## 业务模型相关
18 changes: 18 additions & 0 deletions packages/codec/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## about encode decode
所谓编码, 就是发送方将原文转换成另一种形式, 然后接收方使用解码算法进行解码获取到原文, 通常用于 信息加密, 信息压缩 等领域

1. HTML 编解码

通常对html编码常常ys

`'` 转码成 `'`

2. Unicode 编解码


3. base64 编解码


4. jwt Token 编解码

5. ASCII 编解码
Empty file added packages/codec/url-encode.ts
Empty file.
4 changes: 4 additions & 0 deletions packages/web/readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# js web相关utils (需要依赖平台api)

1. 懒加载图片 lozad (依赖 IntersectionObserver特性)

2. 货币千分符($100,000.11)
8 changes: 8 additions & 0 deletions packages/web/rtl/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions src/thousandify.js → packages/web/thousandify.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ export function thousandify(amount, option) {
export function generatePriceTemplate(price, target) {
const [intPartStr, decimalStr] = thousandify(price)
const templateText = `
<div>
<section>
<span class="intPartStrWrapper">{{intPartStr}}</span>
<span class="intPoint">.</span>
<span class="decimalStrWrapper">{{decimalStr}}</span>
</div>
</section>
`
const compiled = _.template(templateText)

Expand Down
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
## jskit
## jskit

- 0 depend
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down

0 comments on commit 0845d2a

Please sign in to comment.