Skip to content

Commit f7f8354

Browse files
committed
Update the readme.
1 parent e08a53a commit f7f8354

File tree

1 file changed

+61
-43
lines changed

1 file changed

+61
-43
lines changed

README.md

Lines changed: 61 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ ClassValidator.isExtend(Class, obj);
2727

2828
### ClassValidator
2929

30-
* **function isClass(classType)**
30+
* **isClass**
3131

32-
Check the class type is a Class.
32+
Defined: `function isClass(classType: Class): Boolean`
33+
34+
Describe: Check the class type is a Class.
3335

3436
Examples:
3537

@@ -43,21 +45,30 @@ ClassValidator.isExtend(Class, obj);
4345
ClassValidator.isClass(String); //return true;
4446
```
4547

46-
* **function isExtend(baseClassType, classType)**
48+
* **isExtend**
49+
50+
Defined: `function isExtend(baseClassType: Class, classType: Class): Boolean`
4751

48-
Check the class type is extends from base class type.
52+
Describe: Check the class type is extends from base class type.
4953

5054
Examples:
5155

5256
```js
53-
ClassValidator.isExtend(Object, String); //return true;
57+
class A{};
58+
class B extends A{};
59+
60+
ClassValidator.isExtend(Object, String); //return true;
61+
ClassValidator.isExtend(A, B); //return true;
62+
ClassValidator.isExtend(Object, B); //return true;
5463
```
5564

5665
### FunctionValidator
5766

58-
* **function isFunction(fun)**
67+
* **isFunction**
68+
69+
Defined: `function isFunction(fun: Function): Boolean`
5970

60-
Check the fun is a Function.
71+
Describe: Check the fun is a Function.
6172

6273
Examples:
6374
```js
@@ -68,9 +79,11 @@ ClassValidator.isExtend(Class, obj);
6879

6980
### NumberValidator
7081

71-
* **function isNumber(num)**
82+
* **isNumber**
7283

73-
Check the num is a Number.
84+
Defined: `function isNumber(num: Number): Boolean`
85+
86+
Describe: Check the num is a Number.
7487

7588
Examples:
7689

@@ -83,9 +96,11 @@ ClassValidator.isExtend(Class, obj);
8396

8497
### ObjectValidator
8598

86-
* **function isObj(obj)**
99+
* **isObj**
100+
101+
Defined: `function isObj(obj: Object): Boolean`
87102

88-
Check the obj is a instance of Object;
103+
Describe: Check the obj is a instance of Object;
89104

90105
Examples:
91106

@@ -98,9 +113,11 @@ ClassValidator.isExtend(Class, obj);
98113
ObjectValidator.isObj(new Object()); //return true;
99114
```
100115

101-
* **function isKindOf(classType, obj)**
116+
* **isKindOf**
117+
118+
Defined: `function isKindOf(classType: Class, obj: Object): Boolean`
102119

103-
Check the obj is belong this class type.
120+
Describe: Check the obj is belong this class type.
104121

105122
Examples:
106123

@@ -116,9 +133,11 @@ ClassValidator.isExtend(Class, obj);
116133
ObjectValidator.isKindOf(Object, new B()); //return true;
117134
```
118135

119-
* **function isValid(obj)**
136+
* **isValid**
120137

121-
Check the obj is a valid object.
138+
Defined: `function isValid(obj: Object): Boolean`
139+
140+
Describe: Check the obj is a valid object.
122141

123142
Examples:
124143

@@ -130,37 +149,28 @@ ClassValidator.isExtend(Class, obj);
130149
ObjectValidator.isValid(new Object()); //return true;
131150
```
132151

133-
* **function isEmpty(obj)**
152+
* **hasAnyProperty**
134153

135-
Check the obj is a empty object.
154+
Defined: `function hasAnyProperty(obj: Object): Boolean`
136155

137-
Examples:
138-
139-
```js
140-
ObjectValidator.isEmpty(undefined); //return true;
141-
ObjectValidator.isEmpty(null); //return true;
142-
ObjectValidator.isEmpty({}); //return true;
143-
ObjectValidator.isEmpty({a: 1}); //return false;
144-
```
145-
146-
* **function isNotEmpty(obj)**
147-
148-
Check the obj is not a empty object.
156+
Describe: Check the obj is not a empty object.
149157

150158
Examples:
151159

152160
```js
153-
ObjectValidator.isNotEmpty(undefined); //return false;
154-
ObjectValidator.isNotEmpty(null); //return false;
155-
ObjectValidator.isNotEmpty({}); //return false;
156-
ObjectValidator.isNotEmpty({a: 1}); //return true;
161+
ObjectValidator.hasAnyProperty(undefined); //return false;
162+
ObjectValidator.hasAnyProperty(null); //return false;
163+
ObjectValidator.hasAnyProperty({}); //return false;
164+
ObjectValidator.hasAnyProperty({a: 1}); //return true;
157165
```
158166

159167
### StringValidator
160168

161-
* **function isString(str)**
169+
* **isString**
162170

163-
Check the str is a string.
171+
Defined: `function isString(str: String): Boolean`
172+
173+
Describe: Check the str is a string.
164174

165175
Examples:
166176

@@ -171,9 +181,11 @@ ClassValidator.isExtend(Class, obj);
171181
StringValidator.isString(new String('a')); //return false;
172182
```
173183

174-
* **function isEmpty(str)**
184+
* **isEmpty**
185+
186+
Defined: `function isEmpty(str: String): Boolean`
175187

176-
Check the str is a empty string.
188+
Describe: Check the str is a empty string.
177189

178190
Examples:
179191

@@ -186,9 +198,11 @@ ClassValidator.isExtend(Class, obj);
186198
StringValidator.isEmpty(new String('a')); //return false;
187199
```
188200

189-
* **function isNotEmpty(str)**
201+
* **isNotEmpty**
202+
203+
Defined: `function isNotEmpty(str: String): Boolean`
190204

191-
Check the str is not a empty string.
205+
Describe: Check the str is not a empty string.
192206

193207
Examples:
194208

@@ -201,9 +215,11 @@ ClassValidator.isExtend(Class, obj);
201215
StringValidator.isEmpty(new String('a')); //return true;
202216
```
203217

204-
* **function isBlank(str)**
218+
* **isBlank**
205219

206-
Check the str is a blank string.
220+
Defined: `function isBlank(str: String): Boolean`
221+
222+
Describe: Check the str is a blank string.
207223

208224
Examples:
209225

@@ -218,9 +234,11 @@ ClassValidator.isExtend(Class, obj);
218234
StringValidator.isEmpty(new String('a')); //return false;
219235
```
220236

221-
* **function isNotBlank(str)**
237+
* **isNotBlank**
238+
239+
Defined: `function isNotBlank(str: String): Boolean`
222240

223-
Check the str is not a blank string.
241+
Describe: Check the str is not a blank string.
224242

225243
Examples:
226244

0 commit comments

Comments
 (0)