Skip to content

Commit 3ef3531

Browse files
committed
Initial commit
0 parents  commit 3ef3531

16 files changed

+465
-0
lines changed

.babelrc

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"env": {
3+
// Compatibility Profile.
4+
// ES5 output and CommonJS module format.
5+
"es5_cjs": {
6+
"presets": [
7+
"@babel/preset-env",
8+
"@babel/preset-typescript"
9+
]
10+
},
11+
// Compatibility Profile ES Modules.
12+
// ES5 output with no module transformation (ES Modules syntax).
13+
// Intended only to generate an index.esm.js.
14+
"es5_esm": {
15+
"presets": [
16+
["@babel/preset-env", {
17+
"modules": false
18+
}],
19+
"@babel/preset-typescript"
20+
]
21+
},
22+
// Future Profile.
23+
// ES6 output with no module transformation (ES Modules syntax).
24+
"es": {
25+
"presets": [
26+
["@babel/preset-env", {
27+
"modules": false,
28+
"targets": {
29+
"node": "6.5"
30+
}
31+
}],
32+
"@babel/preset-typescript"
33+
]
34+
},
35+
// Bundled Profile.
36+
// ES5 output and UMD module format.
37+
// To be consumed by <script> html tags.
38+
"umd": {
39+
"presets": [
40+
["@babel/preset-env", {
41+
"modules": false
42+
}],
43+
"@babel/preset-typescript"
44+
]
45+
},
46+
// Jest Profile.
47+
// To be used by jest tests.
48+
"test": {
49+
"presets": [
50+
"@babel/preset-env"
51+
]
52+
}
53+
},
54+
"plugins": [
55+
"@babel/proposal-class-properties",
56+
"@babel/proposal-object-rest-spread"
57+
]
58+
}

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
# All files
4+
[*]
5+
end_of_line = crlf
6+
insert_final_newline = true
7+
indent_size = 2
8+
indent_style = space
9+
charset = utf-8
10+
trim_trailing_whitespace = true

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
.DS_Store
3+
yarn.lock
4+
package-lock.json
5+
*.log
6+
*.orig
7+
*/src/**/*.js.map
8+
.idea/
9+
desktop.ini
10+
build/

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"bracketSpacing": true
6+
}

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "node",
6+
"request": "launch",
7+
"name": "Jest single run",
8+
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
9+
"args": [
10+
"-c",
11+
"jest.json",
12+
"--verbose",
13+
"-i",
14+
"--no-cache"
15+
],
16+
"console": "integratedTerminal",
17+
"internalConsoleOptions": "neverOpen"
18+
}
19+
]
20+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Lemoncode
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* Validates an input value as a spanish National Identity Number (DNI)
3+
* @param value Input value to be interpreted as DNI
4+
*/
5+
import FieldValidationResult from 'lc-form-validation';
6+
export function validateDNI(value: any): FieldValidationResult;

jest.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"rootDir": ".",
3+
"setupFiles": [],
4+
"restoreMocks": true,
5+
"transform": {
6+
".tsx?": "ts-jest"
7+
},
8+
"testRegex": "((\\.|/)(test|spec))\\.(jsx?|tsx?)$",
9+
"moduleFileExtensions": [
10+
"ts",
11+
"tsx",
12+
"js",
13+
"jsx",
14+
"json"
15+
],
16+
"testPathIgnorePatterns": [
17+
"/node_modules/",
18+
"/dist/",
19+
"/es/",
20+
"/lib/"
21+
]
22+
}

package.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{
2+
"name": "lc-validator-fields-match",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"keywords": [],
7+
"author": "",
8+
"license": "ISC",
9+
"scripts": {
10+
"clean": "rimraf build",
11+
"typecheck": "tsc --pretty --noEmit",
12+
"typecheck:watch": "npm run typecheck -- --watch",
13+
"build": "npm run clean && npm run typecheck && npm run build:lib && npm run build:lib:esm && npm run build:umd && npm run build:umd:min && npm run build:es && npm run build:copyfiles",
14+
"build:lib": "cross-env BABEL_ENV=es5_cjs babel ./src --out-dir ./build/lib --ignore 'src/**/*.test.ts,src/**/*.test.js' --extensions '.ts,.js'",
15+
"build:lib:esm": "cross-env BABEL_ENV=es5_esm babel ./src/index.ts --out-file ./build/lib/index.esm.js",
16+
"build:es": "cross-env BABEL_ENV=es babel ./src --out-dir ./build/es --ignore 'src/**/*.test.ts,src/**/*.test.js' --extensions '.ts,.js'",
17+
"build:umd": "cross-env BABEL_ENV=umd NODE_ENV=development webpack",
18+
"build:umd:min": "cross-env BABEL_ENV=umd NODE_ENV=production webpack -p",
19+
"build:copyfiles": "copyfiles package.json index.d.ts readme.md LICENSE build",
20+
"test": "cross-env NODE_ENV=test jest --verbose --config jest.json",
21+
"test:watch": "cross-env NODE_ENV=test jest --verbose --watchAll --config jest.json",
22+
"lint": "tslint --project . --format stylish",
23+
"lint:fix": "prettier --write src/**/*.{ts,tsx,js,jsx} && tslint --project . --fix",
24+
"prerelease": "npm run lint:fix && npm run test && npm run build",
25+
"release": "npm publish ./build",
26+
"release:local": "npm install ./build -g"
27+
},
28+
"dependencies": {
29+
"lc-form-validation": "^2.0.0"
30+
},
31+
"peerDependencies": {
32+
"lc-form-validation": "^2.0.0"
33+
},
34+
"devDependencies": {
35+
"@babel/cli": "^7.1.0",
36+
"@babel/core": "^7.1.0",
37+
"@babel/plugin-proposal-class-properties": "^7.1.0",
38+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
39+
"@babel/preset-env": "^7.1.0",
40+
"@babel/preset-typescript": "^7.1.0",
41+
"@babel/register": "^7.0.0",
42+
"@types/jest": "^23.3.2",
43+
"babel-core": "^7.0.0-bridge.0",
44+
"babel-jest": "^23.6.0",
45+
"babel-loader": "^8.0.2",
46+
"compression-webpack-plugin": "^2.0.0",
47+
"copyfiles": "^2.1.0",
48+
"cross-env": "^5.2.0",
49+
"jest": "^23.6.0",
50+
"prettier": "^1.14.3",
51+
"rimraf": "^2.6.2",
52+
"ts-jest": "^23.10.1",
53+
"tslint": "^5.11.0",
54+
"typescript": "^3.0.3",
55+
"webpack": "^4.19.1",
56+
"webpack-cli": "^3.1.0"
57+
}
58+
}

readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# lc-validator-fields-match
2+
3+
This is a [lc-form-validation](https://github.com/Lemoncode/lcFormValidation) add-on that brings validation capabilities for:
4+
// TODO:
5+
6+
Please, refer to [lc-form-validation](https://github.com/Lemoncode/lcFormValidation) to know more.
7+
8+
## License
9+
[MIT](./LICENSE)
10+
11+
# About Lemoncode
12+
We are a team of long-term experienced freelance developers, established as a group in 2010. We specialize in Front End technologies and .NET. [Click here](http://lemoncode.net/services/en/#en-home) to get more info about us.
13+
14+
For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

0 commit comments

Comments
 (0)