koatty_validation 1.3.1 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.rollup.config.js CHANGED
@@ -1,63 +1,63 @@
1
- /*
2
- * @Description:
3
- * @Usage:
4
- * @Author: richen
5
- * @Date: 2021-12-17 10:20:44
6
- * @LastEditTime: 2021-12-18 11:58:46
7
- */
8
- import json from "@rollup/plugin-json";
9
- import typescript from 'rollup-plugin-typescript2';
10
- // import babel from '@rollup/plugin-babel';
11
-
12
- export default [
13
- {
14
- input: './src/index.ts',
15
- output: [{
16
- format: 'cjs',
17
- file: './dist/index.js',
18
- banner: require('./scripts/copyright')
19
- }],
20
- plugins: [
21
- // babel({
22
- // babelHelpers: "runtime",
23
- // configFile: './babel.config.js',
24
- // exclude: 'node_modules/**',
25
- // }),
26
- json(),
27
- typescript({
28
- tsconfigOverride: {
29
- compilerOptions: {
30
- declaration: false,
31
- declarationMap: false,
32
- module: "ESNext"
33
- }
34
- }
35
- })
36
- ]
37
- },
38
- {
39
- input: './src/index.ts',
40
- output: [{
41
- format: 'es',
42
- file: './dist/index.mjs',
43
- banner: require('./scripts/copyright')
44
- }],
45
- plugins: [
46
- // babel({
47
- // babelHelpers: "runtime",
48
- // configFile: './babel.config.js',
49
- // exclude: 'node_modules/**',
50
- // }),
51
- json(),
52
- typescript({
53
- tsconfigOverride: {
54
- compilerOptions: {
55
- declaration: false,
56
- declarationMap: false,
57
- module: "ESNext"
58
- }
59
- }
60
- })
61
- ]
62
- }
1
+ /*
2
+ * @Description:
3
+ * @Usage:
4
+ * @Author: richen
5
+ * @Date: 2021-12-17 10:20:44
6
+ * @LastEditTime: 2021-12-18 11:58:46
7
+ */
8
+ import json from "@rollup/plugin-json";
9
+ import typescript from 'rollup-plugin-typescript2';
10
+ // import babel from '@rollup/plugin-babel';
11
+
12
+ export default [
13
+ {
14
+ input: './src/index.ts',
15
+ output: [{
16
+ format: 'cjs',
17
+ file: './dist/index.js',
18
+ banner: require('./scripts/copyright')
19
+ }],
20
+ plugins: [
21
+ // babel({
22
+ // babelHelpers: "runtime",
23
+ // configFile: './babel.config.js',
24
+ // exclude: 'node_modules/**',
25
+ // }),
26
+ json(),
27
+ typescript({
28
+ tsconfigOverride: {
29
+ compilerOptions: {
30
+ declaration: false,
31
+ declarationMap: false,
32
+ module: "ESNext"
33
+ }
34
+ }
35
+ })
36
+ ]
37
+ },
38
+ {
39
+ input: './src/index.ts',
40
+ output: [{
41
+ format: 'es',
42
+ file: './dist/index.mjs',
43
+ banner: require('./scripts/copyright')
44
+ }],
45
+ plugins: [
46
+ // babel({
47
+ // babelHelpers: "runtime",
48
+ // configFile: './babel.config.js',
49
+ // exclude: 'node_modules/**',
50
+ // }),
51
+ json(),
52
+ typescript({
53
+ tsconfigOverride: {
54
+ compilerOptions: {
55
+ declaration: false,
56
+ declarationMap: false,
57
+ module: "ESNext"
58
+ }
59
+ }
60
+ })
61
+ ]
62
+ }
63
63
  ]
package/CHANGELOG.md CHANGED
@@ -2,72 +2,76 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ### [1.3.1](https://github.com/koatty/koatty_validation/compare/v1.3.0...v1.3.1) (2024-01-07)
6
-
7
-
8
- ### Bug Fixes
9
-
10
- * comment ([d898cf6](https://github.com/koatty/koatty_validation/commit/d898cf68bc8693f78155b7208b419dc4b11dffb4))
11
- * dto赋值类型 ([5a1d68d](https://github.com/koatty/koatty_validation/commit/5a1d68dea0b67e988427c54abae9bfe76a6eaf48))
12
-
13
- ## [1.3.0](https://github.com/koatty/koatty_validation/compare/v1.2.10...v1.3.0) (2024-01-03)
14
-
15
-
16
- ### Features
17
-
18
- * 增加@CheckFunc ([d5bdc2d](https://github.com/koatty/koatty_validation/commit/d5bdc2d51cdbf6d558e376bfda51e126158d4e75))
19
-
20
-
21
- ### Bug Fixes
22
-
23
- * export ValidFuncs ([7d42023](https://github.com/koatty/koatty_validation/commit/7d42023138e9577c9646423c4c38faffba46fb10))
24
-
25
- ### [1.2.10](https://github.com/koatty/koatty_validation/compare/v1.2.9...v1.2.10) (2023-12-16)
26
-
27
-
28
- ### Bug Fixes
29
-
30
- * assign dto property ([2357642](https://github.com/koatty/koatty_validation/commit/2357642f6ac1479c839454d40ec4bd89f3fbd7b2))
31
-
32
- ### [1.2.9](https://github.com/koatty/koatty_validation/compare/v1.2.8...v1.2.9) (2023-09-01)
33
-
34
- ### [1.2.8](https://github.com/koatty/koatty_validation/compare/v1.2.7...v1.2.8) (2023-02-17)
35
-
36
-
37
- ### Bug Fixes
38
-
39
- * convert type ([924449d](https://github.com/koatty/koatty_validation/commit/924449d9f5fd7b14cbe3c1532f96416e69cc4eed))
40
-
41
- ### [1.2.7](https://github.com/koatty/koatty_validation/compare/v1.2.6...v1.2.7) (2023-02-17)
42
-
43
-
44
- ### Bug Fixes
45
-
46
- * add script ([ca82c14](https://github.com/koatty/koatty_validation/commit/ca82c14b0a2226024fb2c4476ba7353be7a2f65a))
47
- * plainToClass convert type ([06ed46e](https://github.com/koatty/koatty_validation/commit/06ed46e21ce191dc1c9f5c18ee7d029e9b6d4abf))
48
-
49
- ### [1.2.6](https://github.com/koatty/koatty_validation/compare/v1.2.5...v1.2.6) (2023-01-09)
50
-
51
-
52
- ### Bug Fixes
53
-
54
- * err msg ([18632d4](https://github.com/koatty/koatty_validation/commit/18632d4c9b05b1d117be7f8170da0ce014018ab8))
55
-
56
- ### [1.2.5](https://github.com/koatty/koatty_validation/compare/v1.2.4...v1.2.5) (2022-08-19)
57
-
58
-
59
- ### Bug Fixes
60
-
61
- * merge ([52c65f4](https://github.com/koatty/koatty_validation/commit/52c65f41c46a02a3fc5735e6e22ee6a3ed5337f8))
62
-
63
- ### [1.2.4](https://github.com/koatty/koatty_validation/compare/v1.2.3...v1.2.4) (2022-05-27)
64
-
65
- ### [1.2.3](https://github.com/koatty/koatty_validation/compare/v1.2.2...v1.2.3) (2022-03-09)
66
-
67
- ### [1.2.2](https://github.com/koatty/koatty_validation/compare/v1.2.0...v1.2.2) (2022-02-25)
68
-
69
- ## [1.2.0](https://github.com/koatty/koatty_validation/compare/v1.1.0...v1.2.0) (2022-02-25)
70
-
71
- ## [1.1.0](https://github.com/koatty/koatty_validation/compare/v1.0.12...v1.1.0) (2022-02-16)
72
-
73
- ## [2.0.0](https://github.com/koatty/koatty_validation/compare/v1.0.12...v2.0.0) (2022-02-16)
5
+ ### [1.3.4](https://github.com/koatty/koatty_validation/compare/v1.3.1...v1.3.4) (2024-10-31)
6
+
7
+ ### [1.3.2](https://github.com/koatty/koatty_validation/compare/v1.3.1...v1.3.2) (2024-10-31)
8
+
9
+ ### [1.3.1](https://github.com/koatty/koatty_validation/compare/v1.3.0...v1.3.1) (2024-01-07)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * comment ([d898cf6](https://github.com/koatty/koatty_validation/commit/d898cf68bc8693f78155b7208b419dc4b11dffb4))
15
+ * dto赋值类型 ([5a1d68d](https://github.com/koatty/koatty_validation/commit/5a1d68dea0b67e988427c54abae9bfe76a6eaf48))
16
+
17
+ ## [1.3.0](https://github.com/koatty/koatty_validation/compare/v1.2.10...v1.3.0) (2024-01-03)
18
+
19
+
20
+ ### Features
21
+
22
+ * 增加@CheckFunc ([d5bdc2d](https://github.com/koatty/koatty_validation/commit/d5bdc2d51cdbf6d558e376bfda51e126158d4e75))
23
+
24
+
25
+ ### Bug Fixes
26
+
27
+ * export ValidFuncs ([7d42023](https://github.com/koatty/koatty_validation/commit/7d42023138e9577c9646423c4c38faffba46fb10))
28
+
29
+ ### [1.2.10](https://github.com/koatty/koatty_validation/compare/v1.2.9...v1.2.10) (2023-12-16)
30
+
31
+
32
+ ### Bug Fixes
33
+
34
+ * assign dto property ([2357642](https://github.com/koatty/koatty_validation/commit/2357642f6ac1479c839454d40ec4bd89f3fbd7b2))
35
+
36
+ ### [1.2.9](https://github.com/koatty/koatty_validation/compare/v1.2.8...v1.2.9) (2023-09-01)
37
+
38
+ ### [1.2.8](https://github.com/koatty/koatty_validation/compare/v1.2.7...v1.2.8) (2023-02-17)
39
+
40
+
41
+ ### Bug Fixes
42
+
43
+ * convert type ([924449d](https://github.com/koatty/koatty_validation/commit/924449d9f5fd7b14cbe3c1532f96416e69cc4eed))
44
+
45
+ ### [1.2.7](https://github.com/koatty/koatty_validation/compare/v1.2.6...v1.2.7) (2023-02-17)
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * add script ([ca82c14](https://github.com/koatty/koatty_validation/commit/ca82c14b0a2226024fb2c4476ba7353be7a2f65a))
51
+ * plainToClass convert type ([06ed46e](https://github.com/koatty/koatty_validation/commit/06ed46e21ce191dc1c9f5c18ee7d029e9b6d4abf))
52
+
53
+ ### [1.2.6](https://github.com/koatty/koatty_validation/compare/v1.2.5...v1.2.6) (2023-01-09)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * err msg ([18632d4](https://github.com/koatty/koatty_validation/commit/18632d4c9b05b1d117be7f8170da0ce014018ab8))
59
+
60
+ ### [1.2.5](https://github.com/koatty/koatty_validation/compare/v1.2.4...v1.2.5) (2022-08-19)
61
+
62
+
63
+ ### Bug Fixes
64
+
65
+ * merge ([52c65f4](https://github.com/koatty/koatty_validation/commit/52c65f41c46a02a3fc5735e6e22ee6a3ed5337f8))
66
+
67
+ ### [1.2.4](https://github.com/koatty/koatty_validation/compare/v1.2.3...v1.2.4) (2022-05-27)
68
+
69
+ ### [1.2.3](https://github.com/koatty/koatty_validation/compare/v1.2.2...v1.2.3) (2022-03-09)
70
+
71
+ ### [1.2.2](https://github.com/koatty/koatty_validation/compare/v1.2.0...v1.2.2) (2022-02-25)
72
+
73
+ ## [1.2.0](https://github.com/koatty/koatty_validation/compare/v1.1.0...v1.2.0) (2022-02-25)
74
+
75
+ ## [1.1.0](https://github.com/koatty/koatty_validation/compare/v1.0.12...v1.1.0) (2022-02-16)
76
+
77
+ ## [2.0.0](https://github.com/koatty/koatty_validation/compare/v1.0.12...v2.0.0) (2022-02-16)
package/LICENSE CHANGED
@@ -1,29 +1,29 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2020, Koatty
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- 1. Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
11
-
12
- 2. Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
15
-
16
- 3. Neither the name of the copyright holder nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2020, Koatty
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -1,116 +1,116 @@
1
- # koatty_validation
2
- Validation Util for Koatty. Based on class-validator, extended parameter type checking and restricted attribute functions.
3
-
4
-
5
- # User Decorators
6
-
7
- * @IsDefined
8
- * @IsCnName
9
- * @IsIdNumber
10
- * @IsZipCode
11
- * @IsMobile
12
- * @IsPlateNumber
13
- * @IsEmail
14
- * @IsIP
15
- * @IsPhoneNumber
16
- * @IsUrl
17
- * @IsHash
18
- * @IsNotEmpty
19
- * @Equals
20
- * @NotEquals
21
- * @Contains
22
- * @IsIn
23
- * @IsNotIn
24
- * @IsDate
25
- * @Gt
26
- * @Gte
27
- * @Lt
28
- * @Lte
29
-
30
- * @Valid
31
- * @Validated
32
-
33
-
34
-
35
- ```js
36
-
37
- export class Controller {
38
-
39
- Test(@Valid("IsNotEmpty", "can not be empty!!") id: number){
40
- //todo
41
- }
42
-
43
- @Validated() // use dto validation
44
- TestDto(user: UserDTO) {
45
-
46
- }
47
- }
48
-
49
- export class UserDTO {
50
- @IsNotEmpty({ message: "can not be empty!!" })
51
- phoneNum: string;
52
-
53
- @IsCnName({ message: "must be cn name"})
54
- userName: string;
55
- }
56
-
57
- ```
58
-
59
- # Validator for manual
60
-
61
- ## FunctionValidator
62
-
63
- * IsCnName
64
- * IsIdNumber
65
- * IsZipCode
66
- * IsMobile
67
- * IsPlateNumber
68
- * IsEmail
69
- * IsIP
70
- * IsPhoneNumber
71
- * IsUrl
72
- * IsHash
73
- * IsNotEmpty
74
- * Equals
75
- * NotEquals
76
- * Contains
77
- * IsIn
78
- * IsNotIn
79
- * IsDate
80
- * Gt
81
- * Gte
82
- * Lt
83
- * Lte
84
-
85
- exp:
86
-
87
- ```js
88
- const str = "";
89
- // throw Error
90
- FunctionValidator.IsNotEmpty(str, "cannot be empty");
91
- FunctionValidator.Contains(str, {message: "must contain s", value: "s"});
92
- //
93
- if (!ValidFuncs.IsNotEmpty(str)) {
94
- console.log("empty");
95
- }
96
- ```
97
-
98
- ## ClassValidator
99
-
100
- exp:
101
-
102
- ```js
103
- class SchemaClass {
104
- @IsDefined
105
- id: number;
106
-
107
- @IsNotEmpty
108
- name: string;
109
- }
110
-
111
-
112
- ClassValidator.valid(SchemaClass, {name: ''}).catch(err => {
113
- console.log(err);
114
- })
115
- ```
116
-
1
+ # koatty_validation
2
+ Validation Util for Koatty. Based on class-validator, extended parameter type checking and restricted attribute functions.
3
+
4
+
5
+ # User Decorators
6
+
7
+ * @IsDefined
8
+ * @IsCnName
9
+ * @IsIdNumber
10
+ * @IsZipCode
11
+ * @IsMobile
12
+ * @IsPlateNumber
13
+ * @IsEmail
14
+ * @IsIP
15
+ * @IsPhoneNumber
16
+ * @IsUrl
17
+ * @IsHash
18
+ * @IsNotEmpty
19
+ * @Equals
20
+ * @NotEquals
21
+ * @Contains
22
+ * @IsIn
23
+ * @IsNotIn
24
+ * @IsDate
25
+ * @Gt
26
+ * @Gte
27
+ * @Lt
28
+ * @Lte
29
+
30
+ * @Valid
31
+ * @Validated
32
+
33
+
34
+
35
+ ```js
36
+
37
+ export class Controller {
38
+
39
+ Test(@Valid("IsNotEmpty", "can not be empty!!") id: number){
40
+ //todo
41
+ }
42
+
43
+ @Validated() // use dto validation
44
+ TestDto(user: UserDTO) {
45
+
46
+ }
47
+ }
48
+
49
+ export class UserDTO {
50
+ @IsNotEmpty({ message: "can not be empty!!" })
51
+ phoneNum: string;
52
+
53
+ @IsCnName({ message: "must be cn name"})
54
+ userName: string;
55
+ }
56
+
57
+ ```
58
+
59
+ # Validator for manual
60
+
61
+ ## FunctionValidator
62
+
63
+ * IsCnName
64
+ * IsIdNumber
65
+ * IsZipCode
66
+ * IsMobile
67
+ * IsPlateNumber
68
+ * IsEmail
69
+ * IsIP
70
+ * IsPhoneNumber
71
+ * IsUrl
72
+ * IsHash
73
+ * IsNotEmpty
74
+ * Equals
75
+ * NotEquals
76
+ * Contains
77
+ * IsIn
78
+ * IsNotIn
79
+ * IsDate
80
+ * Gt
81
+ * Gte
82
+ * Lt
83
+ * Lte
84
+
85
+ exp:
86
+
87
+ ```js
88
+ const str = "";
89
+ // throw Error
90
+ FunctionValidator.IsNotEmpty(str, "cannot be empty");
91
+ FunctionValidator.Contains(str, {message: "must contain s", value: "s"});
92
+ //
93
+ if (!ValidFuncs.IsNotEmpty(str)) {
94
+ console.log("empty");
95
+ }
96
+ ```
97
+
98
+ ## ClassValidator
99
+
100
+ exp:
101
+
102
+ ```js
103
+ class SchemaClass {
104
+ @IsDefined
105
+ id: number;
106
+
107
+ @IsNotEmpty
108
+ name: string;
109
+ }
110
+
111
+
112
+ ClassValidator.valid(SchemaClass, {name: ''}).catch(err => {
113
+ console.log(err);
114
+ })
115
+ ```
116
+
package/dist/LICENSE CHANGED
@@ -1,29 +1,29 @@
1
- BSD 3-Clause License
2
-
3
- Copyright (c) 2020, Koatty
4
- All rights reserved.
5
-
6
- Redistribution and use in source and binary forms, with or without
7
- modification, are permitted provided that the following conditions are met:
8
-
9
- 1. Redistributions of source code must retain the above copyright notice, this
10
- list of conditions and the following disclaimer.
11
-
12
- 2. Redistributions in binary form must reproduce the above copyright notice,
13
- this list of conditions and the following disclaimer in the documentation
14
- and/or other materials provided with the distribution.
15
-
16
- 3. Neither the name of the copyright holder nor the names of its
17
- contributors may be used to endorse or promote products derived from
18
- this software without specific prior written permission.
19
-
20
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2020, Koatty
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.