ts-patch-mongoose 3.0.0 → 3.1.2

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.
Files changed (41) hide show
  1. package/README.md +31 -25
  2. package/dist/index.cjs +112 -115
  3. package/dist/index.d.cts +4 -1
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.mts +4 -1
  6. package/dist/index.d.mts.map +1 -1
  7. package/dist/index.mjs +112 -115
  8. package/package.json +14 -15
  9. package/src/helpers.ts +16 -3
  10. package/src/hooks/delete-hooks.ts +5 -4
  11. package/src/hooks/update-hooks.ts +47 -19
  12. package/src/index.ts +8 -5
  13. package/src/ms.ts +4 -3
  14. package/src/omit-deep.ts +24 -63
  15. package/src/patch.ts +30 -33
  16. package/src/types.ts +3 -0
  17. package/biome.json +0 -50
  18. package/tests/constants/events.ts +0 -7
  19. package/tests/em.test.ts +0 -54
  20. package/tests/helpers.test.ts +0 -311
  21. package/tests/mongo/.gitignore +0 -3
  22. package/tests/mongo/server.ts +0 -31
  23. package/tests/ms.test.ts +0 -113
  24. package/tests/omit-deep.test.ts +0 -220
  25. package/tests/patch.test.ts +0 -199
  26. package/tests/plugin-all-features.test.ts +0 -741
  27. package/tests/plugin-complex-data.test.ts +0 -1332
  28. package/tests/plugin-event-created.test.ts +0 -371
  29. package/tests/plugin-event-deleted.test.ts +0 -400
  30. package/tests/plugin-event-updated.test.ts +0 -503
  31. package/tests/plugin-global.test.ts +0 -545
  32. package/tests/plugin-omit-all.test.ts +0 -349
  33. package/tests/plugin-patch-history-disabled.test.ts +0 -162
  34. package/tests/plugin-pre-delete.test.ts +0 -160
  35. package/tests/plugin-pre-save.test.ts +0 -54
  36. package/tests/plugin.test.ts +0 -576
  37. package/tests/schemas/Description.ts +0 -15
  38. package/tests/schemas/Product.ts +0 -38
  39. package/tests/schemas/User.ts +0 -22
  40. package/tsconfig.json +0 -32
  41. package/vite.config.mts +0 -23
@@ -1,22 +0,0 @@
1
- import { Schema } from 'mongoose'
2
-
3
- export interface User {
4
- name: string
5
- role: string
6
- createdAt?: Date
7
- updatedAt?: Date
8
- }
9
-
10
- export const UserSchema = new Schema<User>(
11
- {
12
- name: {
13
- type: String,
14
- required: true,
15
- },
16
- role: {
17
- type: String,
18
- required: true,
19
- },
20
- },
21
- { timestamps: true },
22
- )
package/tsconfig.json DELETED
@@ -1,32 +0,0 @@
1
- {
2
- "include": ["src"],
3
- "compilerOptions": {
4
- "target": "ES2022",
5
- "lib": ["ES2022"],
6
- "types": ["node"],
7
- "module": "Preserve",
8
- "moduleResolution": "bundler",
9
- "outDir": "dist",
10
- "strict": true,
11
- "allowSyntheticDefaultImports": true,
12
- "allowUnreachableCode": false,
13
- "allowUnusedLabels": false,
14
- "checkJs": true,
15
- "declaration": true,
16
- "declarationMap": true,
17
- "esModuleInterop": true,
18
- "exactOptionalPropertyTypes": true,
19
- "forceConsistentCasingInFileNames": true,
20
- "isolatedModules": true,
21
- "noEmitOnError": true,
22
- "noFallthroughCasesInSwitch": true,
23
- "noImplicitOverride": true,
24
- "noImplicitReturns": true,
25
- "noUncheckedIndexedAccess": true,
26
- "noUnusedLocals": true,
27
- "noUnusedParameters": true,
28
- "removeComments": true,
29
- "skipLibCheck": true,
30
- "sourceMap": true
31
- }
32
- }
package/vite.config.mts DELETED
@@ -1,23 +0,0 @@
1
- import { defineConfig } from 'vitest/config'
2
-
3
- export default defineConfig({
4
- test: {
5
- include: ['tests/**/*.test.ts'],
6
- name: 'node',
7
- environment: 'node',
8
- coverage: {
9
- provider: 'v8',
10
- reporter: ['text', 'json', 'html', 'lcov'],
11
- include: ['src/**/*.ts'],
12
- exclude: [
13
- 'node_modules/**',
14
- 'dist/**',
15
- 'coverage/**',
16
- '**/*.d.ts',
17
- '**/*.config.*',
18
- '**/tests/**',
19
- 'examples/**',
20
- ],
21
- },
22
- },
23
- })