Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

38
spa/node_modules/read-chunk/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,38 @@
/// <reference types="node"/>
declare const readChunk: {
/**
Read a chunk from a file asyncronously.
@param filePath - The path to the file.
@param startPosition - Position to start reading.
@param length - Number of bytes to read.
@returns The read chunk.
@example
```
import readChunk = require('read-chunk');
// foo.txt => hello
readChunk.sync('foo.txt', 1, 3);
//=> 'ell'
```
*/
(filePath: string, startPosition: number, length: number): Promise<Buffer>;
/**
Read a chunk from a file synchronously.
@param filePath - The path to the file.
@param startPosition - Position to start reading.
@param length - Number of bytes to read.
@returns The read chunk.
*/
sync(filePath: string, startPosition: number, length: number): Buffer;
// TODO: Remove this for the next major release
default: typeof readChunk;
};
export = readChunk;

39
spa/node_modules/read-chunk/index.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
'use strict';
const fs = require('fs');
const pify = require('pify');
const withOpenFile = require('with-open-file');
const fsReadP = pify(fs.read, {multiArgs: true});
const readChunk = (filePath, startPosition, length) => {
const buffer = Buffer.alloc(length);
return withOpenFile(filePath, 'r', fileDescriptor =>
fsReadP(fileDescriptor, buffer, 0, length, startPosition)
)
.then(([bytesRead, buffer]) => {
if (bytesRead < length) {
buffer = buffer.slice(0, bytesRead);
}
return buffer;
});
};
module.exports = readChunk;
// TODO: Remove this for the next major release
module.exports.default = readChunk;
module.exports.sync = (filePath, startPosition, length) => {
let buffer = Buffer.alloc(length);
const bytesRead = withOpenFile.sync(filePath, 'r', fileDescriptor =>
fs.readSync(fileDescriptor, buffer, 0, length, startPosition)
);
if (bytesRead < length) {
buffer = buffer.slice(0, bytesRead);
}
return buffer;
};

9
spa/node_modules/read-chunk/license generated vendored Normal file
View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

47
spa/node_modules/read-chunk/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "read-chunk",
"version": "3.2.0",
"description": "Read a chunk from a file",
"license": "MIT",
"repository": "sindresorhus/read-chunk",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=6"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"read",
"file",
"readfile",
"fs",
"chunk",
"slice",
"part",
"head",
"tail",
"buffer",
"fd",
"open"
],
"dependencies": {
"pify": "^4.0.1",
"with-open-file": "^0.1.6"
},
"devDependencies": {
"@types/node": "^11.12.2",
"ava": "^1.4.1",
"sinon": "^7.3.1",
"tsd": "^0.7.1",
"xo": "^0.24.0"
}
}

56
spa/node_modules/read-chunk/readme.md generated vendored Normal file
View File

@@ -0,0 +1,56 @@
# read-chunk [![Build Status](https://travis-ci.org/sindresorhus/read-chunk.svg?branch=master)](https://travis-ci.org/sindresorhus/read-chunk)
> Read a chunk from a file
Because the built-in way requires way too much boilerplate.
## Install
```
$ npm install read-chunk
```
## Usage
```js
const readChunk = require('read-chunk');
// foo.txt => hello
readChunk.sync('foo.txt', 1, 3);
//=> 'ell'
```
## API
### readChunk(filePath, startPosition, length)
Returns a `Promise<Buffer>` with the read chunk.
### readChunk.sync(filePath, startPosition, length)
Returns a `Buffer` with the read chunk.
#### filePath
Type: `string`
#### startPosition
Type: `number`
Position to start reading.
#### length
Type: `number`
Number of bytes to read.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)