node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

27
server/node_modules/outdent/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,27 @@
## v0.7.2
* Update README
* Publish to [deno.land/x](https://deno.land/x/outdent)
## v0.7.1
* Fix typo in README
## v0.7.0
* Improve internal caching. outdent will avoid re-computing indentation removal in more situations.
* Add `newline` option for normalizing newlines in template literals.
## v0.6.0
* Adds missing tsconfig files to npm packages. These will be picked up if / when someone steps their debugger into `outdent`'s source.
* Enable declarationMap: "Go to declaration" should jump to the appropriate source code location.
* Fixes webpack bundling support.
## 0.5.0
* Adds `string` method for removing indentation from plain strings (thanks @treshugart [#8](https://github.com/cspotcode/outdent/pull/8))
---
I didn't maintain a changelog before this point, sorry!

21
server/node_modules/outdent/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Andrew Bradley
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.

234
server/node_modules/outdent/README.md generated vendored Normal file
View File

@@ -0,0 +1,234 @@
# outdent
## Removes leading indentation from ES6 template strings
[![BuildStatus](https://github.com/cspotcode/outdent/workflows/Tests/badge.svg)](https://github.com/cspotcode/outdent/actions?query=Tests)
[![typings included](https://img.shields.io/badge/typings-included-brightgreen.svg)](#typescript-declarations)
ES6 template strings are great, but they preserve everything between the backticks, including leading spaces.
Sometimes I want to indent my template literals to make my code more readable without including all those spaces in the
string.
Outdent will remove those leading spaces, as well as the leading and trailing newlines.
### Usage
Import **outdent** using your module system of choice.
```typescript
// Deno
import outdent from 'http://deno.land/x/outdent/mod.ts';
// ECMAScript modules
import outdent from 'outdent';
// CommonJS
const outdent = require('outdent');
```
#### Examples
```typescript
import outdent from 'outdent';
const markdown = outdent`
# My Markdown File
Here is some indented code:
console.log("hello world!");
`;
console.log(markdown);
fs.writeFileSync('output.md', markdown);
```
The contents of `output.md` do not have the leading indentation:
```markdown
# My Markdown File
Here is some indented code:
console.log("hello world!");
```
As a JavaScript string:
```typescript
var markdown = '# My Markdown File\n' +
'\n' +
'Here is some indented code:\n' +
'\n' +
' console.log("hello world!");';
```
You can pass options to **outdent** to control its behavior. They are explained in [Options](#options).
```typescript
const output = outdent({trimLeadingNewline: false, trimTrailingNewline: false})`
Hello world!
`;
assert(output === '\nHello world!\n');
```
You can explicitly specify the indentation level by passing `outdent` as the first interpolated value. Its position sets the indentation level and it is removed from the output:
```typescript
const output = outdent`
${outdent}
Yo
12345
Hello world
`;
assert(output === ' Yo\n345\n Hello world');
```
*Note: `${outdent}` must be alone on its own line without anything before or after it. It cannot be preceded by any non-whitespace characters.*
*If these conditions are not met, outdent will follow normal indentation-detection behavior.*
Outdent can also remove indentation from plain strings via the `string` method.
```typescript
const output = outdent.string('\n Hello world!\n');
assert(output === 'Hello world!');
```
### Options
#### `trimLeadingNewline`
*Default: true*
#### `trimTrailingNewline`
*Default: true*
Whether or not outdent should remove the leading and/or trailing newline from your template string. For example:
```typescript
var s = outdent({trimLeadingNewline: false})`
Hello
`;
assert(s === '\nHello');
s = outdent({trimTrailingNewline: false})`
Hello
`
assert(s === 'Hello\n');
s = outdent({trimLeadingNewline: false, trimTrailingNewline: false})`
`;
assert(s === '\n\n');
```
#### `newline`
*Default: null*
If set to a string, normalize all newlines in the template literal to this value.
If `null`, newlines are left untouched.
```
s = outdent({newline: '\r\n'}) `
first
second
`;
assert(s === 'first\r\nsecond');
```
Newlines that get normalized are '\r\n', '\r', and '\n'.
Newlines within interpolated values are *never* normalized.
Although intended for normalizing to '\r\n',
you can use any string, for example a space.
```typescript
const s = outdent({newline: ' '}) `
Hello
world!
`;
assert(s === 'Hello world!');
```
<!--
#### `pass`
Returns an arguments array that can be passed to another tagging function, instead of returning a string.
For example, say you want to use outdent with the following code:
```typescript
function query(barVal) {
return prepareSql`
SELECT * from foo where bar = ${barVal}
`;
}
```
`prepareSql` is expecting to receive a strings array and all interpolated values so that it can create a safe SQL
query. To add outdent into the mix, we
must set `pass: true` and splat the result into `prepareSql`.
```typescript
var odRaw = outdent({pass: true});
function query(barVal) {
return prepareSql(...odRaw`
SELECT * from foo where bar = ${barVal}
`)
}
```
*This is a contrived example because SQL servers don't care about indentation. But perhaps the result is
being logged and looks better without indentation? Perhaps you're doing something totally different with tagged
template strings? Regardless, the `pass` option is here in case you need it. :-)*
-->
### Gotchas
#### Start on a new line
Start the contents of your template string on a new line *after* the opening backtick. Otherwise, outdent
has no choice but to detect indentation from the *second* line, which does not work in all situations.
```typescript
// Bad
const output = outdent `* item 1
* sub-item
`;
// output === '* item 1\n* sub-item'; Indentation of sub-item is lost
// Good
const output = outdent `
* item 1
* sub-item
`;
```
#### Spaces and tabs
Spaces and tabs are treated identically. **outdent** does not verify that you are using spaces or tabs consistently; they
are all treated as a single character for the purpose of removing indentation. Spaces, tabs, and smart tabs should
all work correctly provided you use them consistently.
### TypeScript declarations
This module includes TypeScript type declarations so you will get code completion and error-checking without installing anything else.
<!--
### TODOs
[ ] Support tabs and/or smart tabs (verify they're being used correctly? Throw an error if not?)
-->
### Questions or Bugs?
File an issue on Github: https://github.com/cspotcode/outdent/issues

172
server/node_modules/outdent/lib-module/index.js generated vendored Normal file
View File

@@ -0,0 +1,172 @@
// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.
function noop() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
}
function createWeakMap() {
if (typeof WeakMap !== "undefined") {
return new WeakMap();
}
else {
return fakeSetOrMap();
}
}
/**
* Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.
*/
function fakeSetOrMap() {
return {
add: noop,
delete: noop,
get: noop,
set: noop,
has: function (k) {
return false;
},
};
}
// Safe hasOwnProperty
var hop = Object.prototype.hasOwnProperty;
var has = function (obj, prop) {
return hop.call(obj, prop);
};
// Copy all own enumerable properties from source to target
function extend(target, source) {
for (var prop in source) {
if (has(source, prop)) {
target[prop] = source[prop];
}
}
return target;
}
var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
// If first interpolated value is a reference to outdent,
// determine indentation level from the indentation of the interpolated value.
var indentationLevel = 0;
var match = strings[0].match(reDetectIndentation);
if (match) {
indentationLevel = match[1].length;
}
var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
var reMatchIndent = new RegExp(reSource, "g");
if (firstInterpolatedValueSetsIndentationLevel) {
strings = strings.slice(1);
}
var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
var normalizeNewlines = typeof newline === "string";
var l = strings.length;
var outdentedStrings = strings.map(function (v, i) {
// Remove leading indentation from all lines
v = v.replace(reMatchIndent, "$1");
// Trim a leading newline from the first string
if (i === 0 && trimLeadingNewline) {
v = v.replace(reLeadingNewline, "");
}
// Trim a trailing newline from the last string
if (i === l - 1 && trimTrailingNewline) {
v = v.replace(reTrailingNewline, "");
}
// Normalize newlines
if (normalizeNewlines) {
v = v.replace(/\r\n|\n|\r/g, function (_) { return newline; });
}
return v;
});
return outdentedStrings;
}
function concatStringsAndValues(strings, values) {
var ret = "";
for (var i = 0, l = strings.length; i < l; i++) {
ret += strings[i];
if (i < l - 1) {
ret += values[i];
}
}
return ret;
}
function isTemplateStringsArray(v) {
return has(v, "raw") && has(v, "length");
}
/**
* It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to
* makeInstance
* @param options
* @return {outdent}
*/
function createInstance(options) {
/** Cache of pre-processed template literal arrays */
var arrayAutoIndentCache = createWeakMap();
/**
* Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,
* before interpolated values are injected.
*/
var arrayFirstInterpSetsIndentCache = createWeakMap();
function outdent(stringsOrOptions) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
/* tslint:enable:no-shadowed-variable */
if (isTemplateStringsArray(stringsOrOptions)) {
var strings = stringsOrOptions;
// Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?
var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) &&
reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) &&
reStartsWithNewlineOrIsEmpty.test(strings[1]);
// Perform outdentation
var cache = firstInterpolatedValueSetsIndentationLevel
? arrayFirstInterpSetsIndentCache
: arrayAutoIndentCache;
var renderedArray = cache.get(strings);
if (!renderedArray) {
renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
cache.set(strings, renderedArray);
}
/** If no interpolated values, skip concatenation step */
if (values.length === 0) {
return renderedArray[0];
}
/** Concatenate string literals with interpolated values */
var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
return rendered;
}
else {
// Create and return a new instance of outdent with the given options
return createInstance(extend(extend({}, options), stringsOrOptions || {}));
}
}
var fullOutdent = extend(outdent, {
string: function (str) {
return _outdentArray([str], false, options)[0];
},
});
return fullOutdent;
}
var defaultOutdent = createInstance({
trimLeadingNewline: true,
trimTrailingNewline: true,
});
// Named exports. Simple and preferred.
// import outdent from 'outdent';
export default defaultOutdent;
// import {outdent} from 'outdent';
export { defaultOutdent as outdent };
if (typeof module !== "undefined") {
// In webpack harmony-modules environments, module.exports is read-only,
// so we fail gracefully.
try {
module.exports = defaultOutdent;
Object.defineProperty(defaultOutdent, "__esModule", { value: true });
defaultOutdent.default = defaultOutdent;
defaultOutdent.outdent = defaultOutdent;
}
catch (e) { }
}
//# sourceMappingURL=index.js.map

1
server/node_modules/outdent/lib-module/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,SAAS,IAAI;IAAC,cAAmB;SAAnB,UAAmB,EAAnB,qBAAmB,EAAnB,IAAmB;QAAnB,yBAAmB;;AAAG,CAAC;AACrC,SAAS,aAAa;IACpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,OAAO,IAAI,OAAO,EAAQ,CAAC;KAC5B;SAAM;QACL,OAAO,YAAY,EAAQ,CAAC;KAC7B;AACH,CAAC;AAUD;;GAEG;AACH,SAAS,YAAY;IACnB,OAAO;QACL,GAAG,EAAE,IAAyB;QAC9B,MAAM,EAAE,IAA+B;QACvC,GAAG,EAAE,IAA4B;QACjC,GAAG,EAAE,IAA4B;QACjC,GAAG,EAAH,UAAI,CAAI;YACN,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AAED,sBAAsB;AACtB,IAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC5C,IAAM,GAAG,GA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3D,IAAM,QAAQ,GAAG,sBAAsB,CACrC,aAAa,EACb,0CAA0C,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CACtE,CAAC;YAEF,OAAO,QAAQ,CAAC;SACjB;aAAM;YACL,qEAAqE;YACrE,OAAO,cAAc,CACnB,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,IAAI,EAAE,CAAC,CACpD,CAAC;SACH;IACH,CAAC;IAED,IAAM,WAAW,GAAG,MAAM,CAAC,OAAO,EAAE;QAClC,MAAM,EAAN,UAAO,GAAW;YAChB,OAAO,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,IAAM,cAAc,GAAG,cAAc,CAAC;IACpC,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AAyCH,wCAAwC;AACxC,iCAAiC;AACjC,eAAe,cAAc,CAAC;AAC9B,mCAAmC;AACnC,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC;AAMrC,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,wEAAwE;IACxE,yBAAyB;IACzB,IAAI;QACF,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,cAAsB,CAAC,OAAO,GAAG,cAAc,CAAC;QAChD,cAAsB,CAAC,OAAO,GAAG,cAAc,CAAC;KAClD;IAAC,OAAO,CAAC,EAAE,GAAE;CACf"}

35
server/node_modules/outdent/lib/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,35 @@
declare const defaultOutdent: Outdent;
export interface Outdent {
/**
* Remove indentation from a template literal.
*/
(strings: TemplateStringsArray, ...values: Array<any>): string;
/**
* Create and return a new Outdent instance with the given options.
*/
(options: Options): Outdent;
/**
* Remove indentation from a string
*/
string(str: string): string;
}
export interface Options {
trimLeadingNewline?: boolean;
trimTrailingNewline?: boolean;
/**
* Normalize all newlines in the template literal to this value.
*
* If `null`, newlines are left untouched.
*
* Newlines that get normalized are '\r\n', '\r', and '\n'.
*
* Newlines within interpolated values are *never* normalized.
*
* Although intended for normalizing to '\n' or '\r\n',
* you can also set to any string; for example ' '.
*/
newline?: string | null;
}
export default defaultOutdent;
export { defaultOutdent as outdent };
//# sourceMappingURL=index.d.ts.map

1
server/node_modules/outdent/lib/index.d.ts.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA0MA,QAAA,MAAM,cAAc,SAGlB,CAAC;AAEH,MAAM,WAAW,OAAO;IACtB;;SAEK;IACL,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IAC/D;;SAEK;IACL,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;IAE5B;;SAEK;IACL,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CAO7B;AACD,MAAM,WAAW,OAAO;IACtB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;;;;;;;;SAWK;IACL,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAID,eAAe,cAAc,CAAC;AAE9B,OAAO,EAAE,cAAc,IAAI,OAAO,EAAE,CAAC"}

174
server/node_modules/outdent/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,174 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.outdent = void 0;
// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.
function noop() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
}
function createWeakMap() {
if (typeof WeakMap !== "undefined") {
return new WeakMap();
}
else {
return fakeSetOrMap();
}
}
/**
* Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.
*/
function fakeSetOrMap() {
return {
add: noop,
delete: noop,
get: noop,
set: noop,
has: function (k) {
return false;
},
};
}
// Safe hasOwnProperty
var hop = Object.prototype.hasOwnProperty;
var has = function (obj, prop) {
return hop.call(obj, prop);
};
// Copy all own enumerable properties from source to target
function extend(target, source) {
for (var prop in source) {
if (has(source, prop)) {
target[prop] = source[prop];
}
}
return target;
}
var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options) {
// If first interpolated value is a reference to outdent,
// determine indentation level from the indentation of the interpolated value.
var indentationLevel = 0;
var match = strings[0].match(reDetectIndentation);
if (match) {
indentationLevel = match[1].length;
}
var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
var reMatchIndent = new RegExp(reSource, "g");
if (firstInterpolatedValueSetsIndentationLevel) {
strings = strings.slice(1);
}
var newline = options.newline, trimLeadingNewline = options.trimLeadingNewline, trimTrailingNewline = options.trimTrailingNewline;
var normalizeNewlines = typeof newline === "string";
var l = strings.length;
var outdentedStrings = strings.map(function (v, i) {
// Remove leading indentation from all lines
v = v.replace(reMatchIndent, "$1");
// Trim a leading newline from the first string
if (i === 0 && trimLeadingNewline) {
v = v.replace(reLeadingNewline, "");
}
// Trim a trailing newline from the last string
if (i === l - 1 && trimTrailingNewline) {
v = v.replace(reTrailingNewline, "");
}
// Normalize newlines
if (normalizeNewlines) {
v = v.replace(/\r\n|\n|\r/g, function (_) { return newline; });
}
return v;
});
return outdentedStrings;
}
function concatStringsAndValues(strings, values) {
var ret = "";
for (var i = 0, l = strings.length; i < l; i++) {
ret += strings[i];
if (i < l - 1) {
ret += values[i];
}
}
return ret;
}
function isTemplateStringsArray(v) {
return has(v, "raw") && has(v, "length");
}
/**
* It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to
* makeInstance
* @param options
* @return {outdent}
*/
function createInstance(options) {
/** Cache of pre-processed template literal arrays */
var arrayAutoIndentCache = createWeakMap();
/**
* Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,
* before interpolated values are injected.
*/
var arrayFirstInterpSetsIndentCache = createWeakMap();
function outdent(stringsOrOptions) {
var values = [];
for (var _i = 1; _i < arguments.length; _i++) {
values[_i - 1] = arguments[_i];
}
/* tslint:enable:no-shadowed-variable */
if (isTemplateStringsArray(stringsOrOptions)) {
var strings = stringsOrOptions;
// Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?
var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) &&
reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) &&
reStartsWithNewlineOrIsEmpty.test(strings[1]);
// Perform outdentation
var cache = firstInterpolatedValueSetsIndentationLevel
? arrayFirstInterpSetsIndentCache
: arrayAutoIndentCache;
var renderedArray = cache.get(strings);
if (!renderedArray) {
renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options);
cache.set(strings, renderedArray);
}
/** If no interpolated values, skip concatenation step */
if (values.length === 0) {
return renderedArray[0];
}
/** Concatenate string literals with interpolated values */
var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
return rendered;
}
else {
// Create and return a new instance of outdent with the given options
return createInstance(extend(extend({}, options), stringsOrOptions || {}));
}
}
var fullOutdent = extend(outdent, {
string: function (str) {
return _outdentArray([str], false, options)[0];
},
});
return fullOutdent;
}
var defaultOutdent = createInstance({
trimLeadingNewline: true,
trimTrailingNewline: true,
});
exports.outdent = defaultOutdent;
// Named exports. Simple and preferred.
// import outdent from 'outdent';
exports.default = defaultOutdent;
if (typeof module !== "undefined") {
// In webpack harmony-modules environments, module.exports is read-only,
// so we fail gracefully.
try {
module.exports = defaultOutdent;
Object.defineProperty(defaultOutdent, "__esModule", { value: true });
defaultOutdent.default = defaultOutdent;
defaultOutdent.outdent = defaultOutdent;
}
catch (e) { }
}
//# sourceMappingURL=index.js.map

