Skip to content

Commit 5215b83

Browse files
authored
Merge pull request #452 from Peefy/docs-0.10-system-module
docs: add full v0.10 builtin and system module documents
2 parents ae8c8fd + 00595af commit 5215b83

File tree

8 files changed

+88
-8
lines changed

8 files changed

+88
-8
lines changed

docs/reference/model/builtin.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ print(isunique(['abc', "a${'bc'}"])) # False
119119

120120
It should be noted that integers and floating-point numbers ignore the type difference and judge whether the values are equal.
121121

122+
## isnullish
123+
124+
Return `True` if the input value is `None` or `Undefined`, and `False` otherwise.
125+
126+
```python
127+
isnullish(None) # True
128+
isnullish(Undefined) # True
129+
isnullish(0) # False
130+
isnullish([]) # False
131+
isnullish({}) # False
132+
isnullish([None]) # False
133+
isnullish([Undefined]) # False
134+
```
135+
122136
## len
123137

124138
`len(x: str | [any] | {:}) -> int`

docs/reference/model/datetime.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ Return the `%Y-%m-%d %H:%M:%S` format date.
2020

2121
## now
2222

23-
`now() -> str`
23+
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`
2424

25-
Return the local time. e.g. `'Sat Jun 06 16:26:11 1998'`
25+
Return the local time format. e.g. 'Sat Jun 06 16:26:11 1998' or format the combined date and time per the specified format string, and the default date format is `%a %b %d %H:%M:%S %Y`.
2626

2727
## today
2828

2929
`today() -> str`
3030

3131
Return the `%Y-%m-%d %H:%M:%S.%{ticks}` format date.
32+
33+
## validate
34+
35+
`validate(date: str, format: str) -> bool`
36+
37+
Validate whether the provided date string matches the specified format.

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/builtin.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ print(isunique(['abc', "abc"])) # False
113113
print(isunique(['abc', "a${'bc'}"])) # False
114114
```
115115

116+
## isnullish
117+
118+
如果输入值是 `None``Undefined`,则返回 `True`;否则返回 `False`
119+
120+
```python
121+
isnullish(None) # True
122+
isnullish(Undefined) # True
123+
isnullish(0) # False
124+
isnullish([]) # False
125+
isnullish({}) # False
126+
isnullish([None]) # False
127+
isnullish([Undefined]) # False
128+
```
129+
116130
需要注意的是整数和浮点数会忽略类型差异,根据值是否相等判断。
117131

118132
## len

i18n/zh-CN/docusaurus-plugin-content-docs/current/reference/model/datetime.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ weight: 100
2020

2121
## now
2222

23-
`now() -> str`
23+
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`
2424

25-
返回当地时间,例如 `'Sat Jun 06 16:26:11 1998'`
25+
返回本地时间格式。例如:`Sat Jun 06 16:26:11 1998`,或者根据指定的格式字符串格式化组合的日期和时间,默认日期格式为 `%a %b %d %H:%M:%S %Y`
2626

2727
## today
2828

2929
`today() -> str`
3030

3131
返回以 `%Y-%m-%d %H:%M:%S.%{ticks}` 格式表示的时间。
32+
33+
## validate
34+
35+
`validate(date: str, format: str) -> bool`
36+
37+
验证提供的日期字符串是否与指定格式匹配。

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/builtin.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ print(isunique(['abc', "abc"])) # False
113113
print(isunique(['abc', "a${'bc'}"])) # False
114114
```
115115

116+
## isnullish
117+
118+
如果输入值是 `None``Undefined`,则返回 `True`;否则返回 `False`
119+
120+
```python
121+
isnullish(None) # True
122+
isnullish(Undefined) # True
123+
isnullish(0) # False
124+
isnullish([]) # False
125+
isnullish({}) # False
126+
isnullish([None]) # False
127+
isnullish([Undefined]) # False
128+
```
129+
116130
需要注意的是整数和浮点数会忽略类型差异,根据值是否相等判断。
117131

118132
## len

i18n/zh-CN/docusaurus-plugin-content-docs/version-0.10/reference/model/datetime.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ weight: 100
2020

2121
## now
2222

23-
`now() -> str`
23+
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`
2424

25-
返回当地时间,例如 `'Sat Jun 06 16:26:11 1998'`
25+
返回本地时间格式。例如:`Sat Jun 06 16:26:11 1998`,或者根据指定的格式字符串格式化组合的日期和时间,默认日期格式为 `%a %b %d %H:%M:%S %Y`
2626

2727
## today
2828

2929
`today() -> str`
3030

3131
返回以 `%Y-%m-%d %H:%M:%S.%{ticks}` 格式表示的时间。
32+
33+
## validate
34+
35+
`validate(date: str, format: str) -> bool`
36+
37+
验证提供的日期字符串是否与指定格式匹配。

versioned_docs/version-0.10/reference/model/builtin.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ print(isunique(['abc', "a${'bc'}"])) # False
119119

120120
It should be noted that integers and floating-point numbers ignore the type difference and judge whether the values are equal.
121121

122+
## isnullish
123+
124+
Return `True` if the input value is `None` or `Undefined`, and `False` otherwise.
125+
126+
```python
127+
isnullish(None) # True
128+
isnullish(Undefined) # True
129+
isnullish(0) # False
130+
isnullish([]) # False
131+
isnullish({}) # False
132+
isnullish([None]) # False
133+
isnullish([Undefined]) # False
134+
```
135+
122136
## len
123137

124138
`len(x: str | [any] | {:}) -> int`

versioned_docs/version-0.10/reference/model/datetime.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ Return the `%Y-%m-%d %H:%M:%S` format date.
2020

2121
## now
2222

23-
`now() -> str`
23+
`now(format: str = "%a %b %d %H:%M:%S %Y") -> str`
2424

25-
Return the local time. e.g. `'Sat Jun 06 16:26:11 1998'`
25+
Return the local time format. e.g. 'Sat Jun 06 16:26:11 1998' or format the combined date and time per the specified format string, and the default date format is `%a %b %d %H:%M:%S %Y`.
2626

2727
## today
2828

2929
`today() -> str`
3030

3131
Return the `%Y-%m-%d %H:%M:%S.%{ticks}` format date.
32+
33+
## validate
34+
35+
`validate(date: str, format: str) -> bool`
36+
37+
Validate whether the provided date string matches the specified format.

0 commit comments

Comments
 (0)