Skip to content

Commit 734bd8e

Browse files
committed
fix linter issues
1 parent 2320b20 commit 734bd8e

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

src/builtIns/collections.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { proxyToRaw, rawToProxy } from '../internals'
88

99
const hasOwnProperty = Object.prototype.hasOwnProperty
1010

11-
function findObservable(obj) {
11+
function findObservable (obj) {
1212
const observableObj = rawToProxy.get(obj)
1313
if (hasRunningReaction() && typeof obj === 'object' && obj !== null) {
1414
if (observableObj) {
@@ -19,7 +19,7 @@ function findObservable(obj) {
1919
return observableObj || obj
2020
}
2121

22-
function patchIterator(iterator, isEntries) {
22+
function patchIterator (iterator, isEntries) {
2323
const originalNext = iterator.next
2424
iterator.next = () => {
2525
let { done, value } = originalNext.call(iterator)
@@ -36,19 +36,19 @@ function patchIterator(iterator, isEntries) {
3636
}
3737

3838
const instrumentations = {
39-
has(key) {
39+
has (key) {
4040
const target = proxyToRaw.get(this)
4141
const proto = Reflect.getPrototypeOf(this)
4242
registerRunningReactionForOperation({ target, key, type: 'has' })
4343
return proto.has.apply(target, arguments)
4444
},
45-
get(key) {
45+
get (key) {
4646
const target = proxyToRaw.get(this)
4747
const proto = Reflect.getPrototypeOf(this)
4848
registerRunningReactionForOperation({ target, key, type: 'get' })
4949
return findObservable(proto.get.apply(target, arguments))
5050
},
51-
add(key) {
51+
add (key) {
5252
const target = proxyToRaw.get(this)
5353
const proto = Reflect.getPrototypeOf(this)
5454
const hadKey = proto.has.call(target, key)
@@ -59,7 +59,7 @@ const instrumentations = {
5959
}
6060
return result
6161
},
62-
set(key, value) {
62+
set (key, value) {
6363
const target = proxyToRaw.get(this)
6464
const proto = Reflect.getPrototypeOf(this)
6565
const hadKey = proto.has.call(target, key)
@@ -73,7 +73,7 @@ const instrumentations = {
7373
}
7474
return result
7575
},
76-
delete(key) {
76+
delete (key) {
7777
const target = proxyToRaw.get(this)
7878
const proto = Reflect.getPrototypeOf(this)
7979
const hadKey = proto.has.call(target, key)
@@ -85,7 +85,7 @@ const instrumentations = {
8585
}
8686
return result
8787
},
88-
clear() {
88+
clear () {
8989
const target = proxyToRaw.get(this)
9090
const proto = Reflect.getPrototypeOf(this)
9191
const hadItems = target.size !== 0
@@ -97,7 +97,7 @@ const instrumentations = {
9797
}
9898
return result
9999
},
100-
forEach(cb, ...args) {
100+
forEach (cb, ...args) {
101101
const target = proxyToRaw.get(this)
102102
const proto = Reflect.getPrototypeOf(this)
103103
registerRunningReactionForOperation({ target, type: 'iterate' })
@@ -106,34 +106,34 @@ const instrumentations = {
106106
const wrappedCb = (value, ...rest) => cb(findObservable(value), ...rest)
107107
return proto.forEach.call(target, wrappedCb, ...args)
108108
},
109-
keys() {
109+
keys () {
110110
const target = proxyToRaw.get(this)
111111
const proto = Reflect.getPrototypeOf(this)
112112
registerRunningReactionForOperation({ target, type: 'iterate' })
113113
return proto.keys.apply(target, arguments)
114114
},
115-
values() {
115+
values () {
116116
const target = proxyToRaw.get(this)
117117
const proto = Reflect.getPrototypeOf(this)
118118
registerRunningReactionForOperation({ target, type: 'iterate' })
119119
const iterator = proto.values.apply(target, arguments)
120120
return patchIterator(iterator, false)
121121
},
122-
entries() {
122+
entries () {
123123
const target = proxyToRaw.get(this)
124124
const proto = Reflect.getPrototypeOf(this)
125125
registerRunningReactionForOperation({ target, type: 'iterate' })
126126
const iterator = proto.entries.apply(target, arguments)
127127
return patchIterator(iterator, true)
128128
},
129-
[Symbol.iterator]() {
129+
[Symbol.iterator] () {
130130
const target = proxyToRaw.get(this)
131131
const proto = Reflect.getPrototypeOf(this)
132132
registerRunningReactionForOperation({ target, type: 'iterate' })
133133
const iterator = proto[Symbol.iterator].apply(target, arguments)
134134
return patchIterator(iterator, target instanceof Map)
135135
},
136-
get size() {
136+
get size () {
137137
const target = proxyToRaw.get(this)
138138
const proto = Reflect.getPrototypeOf(this)
139139
registerRunningReactionForOperation({ target, type: 'iterate' })
@@ -142,7 +142,7 @@ const instrumentations = {
142142
}
143143

144144
export default {
145-
get(target, key, receiver) {
145+
get (target, key, receiver) {
146146
// instrument methods and property accessors to be reactive
147147
target = hasOwnProperty.call(instrumentations, key)
148148
? instrumentations

tests/builtIns/Map.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint no-unused-expressions: 0, no-unused-vars: 0 */
2+
13
import { expect } from 'chai'
24
import { observable, isObservable, observe, raw } from '@nx-js/observer-util'
35
import { spy } from '../utils'

tests/builtIns/Set.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint no-unused-expressions: 0, no-unused-vars: 0 */
2+
13
import { expect } from 'chai'
24
import { observable, isObservable, observe, raw } from '@nx-js/observer-util'
35
import { spy } from '../utils'

tests/builtIns/WeakMap.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint no-unused-expressions: 0, no-unused-vars: 0 */
2+
13
import { expect } from 'chai'
24
import { observable, isObservable, observe, raw } from '@nx-js/observer-util'
35
import { spy } from '../utils'

0 commit comments

Comments
 (0)