This commit is contained in:
admin 2025-08-20 21:44:48 +02:00
commit cbec2e1968
7 changed files with 95 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
.vscode
.idea
dist
node_modules

6
.npmignore Normal file
View File

@ -0,0 +1,6 @@
.vscode
.idea
node_modules
src
.gitignore
tsconfig.json

30
package-lock.json generated Normal file
View File

@ -0,0 +1,30 @@
{
"name": "@apihub24/repository",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@apihub24/repository",
"version": "1.0.0",
"license": "MIT",
"devDependencies": {
"typescript": "^5.9.2"
}
},
"node_modules/typescript": {
"version": "5.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"name": "@apihub24/repository",
"version": "1.0.0",
"description": "",
"main": "dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsc"
},
"devDependencies": {
"typescript": "^5.9.2"
},
"keywords": [],
"author": {
"email": "markusmorgenstern87@outlook.de",
"name": "Markus Morgenstern",
"url": "https://git.apihub24.de/"
},
"license": "MIT",
"publishConfig": {
"access": "public"
}
}

1
src/index.ts Normal file
View File

@ -0,0 +1 @@
export * from "./repository";

5
src/repository.ts Normal file
View File

@ -0,0 +1,5 @@
export interface Repository<TModel> {
getBy(filter: (model: TModel) => boolean): Promise<TModel[]>;
save(models: TModel[]): Promise<TModel[]>;
deleteBy(filter: (model: TModel) => boolean): Promise<boolean>;
}

26
tsconfig.json Normal file
View File

@ -0,0 +1,26 @@
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext",
"resolvePackageJsonExports": true,
"esModuleInterop": true,
"isolatedModules": true,
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "ES2023",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": false,
"strictBindCallApply": false,
"noFallthroughCasesInSwitch": false
},
"include": ["./src"]
}