Skip to content

Commit

Permalink
Update Electron to 31.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rezbyte committed Aug 7, 2024
1 parent 26dfa0f commit 016286b
Show file tree
Hide file tree
Showing 3 changed files with 217 additions and 203 deletions.
114 changes: 61 additions & 53 deletions libs/electron-updater.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -726,14 +726,16 @@ function requireBrowser () {
return false;
}

let m;

// Is webkit? http://stackoverflow.com/a/16459606/376773
// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
// Is firebug? http://stackoverflow.com/a/398120/376773
(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
// Is firefox >= v31?
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
// Double check webkit in userAgent just in case we are in a worker
(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}
Expand Down Expand Up @@ -11569,61 +11571,55 @@ const coerce$1 = (version, options) => {
};
var coerce_1 = coerce$1;

var lrucache;
var hasRequiredLrucache;

function requireLrucache () {
if (hasRequiredLrucache) return lrucache;
hasRequiredLrucache = 1;
class LRUCache {
constructor () {
this.max = 1000;
this.map = new Map();
}

get (key) {
const value = this.map.get(key);
if (value === undefined) {
return undefined
} else {
// Remove the key from the map and add it to the end
this.map.delete(key);
this.map.set(key, value);
return value
}
}
class LRUCache {
constructor () {
this.max = 1000;
this.map = new Map();
}

delete (key) {
return this.map.delete(key)
}
get (key) {
const value = this.map.get(key);
if (value === undefined) {
return undefined
} else {
// Remove the key from the map and add it to the end
this.map.delete(key);
this.map.set(key, value);
return value
}
}

set (key, value) {
const deleted = this.delete(key);
delete (key) {
return this.map.delete(key)
}

if (!deleted && value !== undefined) {
// If cache is full, delete the least recently used item
if (this.map.size >= this.max) {
const firstKey = this.map.keys().next().value;
this.delete(firstKey);
}
set (key, value) {
const deleted = this.delete(key);

this.map.set(key, value);
}
if (!deleted && value !== undefined) {
// If cache is full, delete the least recently used item
if (this.map.size >= this.max) {
const firstKey = this.map.keys().next().value;
this.delete(firstKey);
}

return this
}
}
this.map.set(key, value);
}

lrucache = LRUCache;
return lrucache;
return this
}
}

var lrucache = LRUCache;

var range;
var hasRequiredRange;

function requireRange () {
if (hasRequiredRange) return range;
hasRequiredRange = 1;
const SPACE_CHARACTERS = /\s+/g;

// hoisted class for cyclic dependency
class Range {
constructor (range, options) {
Expand All @@ -11644,7 +11640,7 @@ function requireRange () {
// just put it in the set and return
this.raw = range.value;
this.set = [[range]];
this.format();
this.formatted = undefined;
return this
}

Expand All @@ -11655,10 +11651,7 @@ function requireRange () {
// First reduce all whitespace as much as possible so we do not have to rely
// on potentially slow regexes like \s*. This is then stored and used for
// future error messages as well.
this.raw = range
.trim()
.split(/\s+/)
.join(' ');
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ');

// First, split on ||
this.set = this.raw
Expand Down Expand Up @@ -11692,14 +11685,29 @@ function requireRange () {
}
}

this.format();
this.formatted = undefined;
}

get range () {
if (this.formatted === undefined) {
this.formatted = '';
for (let i = 0; i < this.set.length; i++) {
if (i > 0) {
this.formatted += '||';
}
const comps = this.set[i];
for (let k = 0; k < comps.length; k++) {
if (k > 0) {
this.formatted += ' ';
}
this.formatted += comps[k].toString().trim();
}
}
}
return this.formatted
}

format () {
this.range = this.set
.map((comps) => comps.join(' ').trim())
.join('||')
.trim();
return this.range
}

Expand Down Expand Up @@ -11824,7 +11832,7 @@ function requireRange () {

range = Range;

const LRU = requireLrucache();
const LRU = lrucache;
const cache = new LRU();

const parseOptions = parseOptions_1;
Expand Down
Loading

0 comments on commit 016286b

Please sign in to comment.