Skip to content

Commit 924e4bd

Browse files
committed
docs: add authors, license, changelog
1 parent 1a7dc63 commit 924e4bd

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Valeriy Borodayev <borodaev97@gmail.com>

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## master
2+
3+
## 0.0.0-semantically-released
4+
This package publishing automated by [semantic-release](https://github.com/semantic-release/semantic-release).
5+
[Changelog](https://github.com/FrankAst/mongoose-history-diff/releases) is generated automatically and can be found here: https://github.com/FrankAst/mongoose-history-diff/releases

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2018-present
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import DiffPlugin from 'mongoose-history-diff';
3232

3333
### Exclude fields
3434

35-
You can exlude document fields from tracking by adding `{ track_diff: false }` property to your field definition inside schema:
35+
You can exlude document fields from tracking by adding `{ track_diff: false }` property to your field definition inside the schema:
3636

3737
```js
3838
export const PostSchema: MongooseSchema<PostDoc> = new mongoose.Schema(
@@ -66,21 +66,21 @@ After adding, plugin will create a diff document with a following shape in separ
6666

6767
```js
6868
{
69-
_id: 5c33240bd7cce8cba92030aa,
70-
dId: 5c25abc9c9a367742cd5341b,
69+
_id: '5c33240bd7cce8cba92030aa',
70+
dId: '5c25abc9c9a367742cd5341b',
7171
c : [
7272
{
7373
p : [
74-
"lastname"
74+
'lastname'
7575
],
76-
k : "E",
77-
l : "borodaev",
78-
r : "Borodayev"
76+
k : 'E',
77+
l : 'borodaev',
78+
r : 'Borodayev'
7979
}
8080
],
8181
v: 4,
82-
createdAt: 2019-01-07T10:03:55.933Z,
83-
updatedAt: 2019-01-07T10:03:55.933Z,
82+
createdAt: '2019-01-07T10:03:55.933Z',
83+
updatedAt: '2019-01-07T10:03:55.933Z',
8484
}
8585
```
8686

@@ -99,7 +99,7 @@ Diffs are represented as one or more change records. Change records have the fol
9999
* `i` - when `k === 'A'`, indicates the array index where the change occurred
100100
* `it` - when `k === 'A'`, contains a nested change record indicating the change that occurred at the array index
101101

102-
Under the hood plugin uses refactored and simplified algorithm of `deep-diff` package, that is why this plugin has similar structure. You can explore that [repo](https://github.com/flitbit/diff) too if you are interested in.
102+
Under the hood plugin uses refactored and simplified algorithm of `deep-diff` package, that is why this plugin has similar structure of changes. You can explore that [repo](https://github.com/flitbit/diff) too if you are interested in.
103103

104104

105105
## Methods
@@ -111,25 +111,16 @@ const Diff = Post.diffModel();
111111
```
112112

113113
This model contains several static methods as well:
114-
* `findByDocId(_id: ObjectId)` - finds all diffs docs by parent doc `_id`
115-
* `findAfterVersion(_id: ObjectId, v: number)` - finds all diffs docs by parent doc `_id` after specific version
114+
* `findByDocId(_id: ObjectId)` - finds all diffs by parent doc `_id`
115+
* `findAfterVersion(_id: ObjectId, v: number)` - finds all diffs by parent doc `_id` after specific version
116116
* `findBeforeVersion(_id: ObjectId, v: number)` - finds all diffs docs by parent doc `_id` before specific version
117117
* `revertToVersion(doc: Object, v: number)` - reverts changes of specific doc to a specific version.
118118
* `mergeDiffs(doc: MongooseDocument)` - return all diffs between current doc state and initial doc state.
119119

120-
121-
122-
123-
124-
125-
126-
127-
128-
129120
## Contribution
130121

131122
Feel free to submit pull request. Also, be sure all tests has passed otherwise pull request won't be merged.
132123

133124
## License
134125

135-
[MIT](https://github.com/FrankAst/sms-sender/blob/master/LICENSE.md)
126+
[MIT](https://github.com/FrankAst/mongoose-history-diff/blob/master/LICENSE.md)

0 commit comments

Comments
 (0)