Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

escss-estest

Package Overview
Dependencies
Maintainers
0
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

escss-estest - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

lib/index.js

37

LICENSE.md

@@ -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");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc