schnee effeckt und fehler Korektur

This commit is contained in:
2023-08-14 17:52:24 +02:00
parent 4a843d4936
commit 79af4e9907
6813 changed files with 343821 additions and 356128 deletions

40
node_modules/is-png/readme.md generated vendored
View File

@@ -1,14 +1,12 @@
# is-png [![Build Status](https://travis-ci.org/sindresorhus/is-png.svg?branch=master)](https://travis-ci.org/sindresorhus/is-png)
> Check if a Buffer/Uint8Array is a [PNG](http://en.wikipedia.org/wiki/Portable_Network_Graphics) image
Used by [image-type](https://github.com/sindresorhus/image-type).
> Check if a Buffer/Uint8Array is a [PNG](https://en.wikipedia.org/wiki/Portable_Network_Graphics) image
## Install
```sh
$ npm install --save is-png
```
$ npm install is-png
```
@@ -17,9 +15,9 @@ $ npm install --save is-png
##### Node.js
```js
var readChunk = require('read-chunk'); // npm install read-chunk
var isPng = require('is-png');
var buffer = readChunk.sync('unicorn.png', 0, 8);
const readChunk = require('read-chunk'); // npm install read-chunk
const isPng = require('is-png');
const buffer = readChunk.sync('unicorn.png', 0, 8);
isPng(buffer);
//=> true
@@ -28,16 +26,13 @@ isPng(buffer);
##### Browser
```js
var xhr = new XMLHttpRequest();
xhr.open('GET', 'unicorn.png');
xhr.responseType = 'arraybuffer';
(async () => {
const response = await fetch('unicorn.png');
const buffer = await response.arrayBuffer();
xhr.onload = function () {
isPng(new Uint8Array(this.response));
isPng(new Uint8Array(buffer));
//=> true
};
xhr.send();
})();
```
@@ -45,11 +40,18 @@ xhr.send();
### isPng(buffer)
Accepts a Buffer (Node.js) or Uint8Array.
Accepts a Buffer (Node.js) or Uint8Array. Returns a `boolean` of whether `buffer` is a PNG image.
It only needs the first 8 bytes.
#### buffer
The buffer to check. It only needs the first 8 bytes.
## Related
- [file-type](https://github.com/sindresorhus/file-type) - Detect the file type of a Buffer/Uint8Array/ArrayBuffer
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
MIT © [Sindre Sorhus](https://sindresorhus.com)