1
server/node_modules/outdent/lib/index.js.map generated vendored Normal file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,8FAA8F;AAC9F,SAAS,IAAI;IAAC,cAAmB;SAAnB,UAAmB,EAAnB,qBAAmB,EAAnB,IAAmB;QAAnB,yBAAmB;;AAAG,CAAC;AACrC,SAAS,aAAa;IACpB,IAAI,OAAO,OAAO,KAAK,WAAW,EAAE;QAClC,OAAO,IAAI,OAAO,EAAQ,CAAC;KAC5B;SAAM;QACL,OAAO,YAAY,EAAQ,CAAC;KAC7B;AACH,CAAC;AAUD;;GAEG;AACH,SAAS,YAAY;IACnB,OAAO;QACL,GAAG,EAAE,IAAyB;QAC9B,MAAM,EAAE,IAA+B;QACvC,GAAG,EAAE,IAA4B;QACjC,GAAG,EAAE,IAA4B;QACjC,GAAG,EAAH,UAAI,CAAI;YACN,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC;AAED,sBAAsB;AACtB,IAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AAC5C,IAAM,GAAG,GAAG,UAAU,GAAW,EAAE,IAAY;IAC7C,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,2DAA2D;AAC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M,CACtE,CAAC;YAEF,OAAO,QAAQ,CAAC;SACjB;aAAM;YACL,qEAAqE;YACrE,OAAO,cAAc,CACnB,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,gBAAgB,IAAI,EAAE,CAAC,CACpD,CAAC;SACH;IACH,CAAC;IAED,IAAM,WAAW,GAAG,MAAM,CAAC,OAAO,EAAE;QAClC,MAAM,EAAN,UAAO,GAAW;YAChB,OAAO,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACjD,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,IAAM,cAAc,GAAG,cAAc,CAAC;IACpC,kBAAkB,EAAE,IAAI;IACxB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAC;AA6CwB,iCAAO;AAJlC,wCAAwC;AACxC,iCAAiC;AACjC,kBAAe,cAAc,CAAC;AAQ9B,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;IACjC,wEAAwE;IACxE,yBAAyB;IACzB,IAAI;QACF,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC;QAChC,MAAM,CAAC,cAAc,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,cAAsB,CAAC,OAAO,GAAG,cAAc,CAAC;QAChD,cAAsB,CAAC,OAAO,GAAG,cAAc,CAAC;KAClD;IAAC,OAAO,CAAC,EAAE,GAAE;CACf"}

