fix linter errors
This commit is contained in:
@@ -32,8 +32,8 @@ index = $pos.index(d)
|
||||
// this is a copy of splitListItem
|
||||
// see https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js
|
||||
|
||||
export default function splitListItem(itemType) {
|
||||
return function _splitListItem(state, dispatch) {
|
||||
export default function splitToDefaultListItem(itemType) {
|
||||
return function (state, dispatch) {
|
||||
const { $from, $to, node } = state.selection
|
||||
if ((node && node.isBlock) || $from.depth < 2 || !$from.sameParent($to)) return false
|
||||
const grandParent = $from.node(-1)
|
||||
|
||||
@@ -16,9 +16,7 @@ export default class Emitter {
|
||||
const callbacks = this._callbacks[event]
|
||||
|
||||
if (callbacks) {
|
||||
for (const callback of callbacks) {
|
||||
callback.apply(this, args)
|
||||
}
|
||||
callbacks.forEach(callback => callback.apply(this, args))
|
||||
}
|
||||
|
||||
return this
|
||||
@@ -46,7 +44,7 @@ export default class Emitter {
|
||||
}
|
||||
|
||||
// remove specific handler
|
||||
for (let i = 0; i < callbacks.length; i++) {
|
||||
for (let i = 0; i < callbacks.length; i += 1) {
|
||||
const callback = callbacks[i]
|
||||
if (callback === fn) {
|
||||
callbacks.splice(i, 1)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default function (str) {
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index == 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
|
||||
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, (word, index) => (index === 0 ? word.toLowerCase() : word.toUpperCase())).replace(/\s+/g, '')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user