ts-patch-mongoose 3.1.0 → 4.0.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.
Files changed (46) hide show
  1. package/README.md +39 -27
  2. package/dist/index.cjs +287 -32
  3. package/dist/index.d.cts +23 -1
  4. package/dist/index.d.cts.map +1 -1
  5. package/dist/index.d.mts +23 -1
  6. package/dist/index.d.mts.map +1 -1
  7. package/dist/index.mjs +287 -32
  8. package/package.json +19 -24
  9. package/biome.json +0 -47
  10. package/src/em.ts +0 -6
  11. package/src/helpers.ts +0 -174
  12. package/src/hooks/delete-hooks.ts +0 -49
  13. package/src/hooks/save-hooks.ts +0 -30
  14. package/src/hooks/update-hooks.ts +0 -125
  15. package/src/index.ts +0 -65
  16. package/src/model.ts +0 -50
  17. package/src/modules/power-assign.d.ts +0 -3
  18. package/src/ms.ts +0 -66
  19. package/src/omit-deep.ts +0 -56
  20. package/src/patch.ts +0 -154
  21. package/src/types.ts +0 -53
  22. package/src/version.ts +0 -13
  23. package/tests/constants/events.ts +0 -7
  24. package/tests/em.test.ts +0 -70
  25. package/tests/helpers.test.ts +0 -373
  26. package/tests/mongo/.gitignore +0 -3
  27. package/tests/mongo/server.ts +0 -31
  28. package/tests/ms.test.ts +0 -113
  29. package/tests/omit-deep.test.ts +0 -235
  30. package/tests/patch.test.ts +0 -200
  31. package/tests/plugin-all-features.test.ts +0 -844
  32. package/tests/plugin-complex-data.test.ts +0 -2647
  33. package/tests/plugin-event-created.test.ts +0 -371
  34. package/tests/plugin-event-deleted.test.ts +0 -400
  35. package/tests/plugin-event-updated.test.ts +0 -503
  36. package/tests/plugin-global.test.ts +0 -545
  37. package/tests/plugin-omit-all.test.ts +0 -349
  38. package/tests/plugin-patch-history-disabled.test.ts +0 -162
  39. package/tests/plugin-pre-delete.test.ts +0 -160
  40. package/tests/plugin-pre-save.test.ts +0 -54
  41. package/tests/plugin.test.ts +0 -576
  42. package/tests/schemas/Description.ts +0 -15
  43. package/tests/schemas/Product.ts +0 -38
  44. package/tests/schemas/User.ts +0 -22
  45. package/tsconfig.json +0 -32
  46. package/vite.config.mts +0 -24
@@ -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,24 +0,0 @@
1
- import { defineConfig } from 'vitest/config'
2
-
3
- export default defineConfig({
4
- test: {
5
- dir: 'tests',
6
- include: ['**/*.test.ts'],
7
- name: 'node',
8
- environment: 'node',
9
- coverage: {
10
- provider: 'v8',
11
- reporter: ['text', 'json', 'html', 'lcov'],
12
- include: ['src/**/*.ts'],
13
- exclude: [
14
- 'node_modules/**',
15
- 'dist/**',
16
- 'coverage/**',
17
- '**/*.d.ts',
18
- '**/*.config.*',
19
- '**/tests/**',
20
- 'examples/**',
21
- ],
22
- },
23
- },
24
- })