66
server/node_modules/outdent/package.json generated vendored Normal file
View File

@@ -0,0 +1,66 @@
{
"name": "outdent",
"version": "0.8.0",
"description": "Remove leading indentation from ES6 template literals.",
"main": "lib/index.js",
"jsnext:main": "lib-module/index.js",
"module": "lib-module/index.js",
"typings": "lib/index.d.ts",
"scripts": {
"clean": "ts-node-script ./scripts/run.ts",
"build": "ts-node-script ./scripts/run.ts",
"test": "ts-node-script ./scripts/run.ts",
"lint": "ts-node-script ./scripts/run.ts",
"format": "ts-node-script ./scripts/run.ts",
"prepack": "ts-node-script ./scripts/run.ts",
"setup": "ts-node-script ./scripts/run.ts"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cspotcode/outdent.git"
},
"keywords": [
"es6",
"es2015",
"template string",
"template literal",
"interpolation",
"string",
"template",
"indent"
],
"author": "Andrew Bradley <cspotcode@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/cspotcode/outdent/issues"
},
"homepage": "https://github.com/cspotcode/outdent#readme",
"devDependencies": {
"@types/chai": "^4.0.4",
"@types/fs-extra": "^9.0.5",
"@types/mocha": "^2.2.43",
"@types/node": "^14.14.12",
"@types/webpack": "^4.4.11",
"@types/which": "^1.0.28",
"chai": "^4.1.2",
"execa": "^5.0.0",
"fs-extra": "^9.0.1",
"mocha": "^4.0.1",
"np": "^6.2.0",
"ts-node": "^9.1.1",
"typescript": ">=4.1.3 <4.2",
"webpack": "^4.17.2",
"which": "^1.3.0"
},
"files": [
"/lib",
"/lib-module",
"/src",
"/LICENSE",
"/README.md",
"/tsconfig-build.json",
"/tsconfig-lib.json",
"/tsconfig-module.json",
"/tsconfig.json"
]
}

