-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,011 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ignores: | ||
- "@commitlint/*" | ||
- "@size-limit/*" | ||
- "@types/jest" | ||
- typedoc* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,9 @@ node_modules | |
.idea | ||
|
||
# project folders | ||
dist* | ||
lib* | ||
out* | ||
cjs | ||
dist | ||
docs | ||
esm | ||
lib | ||
out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
], | ||
"eslint.enable": true, | ||
"cSpell.words": [ | ||
"codeql", | ||
"jsnext", | ||
"tersible", | ||
"tersify" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,23 +15,26 @@ | |
"name": "Homa Wong (unional)", | ||
"email": "[email protected]" | ||
}, | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"jsnext:main": "esm/index.js", | ||
"typings": "cjs/index.d.ts", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"files": [ | ||
"cjs", | ||
"esm", | ||
"src" | ||
"lib" | ||
], | ||
"scripts": { | ||
"build": "tsc -p tsconfig.es5.json && tsc -p tsconfig.esnext.json", | ||
"clean": "rimraf lib esm", | ||
"build": "tsc -p tsconfig.build.json", | ||
"build:doc": "typedoc", | ||
"clean": "rimraf cjs lib esm coverage", | ||
"coverage": "jest --coverage", | ||
"dependency-check": "dependency-check . --unused --no-dev && dependency-check . --missing --no-dev", | ||
"depcheck": "depcheck", | ||
"lint": "eslint --ext=js,ts .", | ||
"test": "jest --reporters=default", | ||
"verify": "yarn lint && yarn build && yarn dependency-check && jest --coverage --reporters=default", | ||
"nuke": "yarn clean && rimraf node_modules", | ||
"prepare": "husky install", | ||
"release": "npx semantic-release", | ||
"size-limit": "size-limit", | ||
"test": "jest", | ||
"test:types": "tsc", | ||
"verify": "run-p verify:build lint test:types coverage", | ||
"verify:build": "npm-run-all clean build -p depcheck size-limit", | ||
"watch": "jest --watch", | ||
"watch:type": "tsc --watch" | ||
}, | ||
|
@@ -40,28 +43,35 @@ | |
}, | ||
"devDependencies": { | ||
"@babel/core": "7.17.9", | ||
"@babel/plugin-proposal-class-properties": "7.16.7", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "7.16.7", | ||
"@babel/plugin-proposal-optional-chaining": "7.16.7", | ||
"@babel/preset-env": "7.16.11", | ||
"@babel/preset-typescript": "7.16.7", | ||
"@commitlint/cli": "^16.2.3", | ||
"@commitlint/config-conventional": "^16.2.1", | ||
"@size-limit/preset-small-lib": "^7.0.8", | ||
"@types/jest": "27.4.1", | ||
"@typescript-eslint/eslint-plugin": "^5.20.0", | ||
"assertron": "9.0.5", | ||
"dependency-check": "^4.1.0", | ||
"depcheck": "^1.4.3", | ||
"eslint": "8.14.0", | ||
"eslint-plugin-harmony": "^6.0.3", | ||
"husky": "^7.0.4", | ||
"is-ci": "^3.0.1", | ||
"jest": "27.5.1", | ||
"jest-junit": "^13.2.0", | ||
"jest-validate": "27.5.1", | ||
"jest-watch-suspend": "^1.1.2", | ||
"jest-watch-toggle-config": "^2.0.1", | ||
"jest-watch-typeahead": "^1.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"rimraf": "^3.0.2", | ||
"size-limit": "^7.0.8", | ||
"type-plus": "4.9.0", | ||
"typedoc": "^0.22.15", | ||
"typedoc-plugin-extras": "^2.2.3", | ||
"typescript": "4.6.3" | ||
} | ||
}, | ||
"size-limit": [ | ||
{ | ||
"limit": "10 kb" | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import { tersible, tersify } from 'tersify' | ||
import { createSatisfier } from './createSatisfier' | ||
import { createSatisfier, Expectation } from './createSatisfier' | ||
|
||
/** | ||
* Check if an array have at least one entry satisfying the expectation. | ||
* @param expectation expectation | ||
*/ | ||
export function some(expectation: any) { | ||
export function some<E extends Expectation>(expectation: E) { | ||
const s = createSatisfier(expectation) | ||
return tersible((e: any) => e && Array.isArray(e) && e.some(v => s.test(v)), () => `some(${tersify(expectation)})`) | ||
} |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"compilerOptions": { | ||
"declaration": true, | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": [ | ||
"DOM", | ||
"ES2020" | ||
], | ||
"module": "CommonJS", | ||
"moduleResolution": "node", | ||
"newLine": "LF", | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": false, | ||
"outDir": "lib", | ||
"sourceMap": true, | ||
"inlineSources": true, | ||
"strict": true, | ||
"stripInternal": true, | ||
"target": "ES2020", | ||
"useDefineForClassFields": true | ||
}, | ||
"include": [ | ||
"typings" | ||
], | ||
"files": [ | ||
"ts/index.ts" | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
{ | ||
"extends": "./tsconfig.esnext.json", | ||
"extends": "./tsconfig.build.json", | ||
"compilerOptions": { | ||
"noEmit": true | ||
}, | ||
"include": [ | ||
"src", | ||
"ts", | ||
"typings" | ||
] | ||
], | ||
"typedocOptions": { | ||
"customTitle": "A purposely loose comparison tool.", | ||
"customTitleLink": "https://github.com/unional/satisfier", | ||
"entryPoints": [ | ||
"src/index.ts" | ||
], | ||
"out": "docs" | ||
} | ||
} |
Oops, something went wrong.