Tons of Solutions Engineering work done today for the rest of the CS team! Headway, Howard Hanna, Engels, Brighton, etc. Also completed Datasnippers auth flow and worked on Anthology's script. Cloned Anthology's courses (900..) and will clone Full Story on Monday.
This commit is contained in:
22
Scripts/node_modules/data-uri-to-buffer/LICENSE
generated
vendored
Normal file
22
Scripts/node_modules/data-uri-to-buffer/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
|
||||
|
||||
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.
|
||||
61
Scripts/node_modules/data-uri-to-buffer/README.md
generated
vendored
Normal file
61
Scripts/node_modules/data-uri-to-buffer/README.md
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
data-uri-to-buffer
|
||||
==================
|
||||
### Create an ArrayBuffer instance from a [Data URI][rfc] string
|
||||
|
||||
This module accepts a ["data" URI][rfc] String of data, and returns
|
||||
an `ArrayBuffer` instance with the decoded data.
|
||||
|
||||
This module is intended to work on a large variety of JavaScript
|
||||
runtimes, including Node.js and web browsers.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
```typescript
|
||||
import { dataUriToBuffer } from 'data-uri-to-buffer';
|
||||
|
||||
// plain-text data is supported
|
||||
let uri = 'data:,Hello%2C%20World!';
|
||||
let parsed = dataUriToBuffer(uri);
|
||||
console.log(new TextDecoder().decode(parsed.buffer));
|
||||
// 'Hello, World!'
|
||||
|
||||
// base64-encoded data is supported
|
||||
uri = 'data:text/plain;base64,SGVsbG8sIFdvcmxkIQ%3D%3D';
|
||||
parsed = dataUriToBuffer(uri);
|
||||
console.log(new TextDecoder().decode(parsed.buffer));
|
||||
// 'Hello, World!'
|
||||
```
|
||||
|
||||
|
||||
API
|
||||
---
|
||||
|
||||
```typescript
|
||||
export interface ParsedDataURI {
|
||||
type: string;
|
||||
typeFull: string;
|
||||
charset: string;
|
||||
buffer: ArrayBuffer;
|
||||
}
|
||||
```
|
||||
|
||||
### dataUriToBuffer(uri: string | URL) → ParsedDataURI
|
||||
|
||||
The `type` property gets set to the main type portion of
|
||||
the "mediatype" portion of the "data" URI, or defaults to `"text/plain"` if not
|
||||
specified.
|
||||
|
||||
The `typeFull` property gets set to the entire
|
||||
"mediatype" portion of the "data" URI (including all parameters), or defaults
|
||||
to `"text/plain;charset=US-ASCII"` if not specified.
|
||||
|
||||
The `charset` property gets set to the Charset portion of
|
||||
the "mediatype" portion of the "data" URI, or defaults to `"US-ASCII"` if the
|
||||
entire type is not specified, or defaults to `""` otherwise.
|
||||
|
||||
*Note*: If only the main type is specified but not the charset, e.g.
|
||||
`"data:text/plain,abc"`, the charset is set to the empty string. The spec only
|
||||
defaults to US-ASCII as charset if the entire type is not specified.
|
||||
|
||||
[rfc]: http://tools.ietf.org/html/rfc2397
|
||||
13
Scripts/node_modules/data-uri-to-buffer/dist/index.d.ts
generated
vendored
Normal file
13
Scripts/node_modules/data-uri-to-buffer/dist/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
export interface ParsedDataURI {
|
||||
type: string;
|
||||
typeFull: string;
|
||||
charset: string;
|
||||
buffer: ArrayBuffer;
|
||||
}
|
||||
/**
|
||||
* Returns a `Buffer` instance from the given data URI `uri`.
|
||||
*
|
||||
* @param {String} uri Data URI to turn into a Buffer instance
|
||||
*/
|
||||
export declare function dataUriToBuffer(uri: string | URL): ParsedDataURI;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
Scripts/node_modules/data-uri-to-buffer/dist/index.d.ts.map
generated
vendored
Normal file
1
Scripts/node_modules/data-uri-to-buffer/dist/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,WAAW,CAAC;CACpB;AAkDD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,aAAa,CAmDhE"}
|
||||
91
Scripts/node_modules/data-uri-to-buffer/dist/index.js
generated
vendored
Normal file
91
Scripts/node_modules/data-uri-to-buffer/dist/index.js
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.dataUriToBuffer = void 0;
|
||||
function base64ToArrayBuffer(base64) {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
const bytes = [];
|
||||
for (let i = 0; i < base64.length; i += 4) {
|
||||
const idx0 = chars.indexOf(base64.charAt(i));
|
||||
const idx1 = chars.indexOf(base64.charAt(i + 1));
|
||||
const idx2 = base64.charAt(i + 2) === '='
|
||||
? 0
|
||||
: chars.indexOf(base64.charAt(i + 2));
|
||||
const idx3 = base64.charAt(i + 3) === '='
|
||||
? 0
|
||||
: chars.indexOf(base64.charAt(i + 3));
|
||||
const bin0 = (idx0 << 2) | (idx1 >> 4);
|
||||
const bin1 = ((idx1 & 15) << 4) | (idx2 >> 2);
|
||||
const bin2 = ((idx2 & 3) << 6) | idx3;
|
||||
bytes.push(bin0);
|
||||
if (base64.charAt(i + 2) !== '=')
|
||||
bytes.push(bin1);
|
||||
if (base64.charAt(i + 3) !== '=')
|
||||
bytes.push(bin2);
|
||||
}
|
||||
const buffer = new ArrayBuffer(bytes.length);
|
||||
const view = new Uint8Array(buffer);
|
||||
view.set(bytes);
|
||||
return buffer;
|
||||
}
|
||||
function stringToBuffer(str) {
|
||||
// Create a buffer with length equal to the string length
|
||||
const buffer = new ArrayBuffer(str.length);
|
||||
// Create a view to manipulate the buffer content
|
||||
const view = new Uint8Array(buffer);
|
||||
// Iterate over the string and populate the buffer with ASCII codes
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
view[i] = str.charCodeAt(i);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
/**
|
||||
* Returns a `Buffer` instance from the given data URI `uri`.
|
||||
*
|
||||
* @param {String} uri Data URI to turn into a Buffer instance
|
||||
*/
|
||||
function dataUriToBuffer(uri) {
|
||||
uri = String(uri);
|
||||
if (!/^data:/i.test(uri)) {
|
||||
throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');
|
||||
}
|
||||
// strip newlines
|
||||
uri = uri.replace(/\r?\n/g, '');
|
||||
// split the URI up into the "metadata" and the "data" portions
|
||||
const firstComma = uri.indexOf(',');
|
||||
if (firstComma === -1 || firstComma <= 4) {
|
||||
throw new TypeError('malformed data: URI');
|
||||
}
|
||||
// remove the "data:" scheme and parse the metadata
|
||||
const meta = uri.substring(5, firstComma).split(';');
|
||||
let charset = '';
|
||||
let base64 = false;
|
||||
const type = meta[0] || 'text/plain';
|
||||
let typeFull = type;
|
||||
for (let i = 1; i < meta.length; i++) {
|
||||
if (meta[i] === 'base64') {
|
||||
base64 = true;
|
||||
}
|
||||
else if (meta[i]) {
|
||||
typeFull += `;${meta[i]}`;
|
||||
if (meta[i].indexOf('charset=') === 0) {
|
||||
charset = meta[i].substring(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
// defaults to US-ASCII only if type is not provided
|
||||
if (!meta[0] && !charset.length) {
|
||||
typeFull += ';charset=US-ASCII';
|
||||
charset = 'US-ASCII';
|
||||
}
|
||||
// get the encoded data portion and decode URI-encoded chars
|
||||
const data = unescape(uri.substring(firstComma + 1));
|
||||
const buffer = base64 ? base64ToArrayBuffer(data) : stringToBuffer(data);
|
||||
return {
|
||||
type,
|
||||
typeFull,
|
||||
charset,
|
||||
buffer,
|
||||
};
|
||||
}
|
||||
exports.dataUriToBuffer = dataUriToBuffer;
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
Scripts/node_modules/data-uri-to-buffer/dist/index.js.map
generated
vendored
Normal file
1
Scripts/node_modules/data-uri-to-buffer/dist/index.js.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAOA,SAAS,mBAAmB,CAAC,MAAc;IAC1C,MAAM,KAAK,GACV,kEAAkE,CAAC;IAEpE,MAAM,KAAK,GAAG,EAAE,CAAC;IAEjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QAC1C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM,IAAI,GACT,MAAM,CAAC,MAAM,CA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,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACrC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,QAAQ,EAAE;YACzB,MAAM,GAAG,IAAI,CAAC;SACd;aAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE;YACnB,QAAQ,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1B,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;gBACtC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aAC/B;SACD;KACD;IACD,oDAAoD;IACpD,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;QAChC,QAAQ,IAAI,mBAAmB,CAAC;QAChC,OAAO,GAAG,UAAU,CAAC;KACrB;IAED,4DAA4D;IAC5D,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAEzE,OAAO;QACN,IAAI;QACJ,QAAQ;QACR,OAAO;QACP,MAAM;KACN,CAAC;AACH,CAAC;AAnDD,0CAmDC"}
|
||||
44
Scripts/node_modules/data-uri-to-buffer/package.json
generated
vendored
Normal file
44
Scripts/node_modules/data-uri-to-buffer/package.json
generated
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "data-uri-to-buffer",
|
||||
"version": "6.0.1",
|
||||
"description": "Create an ArrayBuffer instance from a Data URI string",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/TooTallNate/proxy-agents.git",
|
||||
"directory": "packages/data-uri-to-buffer"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14"
|
||||
},
|
||||
"keywords": [
|
||||
"data",
|
||||
"uri",
|
||||
"datauri",
|
||||
"data-uri",
|
||||
"buffer",
|
||||
"convert",
|
||||
"rfc2397",
|
||||
"2397"
|
||||
],
|
||||
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node": "^14.18.45",
|
||||
"jest": "^29.5.0",
|
||||
"ts-jest": "^29.1.0",
|
||||
"typescript": "^5.0.4",
|
||||
"tsconfig": "0.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"test": "jest --env node --verbose --bail",
|
||||
"lint": "eslint . --ext .ts",
|
||||
"pack": "node ../../scripts/pack.mjs"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user