├── .github
└── workflows
│ └── test-plugin.yml
├── .gitignore
├── LICENSE
├── README.md
├── jest.config.js
├── package-lock.json
├── package.json
├── src
├── index.ts
├── soft-delete-model.ts
└── soft-delete-plugin.ts
├── tests
├── README.md
└── index.test.ts
└── tsconfig.json
/.github/workflows/test-plugin.yml:
--------------------------------------------------------------------------------
1 | name: CI - Test Mongoose Plugin
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | branches: [main]
8 |
9 | jobs:
10 | test:
11 | runs-on: ubuntu-latest
12 |
13 | services:
14 | mongo:
15 | image: mongo:7
16 | ports:
17 | - 27017:27017
18 | options: >-
19 | --health-cmd "mongosh --eval 'db.runCommand({ ping: 1 })'"
20 | --health-interval 10s
21 | --health-timeout 5s
22 | --health-retries 5
23 |
24 | steps:
25 | - name: Checkout repository
26 | uses: actions/checkout@v3
27 |
28 | - name: Set up Node.js
29 | uses: actions/setup-node@v4
30 | with:
31 | node-version: 20
32 |
33 | - name: Install dependencies
34 | run: npm ci
35 |
36 | - name: Run tests
37 | env:
38 | MONGO_URL: mongodb://localhost:27017/test
39 | run: npm test
40 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .idea
3 | dist
4 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 NourKaroui
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Welcome to soft-delete-plugin-mongoose 👋
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | > a mongoose plugin that allows you to soft delete documents and restore them in MongoDB (for JS & TS)
18 |
19 | * **Soft delete your MongoDB documents and restore them**
20 |
21 | * **JS and TS**
22 |
23 |
24 | ### 🏠 [Homepage](https://github.com/nour-karoui/mongoose-soft-delete)
25 |
26 |
27 | ## Install
28 |
29 | ```sh
30 | npm install soft-delete-plugin-mongoose
31 | ```
32 |
33 | ## How It Works
34 |
35 | **Javascript Version**
36 | ```js
37 | const mongoose = require('mongoose');
38 | const { softDeletePlugin } = require('soft-delete-plugin-mongoose');
39 | const Schema = mongoose.Schema;
40 |
41 | const TestSchema = new Schema({
42 | name: String,
43 | lastName: String
44 | });
45 |
46 | TestSchema.plugin(softDeletePlugin);
47 | const TestModel = mongoose.model("Test", TestSchema);
48 |
49 | const test = new TestModel({name: 'hello', lastName: "world"});
50 |
51 | /*** returns an object containing the number of softDeleted elements ***/
52 | /***
53 | {deleted: number}
54 | ***/
55 | /***
56 | the argument options is optional
57 | ***/
58 | const options = { validateBeforeSave: false };
59 | const deleted = await TestModel.softDelete({ _id: test._id, name: test.name }, options);
60 | /**
61 | const deleted = await Test.softDelete({ _id: test._id, name: test.name }); is also valid
62 | **/
63 |
64 | /*** returns an object containing the number of restored elements ***/
65 | /***
66 | {restored: number}
67 | ***/
68 | const restored = await TestModel.restore({ _id: test._id, name: test.name });
69 |
70 | /*** returns all deleted elements ***/
71 | const deletedElements = await TestModel.findDeleted();
72 |
73 | /*** returns all available elements (not deleted) ***/
74 | const availableElements = await TestModel.find();
75 |
76 | /*** counts all available elements (not deleted) ***/
77 | const countAvailable = await TestModel.count();
78 |
79 | /*** findById returns the document whether deleted or not ***/
80 | ```
81 |
82 | **Typescript Version**
83 | ```ts
84 | import * as mongoose from 'mongoose';
85 | import { softDeletePlugin, SoftDeleteModel } from 'soft-delete-plugin-mongoose';
86 |
87 | interface Test extends mongoose.Document {
88 | name: string;
89 | lastName: string;
90 | }
91 |
92 | const TestSchema = new mongoose.Schema({
93 | name: String,
94 | lastName: String
95 | });
96 | TestSchema.plugin(softDeletePlugin);
97 | // two different ways of implementing model depending on technology used
98 | // 1st way
99 | const testModel = mongoose.model>('Test', TestSchema);
100 |
101 | //2nd way (nestjs way)
102 | constructor(@InjectModel('Test') private readonly testModel: SoftDeleteModel) {}
103 |
104 | const test = await new this.testModel({name: 'hello', lastName: 'world'});
105 |
106 | /*** returns an object containing the number of softDeleted elements ***/
107 | /***
108 | {deleted: number}
109 | ***/
110 | /***
111 | the argument options is optional
112 | ***/
113 | const options = { validateBeforeSave: false };
114 | const deleted = await this.testModel.softDelete({ _id: test._id, name: test.name }, options);
115 | /**
116 | const deleted = await Test.softDelete({ _id: test._id, name: test.name }); is also valid
117 | **/
118 |
119 | /*** returns an object containing the number of restored elements ***/
120 | /***
121 | {restored: number}
122 | ***/
123 | const restored = await this.testModel.restore({ _id: test._id, name: test.name });
124 |
125 | /*** returns all deleted elements ***/
126 | const deletedElements = await this.testModel.findDeleted();
127 |
128 | /*** returns all available elements (not deleted) ***/
129 | const availableElements = await this.testModel.find();
130 |
131 | /*** counts all available elements (not deleted) ***/
132 | const countAvailable = await this.test.count();
133 |
134 | /*** findById returns the document whether deleted or not ***/
135 | ```
136 |
137 | ## Author
138 |
139 | 👤 **Nour**
140 |
141 | * Github: [@nour-karoui](https://github.com/nour-karoui)
142 | * LinkedIn: [@nourkaroui](https://www.linkedin.com/in/nourkaroui/)
143 |
144 | ## 🤝 Contributing
145 |
146 | Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/nour-karoui/mongoose-soft-delete/issues). You can also take a look at the [contributing guide](https://github.com/nour-karoui/mongoose-soft-delete/blob/master/CONTRIBUTING.md).
147 |
148 | ## Show your support
149 |
150 | Give a [STAR](https://github.com/nour-karoui/mongoose-soft-delete) if this project helped you!
151 |
152 | ## 📝 License
153 |
154 | * Copyright © 2021 [Nour](https://github.com/nour-karoui).
155 | * This project is [MIT](https://github.com/nour-karoui/mongoose-soft-delete/blob/master/LICENSE) licensed.
156 |
157 | ***
158 | _This README was generated with by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
159 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | transform: { "^.+\\.ts?$": "ts-jest" },
3 | testEnvironment: "node",
4 | testRegex: "/tests/.*\\.(test)?\\.(ts)$",
5 | moduleFileExtensions: ["ts", "js", "json", "node"],
6 | };
7 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "soft-delete-plugin-mongoose",
3 | "version": "1.0.15",
4 | "description": "a mongoose plugin that allows you to soft delete documents and restore them (for JS & TS)",
5 | "main": "dist/index.js",
6 | "types": "dist/index.d.ts",
7 | "files": [
8 | "dist/**/*"
9 | ],
10 | "scripts": {
11 | "clean": "del .\\dist\\*",
12 | "build": "npm run clean && tsc",
13 | "test": "jest"
14 | },
15 | "keywords": [
16 | "mongoose",
17 | "soft delete mongoose",
18 | "soft delete mongodb",
19 | "mongoose typescript",
20 | "mongoose",
21 | "typescript",
22 | "mongoose soft delete typescript",
23 | "mongoose soft delete nestjs"
24 | ],
25 | "author": "Nour KAROUI",
26 | "repository": {
27 | "type": "git",
28 | "url": "git+https://github.com/nour-karoui/mongoose-soft-delete"
29 | },
30 | "bugs": {
31 | "url": "https://github.com/nour-karoui/mongoose-soft-delete/issues"
32 | },
33 | "homepage": "https://github.com/nour-karoui/mongoose-soft-delete",
34 | "license": "MIT",
35 | "peerDependencies": {
36 | "mongoose": "^7.6.1"
37 | },
38 | "devDependencies": {
39 | "@types/jest": "^29.4.0",
40 | "jest": "^29.4.0",
41 | "ts-jest": "^29.0.5",
42 | "typescript": "^4.2.3"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from './soft-delete-plugin';
2 | export * from './soft-delete-model';
3 |
--------------------------------------------------------------------------------
/src/soft-delete-model.ts:
--------------------------------------------------------------------------------
1 | import {Document, SaveOptions} from "mongoose";
2 | import * as mongoose from "mongoose";
3 |
4 | export interface SoftDeleteModel extends mongoose.Model {
5 | findDeleted(): Promise;
6 | restore(query: Record): Promise<{ restored: number }>;
7 | softDelete(query: Record, options?: SaveOptions): Promise<{ deleted: number }>;
8 | }
9 |
--------------------------------------------------------------------------------
/src/soft-delete-plugin.ts:
--------------------------------------------------------------------------------
1 | import mongoose, { CallbackError, MongooseQueryMiddleware, SaveOptions } from 'mongoose';
2 |
3 | const QUERY_HOOK_METHODS: MongooseQueryMiddleware[] = [
4 | 'find',
5 | 'findOne',
6 | 'count',
7 | 'countDocuments',
8 | 'updateMany',
9 | 'updateOne',
10 | 'findOneAndUpdate',
11 | 'distinct',
12 | ];
13 |
14 | export const softDeletePlugin = (schema: mongoose.Schema) => {
15 | schema.add({
16 | isDeleted: {
17 | type: Boolean,
18 | required: true,
19 | default: false,
20 | },
21 | deletedAt: {
22 | type: Date,
23 | default: null,
24 | },
25 | });
26 |
27 | // @ts-ignore
28 | schema.pre(QUERY_HOOK_METHODS,
29 | async function (this, next: (err?: CallbackError) => void) {
30 | if (this.getFilter().isDeleted === true) {
31 | return next();
32 | }
33 | this.setQuery({ ...this.getFilter(), isDeleted: { $ne: true } });
34 | next();
35 | },
36 | );
37 |
38 | schema.static('findDeleted', async function () {
39 | return this.find({ isDeleted: true });
40 | });
41 |
42 | schema.static('restore', async function (query) {
43 |
44 | // add {isDeleted: true} because the method find is set to filter the non deleted documents only,
45 | // so if we don't add {isDeleted: true}, it won't be able to find it
46 | const updatedQuery = {
47 | ...query,
48 | isDeleted: true
49 | };
50 | const deletedTemplates = await this.find(updatedQuery);
51 | if (!deletedTemplates) {
52 | return Error('element not found');
53 | }
54 | let restored = 0;
55 | for (const deletedTemplate of deletedTemplates) {
56 | if (deletedTemplate.isDeleted) {
57 | deletedTemplate.$isDeleted(false);
58 | deletedTemplate.isDeleted = false;
59 | deletedTemplate.deletedAt = null;
60 | await deletedTemplate.save().then(() => restored++).catch((e: mongoose.Error) => { throw new Error(e.name + ' ' + e.message) });
61 | }
62 | }
63 | return { restored };
64 | });
65 |
66 | schema.static('softDelete', async function (query, options?: SaveOptions) {
67 | const templates = await this.find(query);
68 | if (!templates) {
69 | return Error('Element not found');
70 | }
71 | let deleted = 0;
72 | for (const template of templates) {
73 | if (!template.isDeleted) {
74 | template.$isDeleted(true);
75 | template.isDeleted = true;
76 | template.deletedAt = new Date();
77 | await template.save(options).then(() => deleted++).catch((e: mongoose.Error) => { throw new Error(e.name + ' ' + e.message) });
78 | }
79 | }
80 | return { deleted };
81 | });
82 | };
83 |
84 |
--------------------------------------------------------------------------------
/tests/README.md:
--------------------------------------------------------------------------------
1 | # Unit Test
2 |
3 | ## How to run unit test locally
4 |
5 | 1. Using Docker to start a MongoDB container locally with 27017 port and `test` database.
6 |
7 | ```
8 | docker run --name mongoose-soft-delete-test -e MONGO_INITDB_DATABASE=test -d -p 27017:27017 mongo:7
9 | ```
10 |
11 | 2. Run jest!
12 |
13 | _Notice: please make sure you don't use wrong database to perform unit test_
14 |
15 | ```
16 | npm run test
17 | ```
18 |
19 | 3. After tested it locally, you can teardown with
20 |
21 | ```
22 | docker rm -f mongoose-soft-delete-test
23 | ```
24 |
--------------------------------------------------------------------------------
/tests/index.test.ts:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 | import { softDeletePlugin, SoftDeleteModel } from '../src/index';
3 |
4 | interface User extends mongoose.Document {
5 | name: string;
6 | }
7 | const UserSchema = new mongoose.Schema({
8 | name: String,
9 | });
10 | UserSchema.plugin(softDeletePlugin);
11 | const userModel = mongoose.model>('User', UserSchema);
12 |
13 | describe('soft delete plugin', () => {
14 | beforeAll(async () => {
15 | await mongoose.connect('mongodb://0.0.0.0:27017/test');
16 | })
17 |
18 | afterAll(async () => {
19 | await mongoose.disconnect();
20 | })
21 |
22 | afterEach(async () => {
23 | await userModel.deleteMany();
24 | });
25 |
26 | test('softDelete should be successed', async () => {
27 | // create one user
28 | const user = await new userModel({ name: 'peter' }).save();
29 | expect(user.name).toBe('peter');
30 |
31 | // get this user before we perform soft delete
32 | const userBeforeDelete = await userModel.find({ _id: user._id });
33 | expect(userBeforeDelete?.length).toBe(1);
34 |
35 | // perform soft delete
36 | const softDeleteResp = await userModel.softDelete({ _id: user._id });
37 | expect(softDeleteResp.deleted).toBe(1);
38 |
39 | // get this user after we performed soft delete
40 | const userAfterDelete = await userModel.find({ _id: user._id });
41 | expect(userAfterDelete?.length).toBe(0);
42 |
43 | const usersCount = await userModel.countDocuments();
44 | expect(usersCount).toBe(0);
45 |
46 | //soft deleted documents should not be updated by updateOne
47 | const updatedUser = await userModel.updateOne({ _id: user._id }, { $set: { name: 'james' } });
48 | expect(updatedUser.modifiedCount).toBe(0);
49 |
50 | //soft deleted documents should not be updated by updateMany
51 | const updatedUsers = await userModel.updateMany({ _id: user._id }, { $set: { name: 'james2' } });
52 | expect(updatedUsers.modifiedCount).toBe(0);
53 |
54 | const allUserIds = await userModel.distinct('_id');
55 | expect(allUserIds.length).toBe(0);
56 |
57 | const allUserIdsWithDeleted = await userModel.distinct('_id', { isDeleted: true });
58 | expect(allUserIdsWithDeleted.length).toBe(1);
59 | });
60 |
61 | test('restore should be successed', async () => {
62 | // create one user
63 | const user = await new userModel({ name: 'peter' }).save();
64 | expect(user.name).toBe('peter');
65 |
66 | // perform soft delete
67 | const softDeleteResp = await userModel.softDelete({ _id: user._id });
68 | expect(softDeleteResp.deleted).toBe(1);
69 |
70 | // get this user after we performed soft delete
71 | const userAfterDelete = await userModel.find({ _id: user._id });
72 | expect(userAfterDelete?.length).toBe(0);
73 |
74 | // restore this user
75 | const restoreResp = await userModel.restore({ _id: user._id });
76 | expect(restoreResp.restored).toBe(1);
77 |
78 | // get this user after we perform restore
79 | const userAfterRestore = await userModel.find({ _id: user._id });
80 | expect(userAfterRestore?.length).toBe(1);
81 | });
82 |
83 | test('findDeleted should be successed', async () => {
84 | // create one user
85 | const user = await new userModel({ name: 'peter' }).save();
86 | expect(user.name).toBe('peter');
87 |
88 | // perform soft delete
89 | const softDeleteResp = await userModel.softDelete({ _id: user._id });
90 | expect(softDeleteResp.deleted).toBe(1);
91 |
92 | // get this user after we performed soft delete
93 | const userAfterDelete = await userModel.find({ _id: user._id });
94 | expect(userAfterDelete?.length).toBe(0);
95 |
96 | // get soft deleted user
97 | const deletedUsers = await userModel.findDeleted();
98 | expect(deletedUsers.length).toBe(1);
99 | });
100 |
101 | test('updateMany should be successed', async () => {
102 | // create one user
103 | const user = await new userModel({ name: 'peter' }).save();
104 | expect(user.name).toBe('peter');
105 |
106 | // update many
107 | const updateResp = await userModel.updateMany({ name: 'peter' }, { $set: { name: 'james' } });
108 | expect(updateResp.modifiedCount).toBe(1);
109 |
110 | // get updated user
111 | const updatedUser = await userModel.find({ name: 'james' });
112 | expect(updatedUser.length).toBe(1);
113 | });
114 | });
115 |
116 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Visit https://aka.ms/tsconfig.json to read more about this file */
4 |
5 | /* Basic Options */
6 | // "incremental": true, /* Enable incremental compilation */
7 | "target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
8 | "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
9 | // "lib": [], /* Specify library files to be included in the compilation. */
10 | // "allowJs": true, /* Allow javascript files to be compiled. */
11 | // "checkJs": true, /* Report errors in .js files. */
12 | // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', 'react', 'react-jsx' or 'react-jsxdev'. */
13 | "declaration": true, /* Generates corresponding '.d.ts' file. */
14 | // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
15 | // "sourceMap": true, /* Generates corresponding '.map' file. */
16 | // "outFile": "./", /* Concatenate and emit output to single file. */
17 | "outDir": "./dist", /* Redirect output structure to the directory. */
18 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
19 | // "composite": true, /* Enable project compilation */
20 | // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
21 | // "removeComments": true, /* Do not emit comments to output. */
22 | // "noEmit": true, /* Do not emit outputs. */
23 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
24 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
25 | // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
26 |
27 | /* Strict Type-Checking Options */
28 | "strict": true, /* Enable all strict type-checking options. */
29 | // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
30 | // "strictNullChecks": true, /* Enable strict null checks. */
31 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
32 | // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
33 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
34 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
35 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
36 |
37 | /* Additional Checks */
38 | // "noUnusedLocals": true, /* Report errors on unused locals. */
39 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
40 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
41 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
42 | // "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */
43 | // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */
44 |
45 | /* Module Resolution Options */
46 | // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
47 | // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
48 | // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
49 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
50 | // "typeRoots": [], /* List of folders to include type definitions from. */
51 | // "types": [], /* Type declaration files to be included in compilation. */
52 | // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
53 | "esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
54 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
55 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
56 |
57 | /* Source Map Options */
58 | // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
61 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
62 |
63 | /* Experimental Options */
64 | // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
65 | // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
66 |
67 | /* Advanced Options */
68 | "skipLibCheck": true, /* Skip type checking of declaration files. */
69 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */
70 | }
71 | }
72 |
--------------------------------------------------------------------------------