escss-estest
Advanced tools
Comparing version 1.4.3 to 1.4.4
@@ -1,5 +0,21 @@ | ||
# Dual-Licensing(Commercial or AGPL-3.0-only) | ||
# Dual-Licensing(AGPL-3.0-only OR Commercial) | ||
## 1. AGPL-3.0-only License: | ||
## 1. Commercial License: | ||
Copyright (C) 2024 Mike Lee <https://github.com/MikeLee0358> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
## 2. Commercial License: | ||
Term: 1 Year (licensee must renew annually) | ||
@@ -20,21 +36,4 @@ | ||
## 2. AGPL-3.0-only License: | ||
Copyright (C) 2024 Mike Lee <https://github.com/MikeLee0358> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
## Reference | ||
[Dual-license-templates](https://github.com/lawndoc/dual-license-templates) |
{ | ||
"name": "escss-estest", | ||
"version": "1.4.3", | ||
"author": { | ||
"name": "Mike Lee" | ||
}, | ||
"main": "./src/ESTest.js", | ||
"description": "100% input coverage makes your life easier", | ||
"version": "1.4.4", | ||
"description": "100% function coverage for easier life.", | ||
"keywords": [ | ||
"escss", | ||
"escss-estest", | ||
"library", | ||
"testing", | ||
@@ -18,5 +13,15 @@ "javascript", | ||
], | ||
"license": "Dual-licensing", | ||
"homepage": "https://github.com/ESCSS-labs/", | ||
"bugs": "https://github.com/ESCSS-labs/ESCSS-ESTest/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ESCSS-labs/ESCSS-ESTest" | ||
}, | ||
"funding": "https://opencollective.com/escss", | ||
"license": "(AGPL-3.0-only OR Commercial)", | ||
"author": "Mike Lee <cspkno005@gmail.com> (https://github.com/ESCSS-labs)", | ||
"type": "module", | ||
"types": "./src/ESTest.js" | ||
} | ||
"exports": "./lib/index.js", | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.js" | ||
} |
@@ -29,6 +29,5 @@ ![logo](https://github.com/ESCSS-labs/ESCSS/blob/main/assets/logo.png) | ||
### 全部的使用例子 | ||
### 例子 | ||
```js | ||
// 型別模式 | ||
ESTest(NaN, "NaN"); // 新增 | ||
@@ -56,3 +55,3 @@ ESTest([], "array"); // 新增 | ||
// 純函數 (參數測試在 {...}) | ||
function getSum2(a, b) { | ||
function pureSum(a, b) { | ||
{ | ||
@@ -70,3 +69,3 @@ ESTest(a, "number"); | ||
// 非純函數 | ||
function getSum(a, b) { | ||
function impureSum(a, b) { | ||
if (!isEnable) return 0; | ||
@@ -78,3 +77,3 @@ | ||
// 注意: "function" 類型檢查是不必要的。 | ||
function getTotalNumber(x) { | ||
function total(x) { | ||
{ | ||
@@ -85,6 +84,6 @@ ESTest(x, "number"); | ||
// 如果函數存在,getSum2(a, b) 將處理類型檢查,因此 "function" 檢查是多餘的。 | ||
ESTest(getSum2, "function"); // 沒必要 | ||
ESTest(pureSum, "function"); // not necessary. | ||
} | ||
return x + getSum2(1, 2); | ||
return x + pureSum(1, 2); | ||
} | ||
@@ -96,3 +95,3 @@ ``` | ||
```js | ||
import { ESTest, getData } from "escss-estest"; | ||
import { ESTest } from "escss-estest"; | ||
@@ -105,2 +104,3 @@ async function getData() { | ||
{ | ||
ESTest(json, 'object') | ||
ESTest(json.userId, "number"); | ||
@@ -107,0 +107,0 @@ ESTest(json.id, "number"); |
@@ -33,6 +33,5 @@ ![logo](https://github.com/ESCSS-labs/ESCSS/blob/main/assets/logo.png) | ||
### All Use Cases | ||
### Use Cases | ||
```js | ||
// Type mode | ||
ESTest(NaN, "NaN"); // new | ||
@@ -60,3 +59,3 @@ ESTest([], "array"); // new | ||
// Pure (input in {...}) | ||
function getSum2(a, b) { | ||
function pureSum(a, b) { | ||
{ | ||
@@ -74,3 +73,3 @@ ESTest(a, "number"); | ||
// Impure | ||
function getSum(a, b) { | ||
function impureSum(a, b) { | ||
if (!isEnable) return 0; | ||
@@ -82,3 +81,3 @@ | ||
// NOTE: the "function" type check is unnecessary. | ||
function getTotalNumber(x) { | ||
function total(x) { | ||
{ | ||
@@ -88,7 +87,7 @@ ESTest(x, "number"); | ||
// If the function doesn't exist, it will return 'xxx is undefined.' | ||
// If the function exists, getSum2(a, b) will handle type check, so the "function" check is redundant. | ||
ESTest(getSum2, "function"); // not necessary. | ||
// If the function exists, pureSum(a, b) will handle type check, so the "function" check is redundant. | ||
ESTest(pureSum, "function"); // not necessary. | ||
} | ||
return x + getSum2(1, 2); | ||
return x + pureSum(1, 2); | ||
} | ||
@@ -100,3 +99,3 @@ ``` | ||
```js | ||
import { ESTest, getData } from "escss-estest"; | ||
import { ESTest } from "escss-estest"; | ||
@@ -109,2 +108,3 @@ async function getData() { | ||
{ | ||
ESTest(json, 'object') | ||
ESTest(json.userId, "number"); | ||
@@ -111,0 +111,0 @@ ESTest(json.id, "number"); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
15204
0
233
0
0
6
1