-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* switch to typescript * refactor * add cjs, mjs & ts examples * add codeql ts support is codeql even necessary for this? * drop node 15 and add node 20 * update readme * remove path aliases * update changelog --------- Co-authored-by: Kyriakos Nicola <knicola@users.noreply.github.com>
- Loading branch information
Showing
20 changed files
with
2,556 additions
and
217 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,11 @@ | ||
require('@knicola/dev-config/eslint/patch') | ||
|
||
module.exports = { | ||
extends: ['./node_modules/@knicola/dev-config/eslint/node'], | ||
parserOptions: { tsconfigRootDir: __dirname }, | ||
settings: { | ||
'import/resolver': { | ||
typescript: { project: __dirname }, | ||
}, | ||
}, | ||
} |
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
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,7 @@ | ||
{ | ||
"editor.formatOnSave": false, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"eslint.format.enable": true | ||
} |
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
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,16 @@ | ||
/* eslint-disable no-console */ | ||
'use strict' | ||
|
||
const yup = require('yup') | ||
require('../dist/index.js')(yup) | ||
|
||
const schema = yup.object({ | ||
password: yup.string().password(), | ||
}) | ||
|
||
const input = { | ||
password: 'weak', | ||
} | ||
|
||
schema.validate(input, { abortEarly: false }) | ||
.catch(e => console.error(e.errors)) |
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,17 @@ | ||
/* eslint-disable no-console */ | ||
'use strict' | ||
|
||
import * as yup from 'yup' | ||
import YupPassword from '../dist/index.js' | ||
YupPassword(yup) | ||
|
||
const schema = yup.object({ | ||
password: yup.string().password(), | ||
}) | ||
|
||
const input = { | ||
password: 'weak', | ||
} | ||
|
||
schema.validate(input, { abortEarly: false }) | ||
.catch(e => console.error(e.errors)) |
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,15 @@ | ||
/* eslint-disable no-console */ | ||
import * as yup from 'yup' | ||
import YupPassword from '../src' | ||
YupPassword(yup) | ||
|
||
const schema = yup.object({ | ||
password: yup.string().password(), | ||
}) | ||
|
||
const input = { | ||
password: 'weak', | ||
} | ||
|
||
schema.validate(input, { abortEarly: false }) | ||
.catch(e => console.error(e.errors)) |
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,24 @@ | ||
import { JestConfigWithTsJest } from 'ts-jest' | ||
|
||
const config: JestConfigWithTsJest = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
bail: true, | ||
testMatch: [ | ||
'<rootDir>/tests/**/*.spec.ts', | ||
'<rootDir>/tests/**/*.test.ts', | ||
], | ||
collectCoverageFrom: [ | ||
'<rootDir>/src/**/*.ts', | ||
], | ||
coverageThreshold: { | ||
global: { | ||
branches: 100, | ||
functions: 100, | ||
lines: 100, | ||
statements: 0, | ||
}, | ||
}, | ||
} | ||
|
||
export default config |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.