Add Robot_JoyIt driver

This commit is contained in:
2026-01-17 16:50:07 +01:00
parent e9e50acf5f
commit 0cfb4d5a95
15848 changed files with 570836 additions and 268976 deletions

21
node_modules/dedent/LICENSE generated vendored
View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Desmond Brand (dmnd@desmondbrand.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.

20
node_modules/dedent/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,20 @@
# MIT License
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.

189
node_modules/dedent/README.md generated vendored
View File

@@ -1,42 +1,57 @@
# Dedent
<h1 align="center">dedent</h1>
An ES6 string tag that strips indentation from multi-line strings.
<p align="center">A string tag that strips indentation from multi-line strings. ⬅️</p>
<p align="center">
<!-- prettier-ignore-start -->
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
<a href="#contributors" target="_blank"><img alt="All Contributors: 18 👪" src="https://img.shields.io/badge/all_contributors-18_👪-21bb42.svg" /></a>
<!-- ALL-CONTRIBUTORS-BADGE:END -->
<!-- prettier-ignore-end -->
<a href="https://github.com/dmnd/dedent/blob/main/.github/CODE_OF_CONDUCT.md" target="_blank"><img alt="🤝 Code of Conduct: Kept" src="https://img.shields.io/badge/code_of_conduct-enforced-21bb42" /></a>
<a href="https://codecov.io/gh/dmnd/dedent" target="_blank"><img alt="🧪 Coverage" src="https://codecov.io/gh/dmnd/dedent/branch/main/graph/badge.svg"/></a>
<a href="https://github.com/dmnd/dedent/blob/main/LICENSE.md" target="_blank"><img alt="📝 License: MIT" src="https://img.shields.io/github/license/dmnd/dedent?color=21bb42"></a>
<a href="http://npmjs.com/package/dedent" target="_blank"><img alt="📦 npm version" src="https://img.shields.io/npm/v/dedent?color=21bb42" /></a>
<img alt="💪 TypeScript: Strict" src="https://img.shields.io/badge/typescript-strict-21bb42.svg" />
</p>
## Usage
```shell
npm i dedent
```
```js
import dedent from "dedent";
function usageExample() {
const first = dedent`A string that gets so long you need to break it over
multiple lines. Luckily dedent is here to keep it
readable without lots of spaces ending up in the string
itself.`;
const first = dedent`A string that gets so long you need to break it over
multiple lines. Luckily dedent is here to keep it
readable without lots of spaces ending up in the string
itself.`;
const second = dedent`
Leading and trailing lines will be trimmed, so you can write something like
this and have it work as you expect:
const second = dedent`
Leading and trailing lines will be trimmed, so you can write something like
this and have it work as you expect:
* how convenient it is
* that I can use an indented list
- and still have it do the right thing
* how convenient it is
* that I can use an indented list
- and still have it do the right thing
That's all.
`;
That's all.
`;
const third = dedent(`
Wait! I lied. Dedent can also be used as a function.
`);
const third = dedent(`
Wait! I lied. Dedent can also be used as a function.
`);
return first + "\n\n" + second + "\n\n" + third;
return first + "\n\n" + second + "\n\n" + third;
}
console.log(usageExample());
```
```js
> console.log(usageExample());
```
```
```plaintext
A string that gets so long you need to break it over
multiple lines. Luckily dedent is here to keep it
readable without lots of spaces ending up in the string
@@ -45,9 +60,9 @@ itself.
Leading and trailing lines will be trimmed, so you can write something like
this and have it work as you expect:
* how convenient it is
* that I can use an indented list
- and still have it do the right thing
* how convenient it is
* that I can use an indented list
- and still have it do the right thing
That's all.
@@ -78,6 +93,52 @@ dedenter`input`;
dedenter(`input`);
```
### `alignValues`
When an interpolation evaluates to a multi-line string, only its first line is placed where the `${...}` appears. Subsequent lines keep whatever indentation they already had inside that value (often none), so they can appear “shifted left”.
Enable `alignValues` to fix that visual jump. When `true`, for every multi-line interpolated value, each line after the first gets extra indentation appended so it starts in the same column as the first line.
```js
import dedent from "dedent";
const list = dedent`
- apples
- bananas
- cherries
`;
const withoutAlign = dedent`
List without alignValues (default):
${list}
Done.
`;
const withAlign = dedent.withOptions({ alignValues: true })`
List with alignValues: true
${list}
Done.
`;
console.log(withoutAlign);
console.log("---");
console.log(withAlign);
```
```plaintext
List without alignValues (default):
- apples
- bananas
- cherries
Done.
---
List with alignValues: true
- apples
- bananas
- cherries
Done.
```
### `escapeSpecialCharacters`
JavaScript string tags by default add an extra `\` escape in front of some special characters such as `$` dollar signs.
@@ -94,22 +155,90 @@ import dedent from "dedent";
// "$hello!"
dedent`
$hello!
$hello!
`;
// "\$hello!"
dedent.withOptions({ escapeSpecialCharacters: false })`
$hello!
$hello!
`;
// "$hello!"
dedent.withOptions({ escapeSpecialCharacters: true })`
$hello!
$hello!
`;
```
For more context, see [https://github.com/dmnd/dedent/issues/63](🚀 Feature: Add an option to disable special character escaping).
For more context, see [🚀 Feature: Add an option to disable special character escaping](https://github.com/dmnd/dedent/issues/63).
### `trimWhitespace`
By default, dedent will trim leading and trailing whitespace from the overall string.
This can be disabled by setting `trimWhitespace: false`.
```js
import dedent from "dedent";
// "hello!"
dedent`
hello!
`;
// "\nhello! \n"
dedent.withOptions({ trimWhitespace: false })`
hello!
`;
// "hello!"
dedent.withOptions({ trimWhitespace: true })`
hello!
`;
```
## License
MIT
## Contributors
<!-- spellchecker: disable -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://adrianjost.dev/"><img src="https://avatars.githubusercontent.com/u/22987140?v=4?s=100" width="100px;" alt="Adrian Jost"/><br /><sub><b>Adrian Jost</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=adrianjost" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://m811.com/"><img src="https://avatars.githubusercontent.com/u/156837?v=4?s=100" width="100px;" alt="Andri Möll"/><br /><sub><b>Andri Möll</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Amoll" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://bennypowers.dev/"><img src="https://avatars.githubusercontent.com/u/1466420?v=4?s=100" width="100px;" alt="Benny Powers - עם ישראל חי!"/><br /><sub><b>Benny Powers - עם ישראל חי!</b></sub></a><br /><a href="#tool-bennypowers" title="Tools">🔧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/phenomnomnominal"><img src="https://avatars.githubusercontent.com/u/1086286?v=4?s=100" width="100px;" alt="Craig Spence"/><br /><sub><b>Craig Spence</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=phenomnomnominal" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://synthesis.com/"><img src="https://avatars.githubusercontent.com/u/4427?v=4?s=100" width="100px;" alt="Desmond Brand"/><br /><sub><b>Desmond Brand</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Admnd" title="Bug reports">🐛</a> <a href="https://github.com/dmnd/dedent/commits?author=dmnd" title="Code">💻</a> <a href="https://github.com/dmnd/dedent/commits?author=dmnd" title="Documentation">📖</a> <a href="#ideas-dmnd" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-dmnd" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-dmnd" title="Maintenance">🚧</a> <a href="#projectManagement-dmnd" title="Project Management">📆</a> <a href="#tool-dmnd" title="Tools">🔧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/G-Rath"><img src="https://avatars.githubusercontent.com/u/3151613?v=4?s=100" width="100px;" alt="Gareth Jones"/><br /><sub><b>Gareth Jones</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=G-Rath" title="Code">💻</a> <a href="https://github.com/dmnd/dedent/issues?q=author%3AG-Rath" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/otakustay"><img src="https://avatars.githubusercontent.com/u/639549?v=4?s=100" width="100px;" alt="Gray Zhang"/><br /><sub><b>Gray Zhang</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Aotakustay" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://haroen.me/"><img src="https://avatars.githubusercontent.com/u/6270048?v=4?s=100" width="100px;" alt="Haroen Viaene"/><br /><sub><b>Haroen Viaene</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=Haroenv" title="Code">💻</a> <a href="#maintenance-Haroenv" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://blog.cometkim.kr/"><img src="https://avatars.githubusercontent.com/u/9696352?v=4?s=100" width="100px;" alt="Hyeseong Kim"/><br /><sub><b>Hyeseong Kim</b></sub></a><br /><a href="#tool-cometkim" title="Tools">🔧</a> <a href="#infra-cometkim" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jlarmstrongiv"><img src="https://avatars.githubusercontent.com/u/20903247?v=4?s=100" width="100px;" alt="John L. Armstrong IV"/><br /><sub><b>John L. Armstrong IV</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Ajlarmstrongiv" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.joshuakgoldberg.com/"><img src="https://avatars.githubusercontent.com/u/3335181?v=4?s=100" width="100px;" alt="Josh Goldberg ✨"/><br /><sub><b>Josh Goldberg ✨</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3AJoshuaKGoldberg" title="Bug reports">🐛</a> <a href="https://github.com/dmnd/dedent/commits?author=JoshuaKGoldberg" title="Code">💻</a> <a href="https://github.com/dmnd/dedent/commits?author=JoshuaKGoldberg" title="Documentation">📖</a> <a href="#ideas-JoshuaKGoldberg" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-JoshuaKGoldberg" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#maintenance-JoshuaKGoldberg" title="Maintenance">🚧</a> <a href="#projectManagement-JoshuaKGoldberg" title="Project Management">📆</a> <a href="#tool-JoshuaKGoldberg" title="Tools">🔧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://pratapvardhan.com/"><img src="https://avatars.githubusercontent.com/u/3757165?v=4?s=100" width="100px;" alt="Pratap Vardhan"/><br /><sub><b>Pratap Vardhan</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=pratapvardhan" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/lydell"><img src="https://avatars.githubusercontent.com/u/2142817?v=4?s=100" width="100px;" alt="Simon Lydell"/><br /><sub><b>Simon Lydell</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Alydell" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yinm"><img src="https://avatars.githubusercontent.com/u/13295106?v=4?s=100" width="100px;" alt="Yusuke Iinuma"/><br /><sub><b>Yusuke Iinuma</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=yinm" title="Code">💻</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/yvele"><img src="https://avatars.githubusercontent.com/u/4225430?v=4?s=100" width="100px;" alt="Yves M."/><br /><sub><b>Yves M.</b></sub></a><br /><a href="#tool-yvele" title="Tools">🔧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/d07RiV"><img src="https://avatars.githubusercontent.com/u/3448203?v=4?s=100" width="100px;" alt="d07riv"/><br /><sub><b>d07riv</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Ad07RiV" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mizdra.net/"><img src="https://avatars.githubusercontent.com/u/9639995?v=4?s=100" width="100px;" alt="mizdra"/><br /><sub><b>mizdra</b></sub></a><br /><a href="https://github.com/dmnd/dedent/commits?author=mizdra" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/sirian"><img src="https://avatars.githubusercontent.com/u/897643?v=4?s=100" width="100px;" alt="sirian"/><br /><sub><b>sirian</b></sub></a><br /><a href="https://github.com/dmnd/dedent/issues?q=author%3Asirian" title="Bug reports">🐛</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- spellchecker: enable -->
> 💙 This package was templated with [create-typescript-app](https://github.com/JoshuaKGoldberg/create-typescript-app).

View File

@@ -1,5 +1,7 @@
interface DedentOptions {
alignValues?: boolean;
escapeSpecialCharacters?: boolean;
trimWhitespace?: boolean;
}
interface Dedent {
(literals: string): string;
@@ -8,10 +10,6 @@ interface Dedent {
}
type CreateDedent = (options: DedentOptions) => Dedent;
declare const _default: {
(literals: string): string;
(strings: TemplateStringsArray, ...values: unknown[]): string;
withOptions(newOptions: DedentOptions): any;
};
declare const dedent: Dedent;
export { CreateDedent, Dedent, DedentOptions, _default as default };
export { CreateDedent, Dedent, DedentOptions, dedent as default };

10
node_modules/dedent/dist/dedent.d.ts generated vendored
View File

@@ -1,5 +1,7 @@
interface DedentOptions {
alignValues?: boolean;
escapeSpecialCharacters?: boolean;
trimWhitespace?: boolean;
}
interface Dedent {
(literals: string): string;
@@ -8,10 +10,6 @@ interface Dedent {
}
type CreateDedent = (options: DedentOptions) => Dedent;
declare const _default: {
(literals: string): string;
(strings: TemplateStringsArray, ...values: unknown[]): string;
withOptions(newOptions: DedentOptions): any;
};
declare const dedent: Dedent;
export { CreateDedent, Dedent, DedentOptions, _default as default };
export { CreateDedent, Dedent, DedentOptions, dedent as default };

54
node_modules/dedent/dist/dedent.js generated vendored
View File

@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _default = createDedent({});
exports.default = _default;
const dedent = createDedent({});
var _default = exports.default = dedent;
function createDedent(options) {
dedent.withOptions = newOptions => createDedent({
...options,
@@ -15,7 +15,9 @@ function createDedent(options) {
function dedent(strings, ...values) {
const raw = typeof strings === "string" ? [strings] : strings.raw;
const {
escapeSpecialCharacters = Array.isArray(strings)
alignValues = false,
escapeSpecialCharacters = Array.isArray(strings),
trimWhitespace = true
} = options;
// first, perform interpolation
@@ -24,12 +26,14 @@ function createDedent(options) {
let next = raw[i];
if (escapeSpecialCharacters) {
// handle escaped newlines, backticks, and interpolation characters
next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{");
next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{");
}
result += next;
if (i < values.length) {
const value = alignValues ? alignValue(values[i], result) : values[i];
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
result += values[i];
result += value;
}
}
@@ -55,12 +59,46 @@ function createDedent(options) {
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
.map(l => l[0] === " " || l[0] === "\t" ? l.slice(m) : l).join("\n");
}
return result
// dedent eats leading and trailing whitespace too
.trim()
if (trimWhitespace) {
result = result.trim();
}
// handle escaped newlines at the end to ensure they don't get stripped too
.replace(/\\n/g, "\n");
if (escapeSpecialCharacters) {
result = result.replace(/\\n/g, "\n");
}
// Workaround for Bun issue with Unicode characters
// https://github.com/oven-sh/bun/issues/8745
if (typeof Bun !== "undefined") {
result = result.replace(
// Matches e.g. \\u{1f60a} or \\u5F1F
/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (_, braced, unbraced) => {
var _ref;
const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
return String.fromCodePoint(parseInt(hex, 16));
});
}
return result;
}
}
/**
* Adjusts the indentation of a multi-line interpolated value to match the current line.
*/
function alignValue(value, precedingText) {
if (typeof value !== "string" || !value.includes("\n")) {
return value;
}
const currentLine = precedingText.slice(precedingText.lastIndexOf("\n") + 1);
const indentMatch = currentLine.match(/^(\s+)/);
if (indentMatch) {
const indent = indentMatch[1];
return value.replace(/\n/g, `\n${indent}`);
}
return value;
}
module.exports = exports.default;
module.exports.default = exports.default;

53
node_modules/dedent/dist/dedent.mjs generated vendored
View File

@@ -3,14 +3,17 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
export default createDedent({});
const dedent = createDedent({});
export default dedent;
function createDedent(options) {
dedent.withOptions = newOptions => createDedent(_objectSpread(_objectSpread({}, options), newOptions));
return dedent;
function dedent(strings, ...values) {
const raw = typeof strings === "string" ? [strings] : strings.raw;
const {
escapeSpecialCharacters = Array.isArray(strings)
alignValues = false,
escapeSpecialCharacters = Array.isArray(strings),
trimWhitespace = true
} = options;
// first, perform interpolation
@@ -19,12 +22,14 @@ function createDedent(options) {
let next = raw[i];
if (escapeSpecialCharacters) {
// handle escaped newlines, backticks, and interpolation characters
next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\{/g, "{");
next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{");
}
result += next;
if (i < values.length) {
const value = alignValues ? alignValue(values[i], result) : values[i];
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
result += values[i];
result += value;
}
}
@@ -50,10 +55,44 @@ function createDedent(options) {
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
.map(l => l[0] === " " || l[0] === "\t" ? l.slice(m) : l).join("\n");
}
return result
// dedent eats leading and trailing whitespace too
.trim()
if (trimWhitespace) {
result = result.trim();
}
// handle escaped newlines at the end to ensure they don't get stripped too
.replace(/\\n/g, "\n");
if (escapeSpecialCharacters) {
result = result.replace(/\\n/g, "\n");
}
// Workaround for Bun issue with Unicode characters
// https://github.com/oven-sh/bun/issues/8745
if (typeof Bun !== "undefined") {
result = result.replace(
// Matches e.g. \\u{1f60a} or \\u5F1F
/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g, (_, braced, unbraced) => {
var _ref;
const hex = (_ref = braced !== null && braced !== void 0 ? braced : unbraced) !== null && _ref !== void 0 ? _ref : "";
return String.fromCodePoint(parseInt(hex, 16));
});
}
return result;
}
}
/**
* Adjusts the indentation of a multi-line interpolated value to match the current line.
*/
function alignValue(value, precedingText) {
if (typeof value !== "string" || !value.includes("\n")) {
return value;
}
const currentLine = precedingText.slice(precedingText.lastIndexOf("\n") + 1);
const indentMatch = currentLine.match(/^(\s+)/);
if (indentMatch) {
const indent = indentMatch[1];
return value.replace(/\n/g, `\n${indent}`);
}
return value;
}

2
node_modules/dedent/macro.d.ts generated vendored
View File

@@ -1,2 +0,0 @@
import dedent from "dedent";
export default dedent;

44
node_modules/dedent/macro.js generated vendored
View File

@@ -1,34 +1,32 @@
const { createMacro, MacroError } = require("babel-plugin-macros");
const { MacroError, createMacro } = require("babel-plugin-macros");
const dedent = require("./dist/dedent.js").default;
module.exports = createMacro(prevalMacros);
function prevalMacros({ references, state, babel }) {
references.default.forEach(referencePath => {
if (referencePath.parentPath.type === "TaggedTemplateExpression") {
asTag(referencePath.parentPath.get("quasi"), state, babel);
} else if (referencePath.parentPath.type === "CallExpression") {
asFunction(referencePath.parentPath.get("arguments"), state, babel);
} else {
throw new MacroError(
`dedent.macro can only be used as tagged template expression or function call. You tried ${
referencePath.parentPath.type
}.`
);
}
});
function prevalMacros({ babel, references, state }) {
references.default.forEach((referencePath) => {
if (referencePath.parentPath.type === "TaggedTemplateExpression") {
asTag(referencePath.parentPath.get("quasi"), state, babel);
} else if (referencePath.parentPath.type === "CallExpression") {
asFunction(referencePath.parentPath.get("arguments"), state, babel);
} else {
throw new MacroError(
`dedent.macro can only be used as tagged template expression or function call. You tried ${referencePath.parentPath.type}.`,
);
}
});
}
function asTag(quasiPath, { file: { opts: { filename } } }, babel) {
const string = quasiPath.parentPath.get("quasi").evaluate().value;
const { types: t } = babel;
function asTag(quasiPath, _, babel) {
const string = quasiPath.parentPath.get("quasi").evaluate().value;
const { types: t } = babel;
quasiPath.parentPath.replaceWith(t.stringLiteral(dedent(string)));
quasiPath.parentPath.replaceWith(t.stringLiteral(dedent(string)));
}
function asFunction(argumentsPaths, { file: { opts: { filename } } }, babel) {
const string = argumentsPaths[0].evaluate().value;
const { types: t } = babel;
function asFunction(argumentsPaths, _, babel) {
const string = argumentsPaths[0].evaluate().value;
const { types: t } = babel;
argumentsPaths[0].parentPath.replaceWith(t.stringLiteral(dedent(string)));
argumentsPaths[0].parentPath.replaceWith(t.stringLiteral(dedent(string)));
}

155
node_modules/dedent/package.json generated vendored
View File

@@ -1,53 +1,96 @@
{
"name": "dedent",
"version": "1.5.1",
"description": "An ES6 string tag that strips indentation from multi-line strings",
"main": "dist/dedent.js",
"types": "./dist/dedent.d.ts",
"module": "./dist/dedent.mjs",
"exports": {
".": {
"import": {
"types": "./dist/dedent.d.mts",
"default": "./dist/dedent.mjs"
},
"require": {
"types": "./dist/dedent.d.ts",
"default": "./dist/dedent.js"
}
}
},
"files": [
"dist/dedent.d.mts",
"dist/dedent.d.ts",
"dist/dedent.js",
"dist/dedent.mjs",
"macro.js",
"index.d.ts",
"macro.d.ts",
"README.md",
"LICENSE"
],
"repository": {
"type": "git",
"url": "git://github.com/dmnd/dedent.git"
},
"version": "1.7.1",
"description": "A string tag that strips indentation from multi-line strings. ⬅️",
"keywords": [
"dedent",
"tag",
"multi-line string",
"es6"
],
"homepage": "https://github.com/dmnd/dedent",
"bugs": {
"url": "https://github.com/dmnd/dedent/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/dmnd/dedent"
},
"license": "MIT",
"author": {
"name": "Desmond Brand",
"email": "dmnd@desmondbrand.com",
"url": "http://desmondbrand.com"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/dmnd/dedent/issues"
"type": "commonjs",
"exports": {
".": {
"types": {
"import": "./dist/dedent.d.mts",
"require": "./dist/dedent.d.ts"
},
"import": "./dist/dedent.mjs",
"require": "./dist/dedent.js"
}
},
"main": "./dist/dedent.js",
"module": "./dist/dedent.mjs",
"types": "./dist/dedent.d.mts",
"files": [
"dist/",
"macro.js",
"package.json",
"LICENSE.md",
"README.md"
],
"lint-staged": {
"*": "prettier --ignore-unknown --write"
},
"devDependencies": {
"@babel/cli": "^7.21.5",
"@babel/preset-env": "^7.23.3",
"@babel/preset-typescript": "^7.23.3",
"@release-it/conventional-changelog": "^8.0.1",
"@types/babel-plugin-macros": "^3.1.0",
"@types/bun": "^1.3.4",
"@types/eslint": "^8.44.7",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-tester": "^11.0.4",
"console-fail-test": "^0.2.3",
"cspell": "^8.0.0",
"eslint": "^8.53.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-jest": "^27.6.0",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-jsonc": "^2.10.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-n": "^16.3.1",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-perfectionist": "^2.3.0",
"eslint-plugin-regexp": "^2.1.1",
"eslint-plugin-yml": "^1.10.0",
"husky": "^8.0.3",
"jest": "^29.7.0",
"jsonc-eslint-parser": "^2.4.0",
"knip": "^5.75.0",
"lint-staged": "^15.1.0",
"markdownlint": "^0.31.1",
"markdownlint-cli": "^0.37.0",
"npm-package-json-lint": "^7.1.0",
"npm-package-json-lint-config-default": "^6.0.0",
"prettier": "^3.0.3",
"prettier-plugin-curly": "^0.1.3",
"prettier-plugin-packagejson": "^2.4.6",
"release-it": "^17.0.0",
"should-semantic-release": "^0.2.1",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"yaml-eslint-parser": "^1.2.2"
},
"homepage": "https://github.com/dmnd/dedent",
"peerDependencies": {
"babel-plugin-macros": "^3.1.0"
},
@@ -56,32 +99,22 @@
"optional": true
}
},
"devDependencies": {
"@babel/cli": "^7.21.5",
"@babel/core": "^7.21.8",
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.22.5",
"@types/babel-plugin-macros": "^3.1.0",
"@types/jest": "^29.5.3",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"babel-plugin-add-module-exports": "^1.0.4",
"babel-plugin-macros": "^3.1.0",
"babel-plugin-tester": "^11.0.4",
"eslint": "^8.41.0",
"hermes-eslint": "^0.11.1",
"jest": "^29.5.0",
"tsup": "^7.1.0",
"typescript": "^5.1.6"
},
"packageManager": "pnpm@8.7.0",
"scripts": {
"build": "yarn build:legacy && yarn build:modern && yarn build:types",
"build:legacy": "BABEL_ENV=legacy babel dedent.ts --out-file dist/dedent.js",
"build:modern": "BABEL_ENV=modern babel dedent.ts --out-file dist/dedent.mjs",
"build:types": "tsup dedent.ts --dts-only --format cjs,esm",
"lint": "eslint .",
"prepack": "yarn build",
"build": "pnpm build:legacy && pnpm build:modern && pnpm build:types",
"build:legacy": "BABEL_ENV=legacy babel src/dedent.ts --out-file dist/dedent.js",
"build:modern": "BABEL_ENV=modern babel src/dedent.ts --out-file dist/dedent.mjs",
"build:types": "tsup src/dedent.ts --dts-only",
"format": "prettier \"**/*\" --ignore-unknown",
"lint": "eslint . .*js --max-warnings 0 --report-unused-disable-directives",
"lint:knip": "knip",
"lint:md": "markdownlint \"**/*.md\" \".github/**/*.md\"",
"lint:package-json": "npmPkgJsonLint .",
"lint:packages": "pnpm dedupe --check",
"lint:spelling": "cspell \"**\" \".github/**/*\"",
"should-semantic-release": "should-semantic-release --verbose",
"test": "jest",
"test:bun": "bun test src/dedent.test.ts",
"tsc": "tsc"
}
}
}