Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# 更新日志


## [v4.1.5](https://github.com/buession/buession-prototype/releases/tag/4.1.5)(2025-04-10)

### 🐞 BUG 修复

- 修复 Optional 和 Try 导出问题


## [v4.1.4](https://github.com/buession/buession-prototype/releases/tag/4.1.4)(2025-04-10)

### 🐞 BUG 修复
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@buession/prototype",
"alias": "prototype",
"version": "v4.1.4",
"version": "v4.1.5",
"description": "A native object extension framework for Javascript.",
"homepage": "https://prototype.buession.com/",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion site/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ banner:
btns:
- { name: '开 始', href: '/docs/quickstart.html', primary: true }
- { name: 'Github >', href: 'https://github.com/buession/buession-prototype' }
caption: '当前版本: v4.1.3'
caption: '当前版本: v4.1.5'
features:
- { name: '优雅', desc: '旨在提供便捷的、可靠的基于原生 JavaScript/TypeScript 扩展的类库,拥有完善的文档和高可读性的源码' }
- { name: '易用', desc: '觉大部分 API 基于原生 JavaScript/TypeScript 对象/类的扩展,参考学习 prototype.js' }
Expand Down
4 changes: 2 additions & 2 deletions site/src/manual/4.1/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -901,14 +901,14 @@ export default defineComponent({
```


### **random(length: number, type?: RandomType = "NUMERIC" | "LETTER" | "LETTER_NUMERIC" | "CHINESE" | undefined)**
### **random(length: number, type?: sring | RandomType = "NUMERIC" | "LETTER" | "LETTER_NUMERIC" | "CHINESE" | undefined)**
* 类型:`Function`

* 功能描述:生成随机字符串

* 参数:length - `number` 生成字符串的长度

             type - `NUMERIC | LETTER | LETTER_NUMERIC | CHINESE | undefined` 生成类型,可选参数,当未指定时为 LETTER_NUMERIC
             type - `NUMERIC | LETTER | LETTER_NUMERIC | CHINESE | undefined` 生成类型 / 随机字符串范围,可选参数,当未指定时为 LETTER_NUMERIC

NUMERIC - 数字随机字符串

Expand Down
21 changes: 5 additions & 16 deletions src/optional.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,11 @@ class Optional<T> {
}
}

declare global {
namespace NodeJS {
interface Global {
Optional: typeof Optional;
}
}

interface Window {
Optional: typeof Optional;
}
interface Window {
Optional: typeof Optional;
}

declare var Window: {
Optional: typeof Optional;
}

window.Optional = Optional;

export default {}
prototype: Window;
new(): Window;
};
21 changes: 5 additions & 16 deletions src/try.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@ const Try = {
}
}

declare global {
namespace NodeJS {
interface Global {
Try: typeof Try;
}
}

interface Window {
Try: typeof Try;
}
interface Window {
Try: typeof Try;
}

declare var Window: {
Try: typeof Try;
}

window.Try = Try;

export default {}
prototype: Window;
new(): Window;
};