Skip to content

Commit 4402a99

Browse files
committed
please standardjs
1 parent fa69bb0 commit 4402a99

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

src/common.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const run = function () {
135135
} else {
136136
window.addEventListener('DOMContentLoaded',
137137
e => runAsync.apply(undefined, arguments),
138-
{once: true}
138+
{ once: true }
139139
)
140140
}
141141
}
@@ -176,7 +176,7 @@ export const queryEach = (selector, fn, host = document) => {
176176
* and anything implementing .forEach
177177
*/
178178
export const each = (iterable, fn) => {
179-
if (isDef(iterable)) {
179+
if (iterable != null) {
180180
if (isObj(iterable)) {
181181
for (const key in iterable) {
182182
fn(iterable[key], key, iterable)

src/directives.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* global CustomEvent */
2-
import {assign, mutateSet, run, queryEach} from './common.js'
2+
import { assign, mutateSet, run, queryEach } from './common.js'
33
import $ from './proxy-node.js'
44

55
/* const watched = Object.create(null)
@@ -11,12 +11,11 @@ watch.update = (name, el, value = el.getAttribute(name)) => {}
1111
*/
1212

1313
const Initiated = new Map()
14-
const beenInitiated = (name, el) =>
15-
Initiated.has(name) && Initiated.get(name)(el)
14+
const beenInitiated = (name, el) => Initiated.has(name) && Initiated.get(name)(el)
1615

1716
export const attributeObserver = (el, name, opts) => {
1817
el = $(el)
19-
let {init, update, remove} = opts
18+
let { init, update, remove } = opts
2019
if (!init && !update && opts instanceof Function) {
2120
[init, update] = [opts, opts]
2221
}
@@ -34,7 +33,7 @@ export const attributeObserver = (el, name, opts) => {
3433
let removedBefore = false
3534
let old = el.attr[name]
3635
intialize(el.attr.has(name), old)
37-
const stop = el.on.attr(({name: attrName, value, oldvalue, present}) => {
36+
const stop = el.on.attr(({ name: attrName, value, oldvalue, present }) => {
3837
if (
3938
attrName === name &&
4039
old !== value &&

src/event-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* global Node NodeList */
2-
import {clone, assign, isObj, isArr, isStr, curry, queryAll} from './common.js'
2+
import { clone, assign, isObj, isArr, isStr, curry, queryAll } from './common.js'
33
import $ from './proxy-node.js'
44

55
const listen = function (once, target, type, fn, options = false) {
@@ -83,7 +83,7 @@ const listen = function (once, target, type, fn, options = false) {
8383
target.removeEventListener(type, wrapper)
8484
off.ison = false
8585
return off
86-
}, {target, on, once})
86+
}, { target, on, once })
8787
off.off = off
8888

8989
return on()

src/lifecycles.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global CustomEvent MutationObserver Element */
2-
import {mutateSet, isComponent} from './common.js'
3-
import {updateComponent} from './components.js'
4-
import {attributeChange, directives} from './directives.js'
2+
import { mutateSet, isComponent } from './common.js'
3+
import { updateComponent } from './components.js'
4+
import { attributeChange, directives } from './directives.js'
55

66
export const Created = mutateSet(new WeakSet())
77
export const Mounted = mutateSet(new WeakSet())
@@ -58,7 +58,7 @@ export const UnmountNodes = n => updateComponent(n, 'unmount') || UNMNT(n)
5858

5959
new MutationObserver(muts => {
6060
for (const mut of muts) {
61-
const {addedNodes, removedNodes, attributeName} = mut
61+
const { addedNodes, removedNodes, attributeName } = mut
6262
if (addedNodes.length) {
6363
for (const node of addedNodes) MountNodes(node)
6464
}

0 commit comments

Comments
 (0)