Update gitignore (sorry)

This commit is contained in:
olcxja 2026-05-10 14:02:17 +02:00
commit cca8b02fea
6604 changed files with 1219661 additions and 4 deletions

46
electron/node_modules/dir-compare/src/fs/BufferPool.js generated vendored Normal file
View file

@ -0,0 +1,46 @@
/**
* Collection of buffers to be shared between async processes.
* Avoids allocating buffers each time async process starts.
* bufSize - size of each buffer
* bufNo - number of buffers
* Caller has to make sure no more than bufNo async processes run simultaneously.
*/
function BufferPool(bufSize, bufNo) {
var bufferPool = []
for (var i = 0; i < bufNo; i++) {
bufferPool.push({
buf1: alloc(bufSize),
buf2: alloc(bufSize),
busy: false
})
}
var allocateBuffers = function () {
for (var j = 0; j < bufNo; j++) {
var bufferPair = bufferPool[j]
if (!bufferPair.busy) {
bufferPair.busy = true
return bufferPair
}
}
throw new Error('Async buffer limit reached')
}
return {
allocateBuffers: allocateBuffers,
freeBuffers: freeBuffers
}
function freeBuffers(bufferPair) {
bufferPair.busy = false
}
}
function alloc(bufSize) {
if (Buffer.alloc) {
return Buffer.alloc(bufSize)
}
return new Buffer(bufSize)
}
module.exports = BufferPool

View file

@ -0,0 +1,78 @@
'use strict'
var fs = require('fs')
var Queue = require('./Queue')
/**
* Limits the number of concurrent file handlers.
* Use it as a wrapper over fs.open() and fs.close().
* Example:
* var fdQueue = new FileDescriptorQueue(8)
* fdQueue.open(path, flags, (err, fd) =>{
* ...
* fdQueue.close(fd, (err) =>{
* ...
* })
* })
* As of node v7, calling fd.close without a callback is deprecated.
*/
var FileDescriptorQueue = function (maxFilesNo) {
var pendingJobs = new Queue()
var activeCount = 0
var open = function (path, flags, callback) {
pendingJobs.enqueue({
path: path,
flags: flags,
callback: callback
})
process()
}
var process = function () {
if (pendingJobs.getLength() > 0 && activeCount < maxFilesNo) {
var job = pendingJobs.dequeue()
activeCount++
fs.open(job.path, job.flags, job.callback)
}
}
var close = function (fd, callback) {
activeCount--
fs.close(fd, callback)
process()
}
var promises = {
open: function (path, flags) {
return new Promise(function (resolve, reject) {
open(path, flags, function (err, fd) {
if (err) {
reject(err)
} else {
resolve(fd)
}
})
})
},
close: function (fd) {
return new Promise(function (resolve, reject) {
close(fd, function (err) {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
}
return {
open: open,
close: close,
promises: promises
}
}
module.exports = FileDescriptorQueue

63
electron/node_modules/dir-compare/src/fs/Queue.js generated vendored Normal file
View file

@ -0,0 +1,63 @@
/*
Queue.js
A function to represent a queue
Created by Kate Morley - http://code.iamkate.com/ - and released under the terms
of the CC0 1.0 Universal legal code:
http://creativecommons.org/publicdomain/zero/1.0/legalcode
*/
var MAX_UNUSED_ARRAY_SIZE = 10000
/* Creates a new queue. A queue is a first-in-first-out (FIFO) data structure -
* items are added to the end of the queue and removed from the front.
*/
function Queue() {
// initialise the queue and offset
var queue = []
var offset = 0
// Returns the length of the queue.
this.getLength = function () {
return (queue.length - offset)
}
/* Enqueues the specified item. The parameter is:
*
* item - the item to enqueue
*/
this.enqueue = function (item) {
queue.push(item)
}
/* Dequeues an item and returns it. If the queue is empty, the value
* 'undefined' is returned.
*/
this.dequeue = function () {
// if the queue is empty, return immediately
if (queue.length === 0) {
return undefined
}
// store the item at the front of the queue
var item = queue[offset]
// increment the offset and remove the free space if necessary
if (++offset > MAX_UNUSED_ARRAY_SIZE) {
queue = queue.slice(offset)
offset = 0
}
// return the dequeued item
return item
}
}
module.exports = Queue

26
electron/node_modules/dir-compare/src/fs/fsPromise.js generated vendored Normal file
View file

@ -0,0 +1,26 @@
var fs = require('fs')
module.exports = {
readdir: function (path) {
return new Promise(function (resolve, reject) {
fs.readdir(path, function (err, files) {
if (err) {
reject(err)
} else {
resolve(files)
}
})
})
},
read: function (fd, buffer, offset, length, position) {
return new Promise(function (resolve, reject) {
fs.read(fd, buffer, offset, length, position, function(err, bytesRead) {
if(err){
reject(err)
} else {
resolve(bytesRead)
}
})
})
},
}