{"_id":"@apihub24/ts_repository","_rev":"7-5bc5791bc34213a4711625b590e2e91e","name":"@apihub24/ts_repository","dist-tags":{"latest":"0.1.0-alpha.6"},"versions":{"0.1.0-alpha.0":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.0","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.0","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"8888c1ed32480ef3577d8dac8450cd01f1c2f5d4","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.0.tgz","fileCount":18,"integrity":"sha512-lsS/wdwdEc23JemQynD5oBUe8vmZJr3qoNCZxmBxLL0c5kN6TcoMBU6kU2lP4Vs7hLxxGR8sh5otWjcFG6aC7g==","signatures":[{"sig":"MEYCIQC9+IwxlmOpOJ667kj+RDNYbU/1edauw8X62G6toR9mVQIhAL22Wo4qFJtQA5gHz/fsVy80QG5YJxxwLLhAVFkxvHsS","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103181},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3d9763ad06e377e0e9e856b25b6ed8691c13f348","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.0_1758289573475_0.011103497530151607","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.1":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.1","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.1","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"994bd71b1242d4b1b90f4f1e09d402db4f834f41","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.1.tgz","fileCount":18,"integrity":"sha512-pLnY6THBzVsM/Lp2eUcJe1DR+mtRB17fp/be85IBQXCXfG5WVhRkCZlUccLwzbIqtgzHnIu1jRpYsSb5cG38Jg==","signatures":[{"sig":"MEUCIQDkdaan+h42BGExj7DaK7S7DpAqFGAUbaMZW/8vA+hIVwIgHdLAJhFE+HE/vEml12YvH1IXHwIOwRQ6BP2+2gSX1VE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103336},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"e5e571d3cdac30866077a0f9b04724bcf2d9dfe2","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.1_1758291410509_0.7158301324136389","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.2":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.2","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.2","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"576a9b0e59d4c89b2f5f74c3bb6f50c5839623b7","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.2.tgz","fileCount":18,"integrity":"sha512-z4Gg++Olr5mN0PsZhRKHuQZUJzHYdWrcu/MfiXAoRGG7KbOwCoVkuTLoGtr8X8ssCAJ1DQONldtezC57Hfi3tg==","signatures":[{"sig":"MEYCIQCEwqpNTkt8N3VWv5WsRKfRKoCGXXRlbmJ0hWJfRbeSHgIhAPm4M2ykJugv9BNoKZ4EgDQO3qBXaTUdBJD7RLMpPuCc","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103367},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"23d5f6551c51f768f9dc69fca7a342852c8daa09","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.2_1758367025244_0.1203746328385571","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.3":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.3","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.3","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"b59ddcefa54674a11400e610a27b00f9db858785","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.3.tgz","fileCount":18,"integrity":"sha512-tWgvieFcYLgeAhJ8KI5EZhrMBnflCX6/eek6zyzzkIWqU17KKMCnEYJGy3DySIdCkbAuqQtNozXqThn1/1Tefg==","signatures":[{"sig":"MEQCIEQbWuaBlcM/H2EHdVLM2Rph9c0rZKa754H1j0SQ8YFgAiBBArpwon0v30/01c5tIj1yQp6aNhhQgwJN1+EVrZd8HQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103366},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"dfe9a0ac04a538e0f735890aa8ec1b9f08ea7899","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.3_1758368807597_0.8936476330689911","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.4":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.4","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.4","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"69bdbdb5b4aac05128face2a665898a441e97a9d","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.4.tgz","fileCount":18,"integrity":"sha512-wYarGP6EfJ9uuQ1B3jEUd3wwEhz2C3RbE8uqWDHe9mV/gfvm+bC0pnxo2O1/b1F9EmNhj9LHcsEx2svayjzx8A==","signatures":[{"sig":"MEYCIQDNf9v+Ck2HoMdxMLEqiUgb6/sYVf7Ic5N3EoGu/jFuKAIhAKLL18Eh5F0OIpee/NW5/w3cbiP1vsAtEZZsUzQlQXVk","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":103853},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"c1a5f0fdde67b4391a96283bb12474bb4d2bc432","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.4_1758385325094_0.09782985114518028","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.5":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.5","keywords":[],"author":{"url":"https://github.com/codeus-node/apihub24_ts_repository","name":"Markus Morgenstern","email":"git@apihub24.de"},"license":"Apache-2.0","_id":"@apihub24/ts_repository@0.1.0-alpha.5","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"dist":{"shasum":"d665dbe948b9a1de9f073738b687677fd9372ceb","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.5.tgz","fileCount":18,"integrity":"sha512-dc6a+mY9SyVJJfwW4WhhPFwvG0jGRU807Nhs75xG5s7MLbT4OsY56uLxWNiU+d8MiuZXNQifN7F03iZckPwXLw==","signatures":[{"sig":"MEUCID6Rmv1e8/DHYRjWKdoQ94dAYLO+xdDIcDlF5B2zZGqJAiEAh9+ver2TbGrbRKK43TUPVZq4LCkurBtN874VxPoBlro=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":104141},"jest":{"roots":["<rootDir>/src/"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"testEnvironment":"node","moduleNameMapper":{},"coverageDirectory":"./coverage","collectCoverageFrom":["**/*.(t|j)s"],"moduleFileExtensions":["js","json","ts"]},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"64b16aac1d6f798a53a02477667c85a647f5fc31","scripts":{"test":"jest","build":"npm run clean && tsc","clean":"rimraf dist","release":"npm run build && npm run test && npm publish","test:cov":"jest --coverage","test:watch":"jest --watch"},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"_npmVersion":"10.9.3","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","directories":{},"_nodeVersion":"22.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^30.0.0","rimraf":"^6.0.1","ts-jest":"^29.4.1","typescript":"^5.9.2","@types/jest":"^30.0.0","@types/node":"^24.5.2"},"_npmOperationalInternal":{"tmp":"tmp/ts_repository_0.1.0-alpha.5_1758390485463_0.9598592264903842","host":"s3://npm-registry-packages-npm-production"}},"0.1.0-alpha.6":{"name":"@apihub24/ts_repository","version":"0.1.0-alpha.6","description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"npm run clean && tsc","clean":"rimraf dist","test":"jest","test:watch":"jest --watch","test:cov":"jest --coverage","release":"npm run build && npm run test && npm publish"},"devDependencies":{"typescript":"^5.9.2","rimraf":"^6.0.1","@types/node":"^24.5.2","@types/jest":"^30.0.0","jest":"^30.0.0","ts-jest":"^29.4.1"},"keywords":[],"author":{"name":"Markus Morgenstern","email":"git@apihub24.de","url":"https://github.com/codeus-node/apihub24_ts_repository"},"license":"Apache-2.0","publishConfig":{"access":"public"},"jest":{"moduleFileExtensions":["js","json","ts"],"rootDir":".","testRegex":".*\\.spec\\.ts$","transform":{"^.+\\.(t|j)s$":"ts-jest"},"collectCoverageFrom":["**/*.(t|j)s"],"coverageDirectory":"./coverage","testEnvironment":"node","roots":["<rootDir>/src/"],"moduleNameMapper":{}},"_id":"@apihub24/ts_repository@0.1.0-alpha.6","gitHead":"fc8aa38829ef8bc1948f029021350f5bd30a3a28","_nodeVersion":"22.18.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-FaZlPp13EtgshFE8DCoqV0kitHr69XKIFHMvxujb7fP/pyb0dQjK1vo/SXyIUOg7dhnfChh9Fk4LTb5wb1SObA==","shasum":"d5322a1f329b48238a2f1a1bbe31669a66c741a0","tarball":"https://registry.npmjs.org/@apihub24/ts_repository/-/ts_repository-0.1.0-alpha.6.tgz","fileCount":18,"unpackedSize":104929,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIAUymFSPe1syST6F+d2lJJoAtFpIT0JcRRSUNsji8klnAiBEVGwTmBUhTOozvca65rRVOTr+f5tdZjrBMFMVpucWUQ=="}]},"_npmUser":{"name":"apihub24","email":"markusmorgenstern87@outlook.de"},"directories":{},"maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ts_repository_0.1.0-alpha.6_1758395046959_0.5247822771833555"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-19T13:46:13.344Z","modified":"2025-09-20T19:04:07.389Z","0.1.0-alpha.0":"2025-09-19T13:46:13.672Z","0.1.0-alpha.1":"2025-09-19T14:16:50.692Z","0.1.0-alpha.2":"2025-09-20T11:17:05.430Z","0.1.0-alpha.3":"2025-09-20T11:46:47.800Z","0.1.0-alpha.4":"2025-09-20T16:22:05.282Z","0.1.0-alpha.5":"2025-09-20T17:48:05.651Z","0.1.0-alpha.6":"2025-09-20T19:04:07.213Z"},"author":{"name":"Markus Morgenstern","email":"git@apihub24.de","url":"https://github.com/codeus-node/apihub24_ts_repository"},"license":"Apache-2.0","keywords":[],"description":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r [![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/A","maintainers":[{"name":"apihub24","email":"markusmorgenstern87@outlook.de"}],"readme":"[![npm version](https://badge.fury.io/js/@apihub24%2Fts_repository.svg?icon=si%3Anpm)](https://badge.fury.io/js/@apihub24%2Fts_repository)\r\n[![License: Apache2.0](https://img.shields.io/badge/License-Apache2.0-green.svg)](https://opensource.org/licenses/Apache2.0)\r\n[![CI](https://github.com/codeus-node/apihub24_ts_repository/actions/workflows/ci.yml/badge.svg)](https://github.com/codeus-node/apihub24_ts_repository/actions/workflows/ci.yml)\r\n[![Codecov](https://codecov.io/gh/codeus-node/apihub24_ts_repository/branch/main/graph/badge.svg)](https://codecov.io/gh/codeus-node/apihub24_ts_repository)\r\n\r\n# Typescript Repository\r\n\r\na Basic Repository Contract to implement your custom Repository.\r\n\r\n## Install\r\n\r\n```bash\r\nnpm install --save @apihub24/ts-repository\r\n```\r\n\r\n## Usage\r\n\r\nimplement the IRepository interface to use the Repository for example in Memory.\r\n\r\n```ts\r\nimport {\r\n  IConnectedCondition,\r\n  IQuery,\r\n  OrderDirection,\r\n  SortSettings,\r\n  Repository,\r\n} from \"@apihub24/ts_repository\";\r\n\r\nclass TestRight {\r\n  id?: string;\r\n  name = \"\";\r\n}\r\nclass TestGroup {\r\n  id?: string;\r\n  name = \"\";\r\n  rights = new Array<TestRight>();\r\n}\r\nclass TestUser {\r\n  id?: string;\r\n  userName = \"\";\r\n  age = 0;\r\n  group?: TestGroup;\r\n}\r\n\r\nclass TestInMemoryRepository<T extends { id?: string }>\r\n  implements Repository<T>\r\n{\r\n  source = new Array<T>();\r\n\r\n  async get(query: IQuery<T>): Promise<T[]> {\r\n    const result = new Array<T>();\r\n    let row = -1;\r\n    for (const ds of query.order ? this.sortArray(query.order) : this.source) {\r\n      row++;\r\n      if (query.skip && query.skip > row) {\r\n        continue;\r\n      }\r\n      if (query.limit && result.length >= query.limit) {\r\n        break;\r\n      }\r\n      let take = true;\r\n      for (const cond of query.conditions ?? []) {\r\n        const dsValue = ds[cond.name];\r\n        switch (cond.operator) {\r\n          case \"eq\":\r\n            take = dsValue === cond.value;\r\n            break;\r\n          case \"neq\":\r\n            take = dsValue !== cond.value;\r\n            break;\r\n          case \"gt\":\r\n            take = dsValue > cond.value;\r\n            break;\r\n          case \"gte\":\r\n            take = dsValue >= cond.value;\r\n            break;\r\n          case \"lt\":\r\n            take = dsValue < cond.value;\r\n            break;\r\n          case \"lte\":\r\n            take = dsValue <= cond.value;\r\n            break;\r\n          case \"in\":\r\n            take = cond.value.includes(dsValue);\r\n            break;\r\n          case \"nin\":\r\n            take = !cond.value.includes(dsValue);\r\n            break;\r\n          default:\r\n            continue;\r\n        }\r\n        if (!take && cond.connector === \"and\") {\r\n          break;\r\n        }\r\n      }\r\n      if (!take) {\r\n        continue;\r\n      }\r\n      result.push(ds);\r\n    }\r\n    return Promise.resolve(result);\r\n  }\r\n\r\n  async save(data: T): Promise<T> {\r\n    if (!data.id) {\r\n      data.id = crypto.randomUUID();\r\n    }\r\n    if (!this.source.find((d) => d.id === data.id)) {\r\n      this.source.push(data);\r\n    }\r\n    const result = this.source.find((d) => d.id === data.id);\r\n    if (!result) {\r\n      throw new Error(`dataset not saved correctly`);\r\n    }\r\n    return Promise.resolve(result);\r\n  }\r\n\r\n  async delete(conditions: IConnectedCondition<T>[]): Promise<boolean> {\r\n    const deletions = await this.get({\r\n      conditions,\r\n      limit: 0,\r\n      skip: 0,\r\n      order: [],\r\n    });\r\n    for (const del of deletions) {\r\n      this.source = this.source.filter((d) => d.id !== del.id);\r\n    }\r\n    return Promise.resolve(true);\r\n  }\r\n\r\n  async clear() {\r\n    this.source = [];\r\n  }\r\n\r\n  private sortArray(sortSettings: SortSettings<T>): T[] {\r\n    const sortedData = [...this.source];\r\n\r\n    sortedData.sort((a, b) => {\r\n      for (const setting of sortSettings) {\r\n        const key = Object.keys(setting)[0] as keyof T;\r\n        const direction = Object.values(setting)[0] as OrderDirection;\r\n\r\n        const aValue = a[key];\r\n        const bValue = b[key];\r\n\r\n        if (aValue === bValue) {\r\n          continue;\r\n        }\r\n\r\n        if (direction === \"asc\") {\r\n          if (aValue < bValue) {\r\n            return -1;\r\n          }\r\n          if (aValue > bValue) {\r\n            return 1;\r\n          }\r\n        } else {\r\n          if (aValue < bValue) {\r\n            return 1;\r\n          }\r\n          if (aValue > bValue) {\r\n            return -1;\r\n          }\r\n        }\r\n      }\r\n      return 0;\r\n    });\r\n\r\n    return sortedData;\r\n  }\r\n}\r\n```\r\n","readmeFilename":"README.md"}