Skip to content

Commit 48599c9

Browse files
committed
Update development dependencies
1 parent 8a1cafc commit 48599c9

File tree

8 files changed

+1594
-1100
lines changed

8 files changed

+1594
-1100
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 GitHub, Inc.
1+
Copyright (c) 2018-2020 GitHub, Inc.
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

markdown-parsing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ for (let level = 2; level <= 6; ++level) {
162162
}
163163

164164
export function insertMarkdownSyntax(root: DocumentFragment): void {
165-
const nodeIterator = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, function(node) {
165+
const nodeIterator = document.createNodeIterator(root, NodeFilter.SHOW_ELEMENT, function (node) {
166166
if (node.nodeName in filters && !skipNode(node) && (hasContent(node) || isCheckbox(node))) {
167167
return NodeFilter.FILTER_ACCEPT
168168
}

package-lock.json

Lines changed: 1557 additions & 1066 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@
2121
"prepublishOnly": "npm run build",
2222
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
2323
},
24+
"prettier": "@github/prettier-config",
2425
"dependencies": {},
2526
"devDependencies": {
26-
"@babel/core": "^7.7.0",
27-
"@babel/preset-env": "^7.7.1",
28-
"@babel/preset-flow": "^7.0.0",
27+
"@babel/core": "^7.9.0",
28+
"@babel/preset-env": "^7.9.5",
29+
"@babel/preset-flow": "^7.9.0",
30+
"@github/prettier-config": "0.0.4",
2931
"chai": "^4.2.0",
30-
"eslint": "^6.6.0",
31-
"eslint-plugin-github": "^3.2.1",
32-
"flow-bin": "^0.111.1",
33-
"karma": "^4.4.1",
32+
"eslint": "^6.8.0",
33+
"eslint-plugin-github": "^3.4.1",
34+
"flow-bin": "^0.122.0",
35+
"karma": "^5.0.1",
3436
"karma-chai": "^0.1.0",
3537
"karma-chrome-launcher": "^3.1.0",
3638
"karma-mocha": "^1.3.0",
3739
"karma-mocha-reporter": "^2.2.5",
38-
"mocha": "^6.2.2",
39-
"rollup": "^1.26.3",
40-
"rollup-plugin-babel": "^4.3.3"
40+
"mocha": "^7.1.1",
41+
"rollup": "^2.4.0",
42+
"rollup-plugin-babel": "^4.4.0"
4143
},
4244
"eslintIgnore": [
4345
"dist/",

prettier.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

quote-selection.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@ function onCopy(event: ClipboardEvent) {
9696
function eventIsNotRelevant(event: KeyboardEvent): boolean {
9797
return (
9898
event.defaultPrevented ||
99-
(event.key !== 'r' || event.metaKey || event.altKey || event.shiftKey || event.ctrlKey) ||
99+
event.key !== 'r' ||
100+
event.metaKey ||
101+
event.altKey ||
102+
event.shiftKey ||
103+
event.ctrlKey ||
100104
(event.target instanceof HTMLElement && isFormField(event.target))
101105
)
102106
}
@@ -188,9 +192,7 @@ function extractQuote(text: string, range: Range, unwrap: boolean): ?Quote {
188192
})
189193
)
190194
insertMarkdownSyntax(fragment)
191-
selectionText = selectFragment(fragment)
192-
.replace(/^\n+/, '')
193-
.replace(/\s+$/, '')
195+
selectionText = selectFragment(fragment).replace(/^\n+/, '').replace(/\s+$/, '')
194196
} catch (error) {
195197
setTimeout(() => {
196198
throw error

test/karma.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module.exports = function(config) {
1+
module.exports = function (config) {
22
config.set({
33
frameworks: ['mocha', 'chai'],
44
files: ['../dist/quote-selection.umd.js', 'test.js'],

test/test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ function quote() {
1414
)
1515
}
1616

17-
describe('quote-selection', function() {
18-
describe('with quotable selection', function() {
17+
describe('quote-selection', function () {
18+
describe('with quotable selection', function () {
1919
let subscription
20-
beforeEach(function() {
20+
beforeEach(function () {
2121
document.body.innerHTML = `
2222
<p id="not-quotable">Not quotable text</p>
2323
<div data-quote>
@@ -33,13 +33,13 @@ describe('quote-selection', function() {
3333
subscription = quoteSelection.subscribe(document.querySelector('[data-nested-quote]'))
3434
})
3535

36-
afterEach(function() {
36+
afterEach(function () {
3737
quoteSelection.uninstall(document.querySelector('[data-quote]'))
3838
subscription.unsubscribe()
3939
document.body.innerHTML = ''
4040
})
4141

42-
it('textarea is updated', function() {
42+
it('textarea is updated', function () {
4343
const el = document.querySelector('#quotable')
4444
const selection = window.getSelection()
4545
window.getSelection = () => createSelection(selection, el)
@@ -49,11 +49,11 @@ describe('quote-selection', function() {
4949
let eventCount = 0
5050
let changeCount = 0
5151

52-
container.addEventListener('quote-selection', function() {
52+
container.addEventListener('quote-selection', function () {
5353
eventCount++
5454
})
5555

56-
textarea.addEventListener('change', function() {
56+
textarea.addEventListener('change', function () {
5757
changeCount++
5858
})
5959

@@ -63,15 +63,15 @@ describe('quote-selection', function() {
6363
assert.equal(changeCount, 1)
6464
})
6565

66-
it('nested textarea is updated when event is captured', function() {
66+
it('nested textarea is updated when event is captured', function () {
6767
const el = document.querySelector('#nested-quotable')
6868
const selection = window.getSelection()
6969
window.getSelection = () => createSelection(selection, el)
7070
const container = document.querySelector('[data-nested-quote]')
7171
const textarea = document.querySelector('#nested-textarea')
7272
const outerTextarea = document.querySelector('#not-hidden-textarea')
7373

74-
container.addEventListener('quote-selection', function() {
74+
container.addEventListener('quote-selection', function () {
7575
textarea.hidden = false
7676
})
7777

@@ -80,7 +80,7 @@ describe('quote-selection', function() {
8080
assert.equal(textarea.value, 'Has text\n\n> Nested text.\n\n')
8181
})
8282

83-
it('textarea is not updated when selecting text outside of quote region', function() {
83+
it('textarea is not updated when selecting text outside of quote region', function () {
8484
const el = document.querySelector('#not-quotable')
8585
const selection = window.getSelection()
8686
window.getSelection = () => createSelection(selection, el)
@@ -91,9 +91,9 @@ describe('quote-selection', function() {
9191
})
9292
})
9393

94-
describe('with markdown enabled', function() {
94+
describe('with markdown enabled', function () {
9595
let subscription
96-
beforeEach(function() {
96+
beforeEach(function () {
9797
document.body.innerHTML = `
9898
<div data-quote>
9999
<div>
@@ -114,12 +114,12 @@ describe('quote-selection', function() {
114114
})
115115
})
116116

117-
afterEach(function() {
117+
afterEach(function () {
118118
subscription.unsubscribe()
119119
document.body.innerHTML = ''
120120
})
121121

122-
it('preserves formatting', function() {
122+
it('preserves formatting', function () {
123123
const range = document.createRange()
124124
range.selectNodeContents(document.querySelector('.comment-body').parentNode)
125125
assert.ok(quoteSelection.quote('whatever', range))
@@ -141,8 +141,8 @@ describe('quote-selection', function() {
141141
)
142142
})
143143

144-
it('allows quote-selection-markdown event to prepare content', function() {
145-
document.querySelector('[data-quote]').addEventListener('quote-selection-markdown', function(event) {
144+
it('allows quote-selection-markdown event to prepare content', function () {
145+
document.querySelector('[data-quote]').addEventListener('quote-selection-markdown', function (event) {
146146
const {fragment} = event.detail
147147
fragment.querySelector('a[href]').replaceWith('@links')
148148
fragment.querySelector('img[alt]').replaceWith(':emoji:')

0 commit comments

Comments
 (0)