@klyper/validations 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +18 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +15 -0
- package/package.json +25 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @klyper/validations v0.2.0
|
|
3
|
+
* Validation helpers for the Klyper ecosystem.
|
|
4
|
+
* (c) 2026 Andrew Caires
|
|
5
|
+
* @license: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
function isEmail(value) {
|
|
10
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function isNonEmptyString(value) {
|
|
14
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.isEmail = isEmail;
|
|
18
|
+
exports.isNonEmptyString = isNonEmptyString;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @klyper/validations v0.2.0
|
|
3
|
+
* Validation helpers for the Klyper ecosystem.
|
|
4
|
+
* (c) 2026 Andrew Caires
|
|
5
|
+
* @license: MIT
|
|
6
|
+
*/
|
|
7
|
+
export declare function isEmail(value: string): boolean;
|
|
8
|
+
export declare function isNonEmptyString(value: unknown): value is string;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* @klyper/validations v0.2.0
|
|
3
|
+
* Validation helpers for the Klyper ecosystem.
|
|
4
|
+
* (c) 2026 Andrew Caires
|
|
5
|
+
* @license: MIT
|
|
6
|
+
*/
|
|
7
|
+
function isEmail(value) {
|
|
8
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(value);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function isNonEmptyString(value) {
|
|
12
|
+
return typeof value === "string" && value.trim().length > 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { isEmail, isNonEmptyString };
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@klyper/validations",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Validation helpers for the Klyper ecosystem.",
|
|
5
|
+
"author": "Andrew Caires",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"clean": "rm -rf dist",
|
|
23
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
24
|
+
}
|
|
25
|
+
}
|