Initial commit: add .gitignore and README
This commit is contained in:
28
packages/shared-utils/package.json
Normal file
28
packages/shared-utils/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@dbis/shared-utils",
|
||||
"version": "1.0.0",
|
||||
"description": "Shared utility functions for DBIS projects",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "vitest",
|
||||
"lint": "eslint src",
|
||||
"type-check": "tsc --noEmit",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
"dependencies": {
|
||||
"@workspace/shared-utils": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.5.4",
|
||||
"vitest": "^1.2.0"
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "restricted"
|
||||
}
|
||||
}
|
||||
|
||||
17
packages/shared-utils/src/index.ts
Normal file
17
packages/shared-utils/src/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @dbis/shared-utils
|
||||
* Shared utility functions for DBIS projects
|
||||
*/
|
||||
|
||||
// Re-export workspace shared utils
|
||||
export * from '@workspace/shared-utils';
|
||||
|
||||
// DBIS-specific utilities
|
||||
export function formatDBISDate(date: Date): string {
|
||||
return date.toISOString().split('T')[0];
|
||||
}
|
||||
|
||||
export function validateDBISEmail(email: string): boolean {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email) && email.endsWith('@dbis.example.com');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user