266
server/node_modules/outdent/src/index.ts generated vendored Normal file
View File

@@ -0,0 +1,266 @@
type TODO = any;
// In the absence of a WeakSet or WeakMap implementation, don't break, but don't cache either.
function noop(...args: Array<any>) {}
function createWeakMap<K extends object, V>(): MyWeakMap<K, V> {
if (typeof WeakMap !== "undefined") {
return new WeakMap<K, V>();
} else {
return fakeSetOrMap<K, V>();
}
}
type MyWeakMap<K extends object, V> = Pick<
WeakMap<K, V>,
"delete" | "get" | "set" | "has"
>;
type MyWeakSetMap<K extends object, V> =
& Pick<WeakMap<K, V>, "delete" | "get" | "set" | "has">
& Pick<WeakSet<K>, "add">;
/**
* Creates and returns a no-op implementation of a WeakMap / WeakSet that never stores anything.
*/
function fakeSetOrMap<K extends object, V = any>(): MyWeakSetMap<K, V> {
return {
add: noop as WeakSet<K>["add"],
delete: noop as WeakMap<K, V>["delete"],
get: noop as WeakMap<K, V>["get"],
set: noop as WeakMap<K, V>["set"],
has(k: K) {
return false;
},
};
}
// Safe hasOwnProperty
const hop = Object.prototype.hasOwnProperty;
const has = function (obj: object, prop: string): boolean {
return hop.call(obj, prop);
};
// Copy all own enumerable properties from source to target
function extend<T, S extends object>(target: T, source: S) {
type Extended = T & S;
for (const prop in source) {
if (has(source, prop)) {
(target as any)[prop] = source[prop];
}
}
return target as Extended;
}
const reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
const reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
const reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
const reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
const reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
function _outdentArray(
strings: ReadonlyArray<string>,
firstInterpolatedValueSetsIndentationLevel: boolean,
options: Options,
) {
// If first interpolated value is a reference to outdent,
// determine indentation level from the indentation of the interpolated value.
let indentationLevel = 0;
const match = strings[0].match(reDetectIndentation);
if (match) {
indentationLevel = match[1].length;
}
const reSource = `(\\r\\n|\\r|\\n).{0,${indentationLevel}}`;
const reMatchIndent = new RegExp(reSource, "g");
if (firstInterpolatedValueSetsIndentationLevel) {
strings = strings.slice(1);
}
const { newline, trimLeadingNewline, trimTrailingNewline } = options;
const normalizeNewlines = typeof newline === "string";
const l = strings.length;
const outdentedStrings = strings.map((v, i) => {
// Remove leading indentation from all lines
v = v.replace(reMatchIndent, "$1");
// Trim a leading newline from the first string
if (i === 0 && trimLeadingNewline) {
v = v.replace(reLeadingNewline, "");
}
// Trim a trailing newline from the last string
if (i === l - 1 && trimTrailingNewline) {
v = v.replace(reTrailingNewline, "");
}
// Normalize newlines
if (normalizeNewlines) {
v = v.replace(/\r\n|\n|\r/g, (_) => newline as string);
}
return v;
});
return outdentedStrings;
}
function concatStringsAndValues(
strings: ReadonlyArray<string>,
values: ReadonlyArray<any>,
): string {
let ret = "";
for (let i = 0, l = strings.length; i < l; i++) {
ret += strings[i];
if (i < l - 1) {
ret += values[i];
}
}
return ret;
}
function isTemplateStringsArray(v: any): v is TemplateStringsArray {
return has(v, "raw") && has(v, "length");
}
/**
* It is assumed that opts will not change. If this is a problem, clone your options object and pass the clone to
* makeInstance
* @param options
* @return {outdent}
*/
function createInstance(options: Options): Outdent {
/** Cache of pre-processed template literal arrays */
const arrayAutoIndentCache = createWeakMap<
TemplateStringsArray,
Array<string>
>();
/**
* Cache of pre-processed template literal arrays, where first interpolated value is a reference to outdent,
* before interpolated values are injected.
*/
const arrayFirstInterpSetsIndentCache = createWeakMap<
TemplateStringsArray,
Array<string>
>();
/* tslint:disable:no-shadowed-variable */
function outdent(
stringsOrOptions: TemplateStringsArray,
...values: Array<any>
): string;
function outdent(stringsOrOptions: Options): Outdent;
function outdent(
stringsOrOptions: TemplateStringsArray | Options,
...values: Array<any>
): string | Outdent {
/* tslint:enable:no-shadowed-variable */
if (isTemplateStringsArray(stringsOrOptions)) {
const strings = stringsOrOptions;
// Is first interpolated value a reference to outdent, alone on its own line, without any preceding non-whitespace?
const firstInterpolatedValueSetsIndentationLevel =
(values[0] === outdent || values[0] === defaultOutdent) &&
reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) &&
reStartsWithNewlineOrIsEmpty.test(strings[1]);
// Perform outdentation
const cache = firstInterpolatedValueSetsIndentationLevel
? arrayFirstInterpSetsIndentCache
: arrayAutoIndentCache;
let renderedArray = cache.get(strings);
if (!renderedArray) {
renderedArray = _outdentArray(
strings,
firstInterpolatedValueSetsIndentationLevel,
options,
);
cache.set(strings, renderedArray);
}
/** If no interpolated values, skip concatenation step */
if (values.length === 0) {
return renderedArray[0];
}
/** Concatenate string literals with interpolated values */
const rendered = concatStringsAndValues(
renderedArray,
firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values,
);
return rendered;
} else {
// Create and return a new instance of outdent with the given options
return createInstance(
extend(extend({}, options), stringsOrOptions || {}),
);
}
}
const fullOutdent = extend(outdent, {
string(str: string): string {
return _outdentArray([str], false, options)[0];
},
});
return fullOutdent;
}
const defaultOutdent = createInstance({
trimLeadingNewline: true,
trimTrailingNewline: true,
});
export interface Outdent {
/**
* Remove indentation from a template literal.
*/
(strings: TemplateStringsArray, ...values: Array<any>): string;
/**
* Create and return a new Outdent instance with the given options.
*/
(options: Options): Outdent;
/**
* Remove indentation from a string
*/
string(str: string): string;
// /**
// * Remove indentation from a template literal, but return a tuple of the
// * outdented TemplateStringsArray and
// */
// pass(strings: TemplateStringsArray, ...values: Array<any>): [TemplateStringsArray, ...Array<any>];
}
export interface Options {
trimLeadingNewline?: boolean;
trimTrailingNewline?: boolean;
/**
* Normalize all newlines in the template literal to this value.
*
* If `null`, newlines are left untouched.
*
* Newlines that get normalized are '\r\n', '\r', and '\n'.
*
* Newlines within interpolated values are *never* normalized.
*
* Although intended for normalizing to '\n' or '\r\n',
* you can also set to any string; for example ' '.
*/
newline?: string | null;
}
// Named exports. Simple and preferred.
// import outdent from 'outdent';
export default defaultOutdent;
// import {outdent} from 'outdent';
export { defaultOutdent as outdent };
// In CommonJS environments, enable `var outdent = require('outdent');` by
// replacing the exports object.
// Make sure that our replacement includes the named exports from above.
declare var module: any;
if (typeof module !== "undefined") {
// In webpack harmony-modules environments, module.exports is read-only,
// so we fail gracefully.
try {
module.exports = defaultOutdent;
Object.defineProperty(defaultOutdent, "__esModule", { value: true });
(defaultOutdent as any).default = defaultOutdent;
(defaultOutdent as any).outdent = defaultOutdent;
} catch (e) {}
}

