Skip to content

Commit 38ffa23

Browse files
committed
chore: lint src files
1 parent d978bc3 commit 38ffa23

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

src/mixins/Model.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ export default function Model(
88
/**
99
* Soft delete model(s) matching a condition.
1010
*/
11-
model.softDelete = function(payload: any) {
11+
model.softDelete = function (payload: any) {
1212
return this.dispatch('softDelete', payload)
1313
}
1414

1515
/**
1616
* Soft delete a model instance.
1717
*/
18-
model.prototype.$softDelete = async function(hydrate?) {
18+
model.prototype.$softDelete = async function (hydrate?) {
1919
const model = await this.$dispatch(
2020
'softDelete',
2121
this.$self().getIdFromRecord(this)
@@ -40,7 +40,7 @@ export default function Model(
4040
/**
4141
* Restore a model instance.
4242
*/
43-
model.prototype.$restore = async function(hydrate?) {
43+
model.prototype.$restore = async function (hydrate?) {
4444
const { key, flagName } = context.createConfig(
4545
this.$self().softDeleteConfig
4646
)
@@ -68,7 +68,7 @@ export default function Model(
6868
/**
6969
* Determine if the model instance has been soft deleted.
7070
*/
71-
model.prototype.$trashed = function() {
71+
model.prototype.$trashed = function () {
7272
const { flagName } = context.createConfig(this.$self().softDeleteConfig)
7373

7474
return this[flagName] === true
@@ -79,7 +79,7 @@ export default function Model(
7979
* This method is deprecated and will warn users until retired.
8080
* @deprecated since v1.2.0
8181
*/
82-
model.prototype.softDelete = function(hydrate?) {
82+
model.prototype.softDelete = function (hydrate?) {
8383
/* istanbul ignore next */
8484
if (__DEV__) {
8585
console.warn(
@@ -95,7 +95,7 @@ export default function Model(
9595
*/
9696
const $fields = model.prototype.$fields
9797

98-
model.prototype.$fields = function() {
98+
model.prototype.$fields = function () {
9999
const fields = $fields.call(this)
100100

101101
const { key, flagName } = context.createConfig(
@@ -114,7 +114,7 @@ export default function Model(
114114
*/
115115
const $toJson = model.prototype.$toJson
116116

117-
model.prototype.$toJson = function() {
117+
model.prototype.$toJson = function () {
118118
const toJson = $toJson.call(this)
119119

120120
const config = context.createConfig(this.$self().softDeleteConfig)

src/mixins/Query.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default function Query(
1717
/**
1818
* Constraint includes soft deleted models.
1919
*/
20-
query.prototype.withTrashed = function() {
20+
query.prototype.withTrashed = function () {
2121
this.softDeleteSelectFilter = false
2222

2323
return this
@@ -26,7 +26,7 @@ export default function Query(
2626
/**
2727
* Constraint restricts to only soft deleted models.
2828
*/
29-
query.prototype.onlyTrashed = function() {
29+
query.prototype.onlyTrashed = function () {
3030
this.softDeleteSelectFilter = true
3131

3232
return this
@@ -36,7 +36,7 @@ export default function Query(
3636
* Deprecated alias method for `onlyTrashed`.
3737
* @deprecated since v1.2.0
3838
*/
39-
query.prototype.trashed = function() {
39+
query.prototype.trashed = function () {
4040
/* istanbul ignore next */
4141
if (__DEV__) {
4242
console.warn(
@@ -50,7 +50,7 @@ export default function Query(
5050
/**
5151
* Process the model(s) to be soft deleted.
5252
*/
53-
query.prototype.softDelete = function(condition: any) {
53+
query.prototype.softDelete = function (condition: any) {
5454
const { key, flagName, mutator } = context.createConfig(
5555
this.model.softDeleteConfig
5656
)
@@ -92,10 +92,8 @@ export default function Query(
9292
/**
9393
* Fetch all soft deletes from the store.
9494
*/
95-
query.prototype.allTrashed = function() {
96-
return this.newQuery()
97-
.onlyTrashed()
98-
.get()
95+
query.prototype.allTrashed = function () {
96+
return this.newQuery().onlyTrashed().get()
9997
}
10098

10199
/**
@@ -105,7 +103,7 @@ export default function Query(
105103
*/
106104
const newQuery = query.prototype.newQuery
107105

108-
query.prototype.newQuery = function(entity?) {
106+
query.prototype.newQuery = function (entity?) {
109107
const patchedQuery = newQuery.call(this, entity)
110108

111109
// Only patch queries that are loading relations.
@@ -137,7 +135,7 @@ export default function Query(
137135
/**
138136
* Fetch all soft deletes from the store and group by entity.
139137
*/
140-
query.allTrashed = function(store) {
138+
query.allTrashed = function (store) {
141139
const database = store.$db()
142140
const models = database.models()
143141

@@ -151,7 +149,7 @@ export default function Query(
151149
* Global select hook prevents soft deleted models from being selected unless
152150
* queries are explicity chained with `withTrashed` or `onlyTrashed`.
153151
*/
154-
query.on('beforeSelect', function<T extends BaseQuery>(
152+
query.on('beforeSelect', function <T extends BaseQuery>(
155153
this: T,
156154
models: Data.Collection
157155
) {

src/mixins/RootActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function RootActions(
1212
/**
1313
* Soft delete records and persist the store.
1414
*/
15-
rootActions.softDelete = async function(
15+
rootActions.softDelete = async function (
1616
this: Store<any>,
1717
_context: RootActionContext,
1818
payload: any

src/mixins/RootGetters.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function RootGetters(
1313
/**
1414
* Get all trashed records belonging to an entity.
1515
*/
16-
rootGetters.allTrashed = function(this: Store<any>, _state: RootState) {
16+
rootGetters.allTrashed = function (this: Store<any>, _state: RootState) {
1717
return (entity?: string): Collection | Collections => {
1818
if (entity) {
1919
return new context.query(this, entity).allTrashed()

0 commit comments

Comments
 (0)