Skip to content

Commit

Permalink
Update deps (honestbleeps#4806)
Browse files Browse the repository at this point in the history
Tested in browser: Chrome 69
  • Loading branch information
erikdesjardins committed Jul 2, 2018
1 parent 34532db commit ba2f262
Show file tree
Hide file tree
Showing 16 changed files with 183 additions and 163 deletions.
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue
suppress_comment=\\(.\\|\n\\)*\\$FlowIgnore

[version]
0.74.0
0.75.0
6 changes: 3 additions & 3 deletions lib/modules/commandLine.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ function navigateTo(url, e) {
const commands = [];

export function registerCommand<T>(
commandPredicate: RegExp | string | (cmd: string, val: string) => false | void | T,
commandPredicate: RegExp | string | (cmd: string, val: string) => false | void | null | T,
description: string | string[] | false,
getTip: (cmd: string, val: string, predResult: T) => string | false | void | Promise<string>,
executeCommand: (cmd: string, val: string, predResult: T, e: KeyboardEvent) => string | false | void | Promise<string | void>
getTip: (cmd: string, val: string, predResult: T) => string | false | void | null | Promise<string>,
executeCommand: (cmd: string, val: string, predResult: T, e: KeyboardEvent) => string | false | void | null | Promise<string | void>
) {
commands.push({
commandPredicate,
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/hosts/flickr.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default new Host('flickr', {
const matches = (/^https?:\/\/(?:\w+\.)?staticflickr\.com\/(?:.+\/)?\d{4}\/(\d{10,})_/i).exec(href);
if (matches) {
// encode the id we extracted and use a Flickr short-url
return `https://flic.kr/p/${base58Encode(matches[1])}`;
return `https://flic.kr/p/${base58Encode(parseInt(matches[1], 10))}`;
}
};
})(),
Expand Down
12 changes: 6 additions & 6 deletions lib/modules/hosts/imgur.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ export default new Host('imgur', {
type: 'GALLERY',
title: info.title,
caption: info.description,
src: info.images.map(info => ({
...(info.gifv && !useGif ?
src: info.images.map(info => {
const media = info.gifv && !useGif ?
_handleGifv(info) :
_handleSingleImage(info)
),
href: shareLinkPreferred ? `${href.split('#')[0]}#${info.id}` : `${info.link}`,
})),
_handleSingleImage(info);
media.href = shareLinkPreferred ? `${href.split('#')[0]}#${info.id}` : `${info.link}`;
return media;
}),
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/modules/noParticipation.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.options = {
};

// np.reddit.com, np-nm.reddit.com, nm-np.reddit.com
module.shouldRun = () => (/^(?:\w+-)?np(?:-\w+)?\./i).exec(location.hostname);
module.shouldRun = () => (/^(?:\w+-)?np(?:-\w+)?\./i).test(location.hostname);

const boilerplateNotificationText = `
<p>
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/showImages.js
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ function promptSiteModulePermissions({ name, permissions = [] }) {
closeDelay: 20000,
message: `
<p>In order to inline expand content from ${name}, RES needs permission to access these sites:</p>
<p>${permissions.map(url => `<code>${urlStripRe.exec(url)[0]}</code>`).join(', ')}</p>
<p>${permissions.map(url => `<code>${(urlStripRe.exec(url): any)[0]}</code>`).join(', ')}</p>
<p>Be assured RES does not access/modify any of your information on these domains - it only accesses the public API.</p>
`,
});
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/sourceSnudown.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const viewSource = keyedMutex(async button => {
} else if (regexes.comments.test(path)) {
sourceText = response[0].data.children[0].data.selftext;
} else {
const postId = (/\/(\w*)\/?$/).exec(path)[1];
const postId: string = ((/\/(\w*)\/?$/).exec(path): any)[1];
const data = response.data.children[0].data;
if (data.id === postId) {
sourceText = data.body;
Expand Down
5 changes: 3 additions & 2 deletions lib/modules/stylesheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,9 @@ const subredditNameRegexp = /^(?:\/?r\/)?([\w_]+)\/?$/;
const urlRegexp = /^(?:https?:\/\/[\w\.]+)?\/\w+/;

const sanitizeStylesheetUrls = filterMap(([url]) => {
if (subredditNameRegexp.test(url)) {
return [`/r/${subredditNameRegexp.exec(url)[1]}/stylesheet.css`];
const subredditMatch = subredditNameRegexp.exec(url);
if (subredditMatch) {
return [`/r/${subredditMatch[1]}/stylesheet.css`];
} else if (urlRegexp.test(url)) {
return [url];
}
Expand Down
9 changes: 5 additions & 4 deletions lib/modules/submitHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ function registerCommandLine() {
if (!subreddit) {
// Use default value
} else if (url) {
return `Post ${url} to /r/${subreddit}: ${title}`;
return `Post ${url} to /r/${subreddit}: ${title || ''}`;
} else if (title) {
return `Post to /r/${subreddit}: ${title || ''}`;
return `Post to /r/${subreddit}: ${title}`;
} else if (subreddit) {
return `Post to /r/${subreddit}`;
}
Expand Down Expand Up @@ -139,9 +139,10 @@ async function updateRepostWarning() {
if (!urlField.value) return;
const stripUrlRe = /^(?:https?:\/\/)?(?:(?:www|i|m)\.)?(.+?)\/?(?:\.\w+)?(?:#[^\/]*)?$/i;
const subreddit = srField.value;
const userUrl = stripUrlRe.exec(urlField.value)[1];
const match = stripUrlRe.exec(urlField.value);

if (subreddit && userUrl) {
if (subreddit && match) {
const [, userUrl] = match;
try {
const { data } = (await ajax({
url: string.encode`/r/${subreddit}/search.json`,
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/subredditInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ module.go = () => {

function handleMouseOver(e: Event) {
const target = downcast(e.target, HTMLAnchorElement);
const match = regexes.subreddit.exec(target.pathname);
if (!match) return;

const [, subreddit] = regexes.subreddit.exec(target.pathname);
const [, subreddit] = match;

Hover.infocard(module.moduleID)
.target(target)
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/subredditManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,10 @@ function manageSubreddits() {
function browsingReddits(thing) {
const titleElement = thing.getTitleElement();
if (!titleElement) return;
const match = regexes.subreddit.exec(titleElement.pathname);
if (!match) return;

const subreddit = regexes.subreddit.exec(titleElement.pathname)[1];
const subreddit = match[1];
const $theSC = $('<span>')
.css({ 'margin-right': '0' })
.addClass('res-fancy-toggle-button')
Expand Down
2 changes: 1 addition & 1 deletion lib/modules/userInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ module.go = () => {
function handleMouseOver(e: Event) {
const authorLink = downcast(e.target, HTMLAnchorElement);
if (!UserTagger.usernameRE.test(authorLink.href)) return;
const [, username] = UserTagger.usernameRE.exec(authorLink.href);
const [, username] = UserTagger.usernameRE.exec(authorLink.href) || [];
if (!username) console.error(i18n('userInfoInvalidUsernameLink'));
const thing = Thing.from(authorLink);

Expand Down
10 changes: 8 additions & 2 deletions lib/utils/Thing.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ export class Thing {
getNumberOfChildren(): number {
const numChildrenElem = this.element.querySelector('.numchildren');
return numChildrenElem && parseInt((/(\d+)/).exec(numChildrenElem.textContent)[1], 10) || 0;
const match = numChildrenElem && (/(\d+)/).exec(numChildrenElem.textContent);
return match && parseInt(match[1], 10) || 0;
}
static _parseScore(scoreEle: HTMLElement): number {
Expand Down Expand Up @@ -307,7 +308,12 @@ export class Thing {
return data;
}
const element = this.getAuthorElement();
return element && regexes.profile.exec(element.pathname)[1];
if (element) {
const match = regexes.profile.exec(element.pathname);
if (match) {
return match[1];
}
}
}
getAuthorUrl(): string {
Expand Down
2 changes: 1 addition & 1 deletion lib/vendor/guiders.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
}

.guiders_button {
background: linear-gradient(top, #5CA9FF 0%, #3D79C3 100%);
background: linear-gradient(to bottom, #5CA9FF 0%, #3D79C3 100%);
border: solid 1px #4B5D7E;
color: #FFF;
cursor: pointer;
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
"whatwg-fetch": "2.0.4"
},
"devDependencies": {
"autoprefixer": "8.6.2",
"autoprefixer": "8.6.4",
"ava": "0.25.0",
"babel-core": "6.26.3",
"babel-eslint": "8.2.3",
"babel-eslint": "8.2.5",
"babel-loader": "7.1.4",
"babel-plugin-lodash": "3.3.4",
"babel-plugin-transform-class-properties": "6.24.1",
Expand All @@ -90,24 +90,24 @@
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-plugin-transform-object-rest-spread": "6.26.0",
"chrome-extension-deploy": "3.0.0",
"coveralls": "3.0.1",
"coveralls": "3.0.2",
"cross-env": "5.2.0",
"css-loader": "0.28.11",
"edge-extension-deploy": "1.0.1",
"eslint": "4.19.1",
"eslint-import-resolver-webpack": "0.10.0",
"eslint-import-resolver-webpack": "0.10.1",
"eslint-plugin-ava": "4.5.1",
"eslint-plugin-dollar-sign": "1.0.1",
"eslint-plugin-filenames": "1.2.0",
"eslint-plugin-flowtype": "2.48.0",
"eslint-plugin-import": "2.12.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-flowtype": "2.49.3",
"eslint-plugin-import": "2.13.0",
"eslint-plugin-no-useless-assign": "1.0.2",
"eslint-plugin-prefer-spread": "1.0.3",
"exec-loader": "4.0.0",
"extricate-loader": "3.0.0",
"file-loader": "1.1.11",
"firefox-extension-deploy": "1.1.0",
"flow-bin": "0.74.0",
"flow-bin": "0.75.0",
"html-loader": "0.5.5",
"inert-entry-webpack-plugin": "4.0.2",
"interpolate-loader": "2.0.0",
Expand All @@ -128,8 +128,8 @@
"sibling-loader": "1.2.0",
"spawn-loader": "6.0.0",
"url-loader": "1.0.1",
"webpack": "4.12.0",
"webpack-cli": "3.0.6",
"webpack": "4.14.0",
"webpack-cli": "3.0.8",
"zip-webpack-plugin": "3.0.0"
}
}
Loading

0 comments on commit ba2f262

Please sign in to comment.