15
server/node_modules/outdent/tsconfig-build.json generated vendored Normal file
View File

@@ -0,0 +1,15 @@
{
"references": [
{
"path": "./tsconfig-lib.json"
},
{
"path": "./tsconfig-module.json"
},
],
"compilerOptions": {
"composite": true
},
"include": [],
"files": []
}

27
server/node_modules/outdent/tsconfig-lib.json generated vendored Normal file
View File

@@ -0,0 +1,27 @@
{
"compilerOptions": {
"composite": true,
// Emit options
"rootDir": "src",
"outDir": "lib",
"declaration": true,
"declarationMap": true,
"target": "es5",
"module": "commonjs",
"stripInternal": true,
"sourceMap": true,
"newLine": "LF",
// Checking options
"strict": true,
"charset": "utf8",
"lib": [
"es5",
"es2015.collection"
],
// Module resolution and types
"moduleResolution": "node"
},
"include": [
"src"
]
}

9
server/node_modules/outdent/tsconfig-module.json generated vendored Normal file
View File

@@ -0,0 +1,9 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": "./tsconfig-lib.json",
"compilerOptions": {
// Emit exactly the same code as normal tsconfig, but with ES6 import & export statements instead of CommonJS
"module": "esnext",
"outDir": "lib-module"
}
}

19
server/node_modules/outdent/tsconfig.json generated vendored Normal file
View File

@@ -0,0 +1,19 @@
{
// This determines the configuration used by your editor
"compilerOptions": {
"rootDir": ".",
"noEmit": true,
"declaration": false,
"target": "es5",
"module": "commonjs",
"strict": false,
"lib": [
"es2015"
]
},
"include": [
"scripts",
"src",
"test"
]
}