From 4df7b66a1b067cfbd1de2d27c8eb8c130c4699ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roger=20Sch=C3=B6nb=C3=A4chler?=
<42278642+schoero@users.noreply.github.com>
Date: Sun, 3 Oct 2021 10:31:42 +0200
Subject: [PATCH] v3 (#344)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* Code refactoring
* Fetch changes from master
* [SVG] WIP
* [SVG] Finish SVG rendering
* Fix tests
* Finished es modules and prebuilt bundle
* [SVG] Add scissors
* [doc] Update documentation
* Remove tests for windows
* Improve feature exports
* Update API
* [doc] Mention node 13
* Release v3.0.0-beta.2
* [types] re-export pdf types
* export features by path
* Remove extension from feature exports
* Finally got working exports 🚀
* [ci] Remove build
* Change target to ES6
* [doc] Add missing links in navigation
* [Readme] Add link to unpkg
* [Readme] Code cleanup
* [Readme] Add example for svg
* Code cleanup
* Release v3.0.0
---
.github/workflows/ci.yml | 1 -
.vscode/settings.json | 5 +-
CHANGELOG.md | 27 +
README.md | 106 +-
doc/api.md | 84 +-
doc/how-to-create-a-complete-bill.md | 79 +-
examples/{qr-iban.js => a4.mjs} | 4 +-
tests/a6-5.js => examples/a6.mjs | 4 +-
examples/browser.js | 3 +-
examples/{callback.js => callback.mjs} | 4 +-
examples/{event.js => event.mjs} | 4 +-
...l.js => how-to-create-a-complete-bill.mjs} | 73 +-
examples/multipage.js | 50 -
examples/multipage.mjs | 50 +
....js => normal-iban-creditor-reference.mjs} | 4 +-
...erence.js => normal-iban-no-reference.mjs} | 4 +-
examples/{a4.js => qr-iban.mjs} | 4 +-
examples/{a6.js => svg.mjs} | 5 +-
fix-exports.sh | 17 +
package-lock.json | 2749 +++++++++++------
package.json | 167 +-
pdfkit.d.ts | 473 ---
src/browser.ts | 64 -
src/browser/bundle.ts | 40 +
src/browser/index.ts | 23 +
src/browser/pdf.ts | 47 +
src/browser/svg.ts | 21 +
src/extended-pdf.ts | 238 --
src/node.ts | 74 -
src/node/index.ts | 21 +
src/node/pdf.ts | 56 +
src/node/svg.ts | 15 +
src/pdf/extended-pdf.ts | 230 ++
src/pdf/pdf.ts | 581 ++++
src/shared/qr-code.ts | 253 ++
src/shared/shared.ts | 258 ++
src/shared/translations.ts | 60 +
src/shared/types.ts | 50 +
src/{ => shared}/utils.ts | 27 +-
src/svg/characterWidth.ts | 399 +++
src/svg/svg.ts | 698 +++++
src/swissqrbill.ts | 1240 --------
tests/a4.js | 2 +-
...-housenumber.js => a6-5-buildingnumber.js} | 9 +-
tests/a6-5.mjs | 27 +
tests/additional-information.js | 5 +-
tests/av1av2.js | 5 +-
tests/callback-with-options.js | 2 +-
tests/callback.js | 2 +-
tests/english.js | 5 +-
tests/euro.js | 5 +-
tests/event.js | 3 +-
tests/french.js | 5 +-
tests/index.html | 50 +
tests/italian.js | 5 +-
tests/message-additional-information.js | 5 +-
tests/message.js | 5 +-
tests/multipage.js | 20 +-
tests/no-amount.js | 5 +-
tests/no-debtor-no-amount-no-reference.js | 13 +-
tests/no-debtor-no-amount.js | 5 +-
tests/no-debtor-no-reference.js | 5 +-
tests/no-debtor.js | 5 +-
tests/no-reference-message.js | 5 +-
tests/no-scissors-no-outlines.js | 2 +-
tests/no-scissors-no-separate-no-outlines.js | 2 +-
tests/no-scissors-no-separate.js | 2 +-
tests/no-scissors.js | 2 +-
tests/no-separate-no-outlines.js | 2 +-
tests/normal-iban-creditor-reference.js | 5 +-
tests/normal-iban-no-reference.js | 5 +-
tests/not-enough-space-a4.js | 6 +-
tests/not-enough-space.js | 6 +-
tests/qr-iban.js | 5 +-
tests/run-windows.bat | 73 -
tests/run.sh | 6 +-
tests/separate-scissors.js | 2 +-
tests/separate.js | 2 +-
tests/stream.js | 2 +-
tests/zip-string.js | 7 +-
tsconfig.browser.esm.json | 15 +
tsconfig.cjs.json | 14 +
tsconfig.esm.json | 14 +
tsconfig.json | 20 +-
webpack.config.js | 63 +-
85 files changed, 5411 insertions(+), 3349 deletions(-)
rename examples/{qr-iban.js => a4.mjs} (80%)
rename tests/a6-5.js => examples/a6.mjs (78%)
rename examples/{callback.js => callback.mjs} (80%)
rename examples/{event.js => event.mjs} (82%)
rename examples/{how-to-create-a-complete-bill.js => how-to-create-a-complete-bill.mjs} (78%)
delete mode 100644 examples/multipage.js
create mode 100644 examples/multipage.mjs
rename examples/{normal-iban-creditor-reference.js => normal-iban-creditor-reference.mjs} (76%)
rename examples/{normal-iban-no-reference.js => normal-iban-no-reference.mjs} (75%)
rename examples/{a4.js => qr-iban.mjs} (78%)
rename examples/{a6.js => svg.mjs} (77%)
create mode 100644 fix-exports.sh
delete mode 100644 pdfkit.d.ts
delete mode 100644 src/browser.ts
create mode 100644 src/browser/bundle.ts
create mode 100644 src/browser/index.ts
create mode 100644 src/browser/pdf.ts
create mode 100644 src/browser/svg.ts
delete mode 100644 src/extended-pdf.ts
delete mode 100644 src/node.ts
create mode 100644 src/node/index.ts
create mode 100644 src/node/pdf.ts
create mode 100644 src/node/svg.ts
create mode 100644 src/pdf/extended-pdf.ts
create mode 100644 src/pdf/pdf.ts
create mode 100644 src/shared/qr-code.ts
create mode 100644 src/shared/shared.ts
create mode 100644 src/shared/translations.ts
create mode 100644 src/shared/types.ts
rename src/{ => shared}/utils.ts (85%)
create mode 100644 src/svg/characterWidth.ts
create mode 100644 src/svg/svg.ts
delete mode 100644 src/swissqrbill.ts
rename tests/{a6-5-housenumber.js => a6-5-buildingnumber.js} (62%)
create mode 100644 tests/a6-5.mjs
create mode 100644 tests/index.html
delete mode 100644 tests/run-windows.bat
create mode 100644 tsconfig.browser.esm.json
create mode 100644 tsconfig.cjs.json
create mode 100644 tsconfig.esm.json
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 568c251..594a0de 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,4 +16,3 @@ jobs:
run: |
npm ci
npm test
- npm run build
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 1f907bf..dd997f7 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,5 +4,8 @@
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
- }
+ },
+ "javascript.preferences.importModuleSpecifierEnding": "js",
+ "typescript.preferences.importModuleSpecifierEnding": "js",
+ "liveServer.settings.port": 5501
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6caa0e..11aa72f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,33 @@
# Change Log
+# [v3.0.0](https://github.com/schoero/swissqrbill/compare/v2.4.2...v3.0.0) - 03.10.2021
+ * New features
+ * SVG
+ * Added support for SVG rendering [#343](https://github.com/schoero/SwissQRBill/issues/343).
+ * Added es6 module exports.
+ * Support for tree shaking.
+ * utils
+ * Added `mm2px()` function.
+ * Added `px2mm()` function.
+ * Added `pt2mm()` function.
+ * Breaking changes
+ * imports
+ * SwissQRBill is now available as a CommonJS and an ES module. This may change how the module has to be imported. Please take a look at the [importing the library](https://github.com/schoero/SwissQRBill#importing-the-library) section in the readme.
+ * data
+ * the field `houseNumber` has been renamed to `buildingNumber`.
+ * the deprecated field `debitor` has been removed. Use `debtor` instead.
+ * utils
+ * `mmToPoints()` function has been renamed to `mm2pt()`.
+ * PDF
+ * Removed deprecated `mmToPoints()` export. Use `utils.mm2pt()` instead.
+ * Fixes
+ * PDF
+ * The positioning of the box when no amount is provided has been slightly corrected.
+ * The positioning iban on the payment part has been slightly corrected.
+ * Fixed positioning of the debtor boxes when no debtor is provided and the creditor address break to multiple lines.
+
+
# [v2.4.2](https://github.com/schoero/swissqrbill/compare/v2.4.1...v2.4.2) - 26.08.2021
* Fixed translation of `additionalInformation` and `payableByName`. [#342](https://github.com/schoero/SwissQRBill/pull/342)
diff --git a/README.md b/README.md
index ab10121..7ca8bb8 100644
--- a/README.md
+++ b/README.md
@@ -37,10 +37,14 @@ With SwissQRBill you can easily generate the new QR Code payment slips in Node.j
[](https://github.com/schoero/SwissQRBill/blob/master/assets/qrbill.pdf)
+
+
+
## Links
* [Features](#features)
* [Installation](#installation)
+ * [Importing the library](#importing-the-library)
* [Quick start](#quick-start)
* [Browser usage](#browser-usage)
* [API documentation](https://github.com/schoero/SwissQRBill/blob/master/doc/api.md)
@@ -50,15 +54,18 @@ With SwissQRBill you can easily generate the new QR Code payment slips in Node.j
* [QR bill specifications](https://www.paymentstandards.ch/dam/downloads/ig-qr-bill-en.pdf)
+
+
## Features
- - Generates PDF with scalable vector graphics
- - Works in browser and node
- - Supports german, english, italian and french invoices
- - Supports A4 invoices as well as A6/5 (QR bill only)
- - Allows you to add other content above the invoice using [PDFKit](https://github.com/foliojs/pdfkit)
- - Easy to use
- - Free and open source
+ - Generate complete invoices, or only the QR Bill, as a PDF file.
+ - Generate the QR Bill as a scalable vector graphic (SVG).
+ - Works in browsers and Node.js.
+ - Supports german, english, italian and french invoices.
+ - Allows you to add other content above the invoice using [PDFKit](https://github.com/foliojs/pdfkit).
+ - Easy to use.
+ - Free and open source.
+
## Installation
@@ -66,12 +73,70 @@ With SwissQRBill you can easily generate the new QR Code payment slips in Node.j
npm i swissqrbill --save
```
+
+
+## Importing the library
+
+### Node.js
+
+In versions prior to v3.0.0, you could simply include SwissQRBill like this:
+
+```js
+const SwissQRBill = require("swissqrbill"); // CommonJS. Not tree-shakeable.
+```
+
+
+
+While you can still do this, it is recommended to switch to the new ES module imports to be able to take advantage of tree-shaking. SwissQRBill uses the new [conditional exports feature](https://nodejs.org/api/packages.html#packages_exports_sugar) that was added in node v12.16.0 or v13.6.0.
+
+This allows you to import only the parts of SwissQRBill that you actually need.
+
+```js
+import { PDF } from "swissqrbill/pdf"; // ESM. Tree-shakeable
+import { SVG } from "swissqrbill/svg"; // ESM. Tree-shakeable
+import { mm2pt } from "swissqrbill/utils"; // ESM. Tree-shakeable
+```
+
+
+
+Unfortunately, TypeScript with a version prior to the upcoming [version 4.5](https://github.com/microsoft/TypeScript/issues/45418), and Node.js prior to v12.16.0 or v13.6.0, do not support this feature.
+If you are using a TypeScript or Node.js version, that doesn't support the new export feature, you can still take advantage of tree-shaking, by importing the files directly by their path.
+
+```js
+import { PDF } from "swissqrbill/lib/node/esm/node/pdf.js"; // ESM. Tree-shakeable
+import { SVG } from "swissqrbill/lib/node/esm/node/svg.js"; // ESM. Tree-shakeable
+import { mm2pt } from "swissqrbill/lib/node/esm/shared/utils.js"; // ESM. Tree-shakeable
+```
+
+
+
+### Browser
+
+For the browser it is a bit more complicated. The easiest way would be to include the pre-bundled version.
+
+```html
+
+```
+
+You can also import the bundle directly, if you are using a bundler like webpack.
+
+```js
+import SwissQRBill from "swissqrbill/lib/browser/bundle";
+```
+
+However, if you want to take advantage of tree-shaking in the browser, you have to bundle the library by yourself.
+You can find an example, how this could be done using webpack, at https://github.com/schoero/SwissQRBill-browser-example.
+
+
+
+
+
## Quick start
-It's quite easy to create a simple QR bill. All you have to do is create a new `SwissQRBill.PDF` instance and pass your billing data object as the first parameter and your output path as the second parameter.
+Once you have imported SwissQRBill, it is quite easy to create a simple QR bill. All you have to do is to create a new `SwissQRBill.PDF` instance and pass your billing data object as the first parameter and your output path as the second parameter.
```js
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -94,24 +159,28 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "qrbill.pdf", () => {
+const pdf = new PDF(data, "qrbill.pdf", () => {
console.log("PDF has been successfully created.");
});
```
-This will create the above PDF file. You can pass an optional third parameter containing options such as language or size etc. as well as a callback function that gets called right after the file has finished writing.
+This will create the PDF file above. You can pass an optional third parameter containing options such as language or size etc. as well as a callback function that gets called right after the file has finished writing.
A complete documentation for all methods and parameters can be found in [doc/api.md](https://github.com/schoero/SwissQRBill/blob/master/doc/api.md).
+
## Browser usage
+> **Note:** Please read the [importing the library](#importing-the-library) section above, how you should import the library for browser usage.
+
To use SwissQRBill inside browsers, you have to pass a writableStream in the second parameter, instead of the output path. To create a writableStream in the browser you can use the built in `SwissQRBill.BlobStream()` function.
```js
-const stream = new SwissQRBill.BlobStream();
+import { PDF, BlobStream } from "swissqrbill/pdf";
-const pdf = new SwissQRBill.PDF(data, stream);
+const stream = new BlobStream();
+const pdf = new PDF(data, stream);
pdf.on("finish", () => {
const iframe = document.getElementById("iframe");
@@ -122,13 +191,20 @@ pdf.on("finish", () => {
});
```
-You can see a fully working example at https://github.com/schoero/SwissQRBill-browser-example.
+Alternatively, you could render the QR Bill as a scalable vector graphic (SVG). But keep in mind, using SVG you can only render the QR Bill part and not an entire invoice.
+
+```js
+import { SVG } from "swissqrbill/svg";
+const svg = new SVG(data);
+document.body.appendChild(svg.element);
+```
+
## Further informations
-SwissQRBill extends [PDFKit](https://github.com/foliojs/pdfkit) to generate PDF files and adds a few extra methods. You can generate a complete PDF bill using the original PDFKit methods and the additional methods documented in [doc/api.md](https://github.com/schoero/SwissQRBill/tree/master/doc/api.md#methods).
+SwissQRBill.PDF extends [PDFKit](https://github.com/foliojs/pdfkit) to generate PDF files and adds a few extra methods. You can generate a complete PDF bill using the original PDFKit methods and the additional methods documented in [doc/api.md](https://github.com/schoero/SwissQRBill/tree/master/doc/api.md#methods).
The documentation for PDFKit can be found [here](http://pdfkit.org/docs/getting_started.html).
A simple guide how to generate a complete bill can be found in [doc/how-to-create-a-complete-bill.md](https://github.com/schoero/SwissQRBill/blob/master/doc/how-to-create-a-complete-bill.md). You will learn how to create a PDF that looks like this:
diff --git a/doc/api.md b/doc/api.md
index 75966ee..53d595d 100644
--- a/doc/api.md
+++ b/doc/api.md
@@ -16,6 +16,17 @@
+# SwissQRBill.SVG
+
+- Constructor
+ - [SwissQRBill.SVG(data[, options])](#swissqrbillsvgdata-options)
+- Methods
+ - [toString()](#tostring)
+- Getters
+ - [element](#element)
+
+
+
# SwissQRBill.BlobStream
- Constructor
@@ -42,7 +53,10 @@
- Amount
- [formatAmount(amount)](#formatamountamount)
- Other
- - [mmToPoints(mm)](#mmtopointsmm)
+ - [mm2pt(millimeters)](#mm2ptmillimeters)
+ - [pt2mm(points)](#pt2mmpoints)
+ - [mm2px(millimeters)](#mm2pxmillimeters)
+ - [px2mm(pixels)](#px2mmpixels)
@@ -85,7 +99,7 @@
> First name + last name or company name.
- **account** - `string` *mandatory*, 21 characters.
- **address** - `string` *mandatory*, max 70 characters.
- - **houseNumber** - `string | number` *optional*, max 16 characters.
+ - **buildingNumber** - `string | number` *optional*, max 16 characters.
- **zip** - `number | string` *mandatory*, max 16 characters.
- **city** - `string` *mandatory*, max 35 characters.
- **country** - `string` *mandatory*, 2 characters.
@@ -93,13 +107,13 @@
- **name** - `string` *mandatory*, max. 70 characters.
> First name + last name or company name.
- **address** - `string` *mandatory*, max 70 characters.
- - **houseNumber** - `string | number` *optional*, max 16 characters.
+ - **buildingNumber** - `string | number` *optional*, max 16 characters.
- **zip** - `number | string` *mandatory*, max 16 characters.
- **city** - `string` *mandatory*, max 35 characters.
- **country** - `string` *mandatory*, 2 characters.
-#### options
+##### options
Available options:
@@ -128,7 +142,7 @@ const data = {
creditor: {
name: "Robert Schneider AG",
address: "Rue du Lac",
- houseNumber: "1268",
+ buildingNumber: "1268",
zip: 2501,
city: "Biel",
account: "CH4431999123000889012",
@@ -137,7 +151,7 @@ const data = {
debtor: {
name: "Pia-Maria Rutschmann-Schnyder",
address: "Grosse Marktgasse",
- houseNumber: 28,
+ buildingNumber: 28,
zip: 9400,
city: "Rorschach",
country: "CH"
@@ -244,6 +258,45 @@ This could be used to add page numbers to the pages as described [here](http://p
+
+# SwissQRBill.SVG
+## Constructor
+
+#### SwissQRBill.SVG(data[, options])
+
+ - [**data**](#data-1) - `object` containing all relevant billing data, *mandatory*.
+ - [**options**](#options-1) - `object` containing settings, *optional*.
+
+##### data
+
+ The data object is the same as the [data object](#data) in the PDF constructor above.
+
+##### options
+
+ Available options:
+
+ - **language** - `string: "DE" | "EN" | "IT" | "FR"`. *default* `"DE"`.
+
+
+
+## Methods
+
+### toString()
+Returns the outerHTML of the SVG.
+
+
+## Getters
+
+### element
+Returns the SVG element.
+> **Note:** This function is only available in the browser.
+
+```js
+const svg = new SVG(data);
+document.body.appendChild(svg.element);
+```
+
+
# SwissQRBill.BlobStream
## Constructor
@@ -333,7 +386,22 @@ Returns a `string` containing the formatted amount.
### Other
-#### mmToPoints(mm)
- - mm - `number` containg the millimeters you want to convert to points.
+#### mm2pt(millimeters)
+ - millimeters - `number` containg the millimeters you want to convert to points.
Converts milimeters to points. This method can be used to simplify positioning while you create your own layout using PDFKit.
Returns a `number` containing the converted millimeters in points.
+
+#### pt2mm(points)
+ - points - `number` containg the points you want to convert to millimeters.
+ Converts points to millimeters. This method can be used to simplify positioning while you create your own layout using PDFKit.
+ Returns a `number` containing the converted points in millimeters.
+
+#### mm2px(millimeters)
+ - millimeters - `number` containg the millimeters you want to convert to pixels.
+ Converts milimeters to pixels. This method can be used to simplify positioning while you create your own layout using PDFKit.
+ Returns a `number` containing the converted millimeters in pixels.
+
+#### px2mm(pixels)
+ - pixels - `number` containg the pixels you want to convert to millimeters.
+ Converts pixels to millimeters. This method can be used to simplify positioning while you create your own layout using PDFKit.
+ Returns a `number` containing the converted pixels in millimeters.
diff --git a/doc/how-to-create-a-complete-bill.md b/doc/how-to-create-a-complete-bill.md
index 89be555..cef9117 100644
--- a/doc/how-to-create-a-complete-bill.md
+++ b/doc/how-to-create-a-complete-bill.md
@@ -19,7 +19,8 @@ npm i swissqrbill --save
Then you are able to include SwissQRBill to your project.
```js
-const SwissQRBill = require("swissqrbill");
+import PDF from "swissqrbill/pdf";
+import mm2pt from "swissqrbill/utils";
```
Once everything is set up we can start with creating a data object which contains the necessarry payment informations. These informations could be generated automatically by your program, or be retreived from your database.
@@ -54,7 +55,7 @@ Once we have our data ready we can create a new instance of `SwissQRBill` and st
```js
-const pdf = new SwissQRBill.PDF(data, "complete-qr-bill.pdf", { "autoGenerate": false, "size": "A4" });
+const pdf = new PDF(data, "complete-qr-bill.pdf", { "autoGenerate": false, "size": "A4" });
```
Please note that we have set `autoGenerate` to `false` and `size` to `A4`.
@@ -71,21 +72,21 @@ const logo = "M2 2h7v7H2V2zm1.05 5.95h4.9v-4.9h-4.9v4.9zM7 4H4v3h3V4zm16 13h1v2h
const logoText = "M45.264 20.48c0 .907-.25 1.59-.752 2.048-.49.448-1.2.672-2.128.672h-2.112v-1.216h2.272c.395 0 .715-.117.96-.352s.368-.517.368-.848V19.12c0-.32-.085-.576-.256-.768-.16-.203-.405-.304-.736-.304h-.32c-.79 0-1.413-.23-1.872-.688-.459-.47-.688-1.147-.688-2.032v-.608c0-.907.245-1.584.736-2.032.501-.459 1.216-.688 2.144-.688h2.128v1.216H42.72c-.395 0-.715.117-.96.352a1.131 1.131 0 0 0-.368.848v1.216c0 .33.107.608.32.832.213.213.49.32.832.32h.32c.757 0 1.344.219 1.76.656.427.437.64 1.099.64 1.984v1.056zM53.851 23.2h-2.096l-1.008-4.336-1.104 4.336h-2.048l-1.6-8h1.408l1.296 6.976 1.424-5.536h1.36l1.328 5.536 1.296-6.976h1.328l-1.584 8zM56.634 13.44V12h1.52v1.44h-1.52zm.08 9.76v-8h1.36v8h-1.36zM64.22 21.2c0 .672-.208 1.173-.624 1.504-.406.33-.998.496-1.776.496h-2.064V22h2.224c.288 0 .506-.059.656-.176.149-.128.224-.31.224-.544v-.848c0-.48-.23-.72-.688-.72H61.9c-.747 0-1.307-.16-1.68-.48-.363-.33-.544-.848-.544-1.552v-.464c0-.715.202-1.227.608-1.536.405-.32 1.002-.48 1.792-.48H63.9v1.2h-1.984c-.267 0-.48.064-.64.192-.16.117-.24.293-.24.528v.576c0 .245.069.427.208.544.149.117.336.176.56.176h.224c.714 0 1.258.176 1.632.528.373.341.56.853.56 1.536v.72zM69.814 21.2c0 .672-.208 1.173-.624 1.504-.405.33-.997.496-1.776.496H65.35V22h2.224c.288 0 .507-.059.656-.176.15-.128.224-.31.224-.544v-.848c0-.48-.23-.72-.688-.72h-.272c-.747 0-1.307-.16-1.68-.48-.363-.33-.544-.848-.544-1.552v-.464c0-.715.203-1.227.608-1.536.405-.32 1.003-.48 1.792-.48h1.824v1.2H67.51c-.267 0-.48.064-.64.192-.16.117-.24.293-.24.528v.576c0 .245.07.427.208.544.15.117.336.176.56.176h.224c.715 0 1.259.176 1.632.528.373.341.56.853.56 1.536v.72zM76.237 22.896c-.416.203-.934.304-1.552.304h-.544c-.928 0-1.643-.224-2.144-.672-.491-.459-.736-1.141-.736-2.048v-5.76c0-.907.245-1.584.736-2.032.501-.459 1.216-.688 2.144-.688h.544c.928 0 1.637.23 2.128.688.501.448.752 1.125.752 2.032v5.76c0 .63-.128 1.147-.384 1.552l1.2 1.2-.912.912-1.232-1.248zm-.064-8.48c0-.33-.123-.613-.368-.848-.246-.235-.566-.352-.96-.352h-.864c-.395 0-.715.117-.96.352a1.131 1.131 0 0 0-.368.848v6.368c0 .33.122.613.368.848.245.235.565.352.96.352h.864c.405 0 .725-.101.96-.304.245-.213.368-.512.368-.896v-6.368zM82.3 18.56h-1.424v4.64h-1.392V12h2.864c.906 0 1.59.203 2.048.608.47.395.704 1.024.704 1.888v1.536c0 1.205-.48 1.957-1.44 2.256l2.224 4.912h-1.52L82.3 18.56zm1.408-4.208c0-.405-.096-.699-.288-.88-.182-.181-.475-.272-.88-.272h-1.664v4.16h1.664c.405 0 .698-.09.88-.272.192-.192.288-.49.288-.896v-1.84zM92.916 20.672c0 .917-.213 1.568-.64 1.952-.416.384-1.11.576-2.08.576h-3.04V12h2.848c.95 0 1.643.192 2.08.576.448.384.672 1.024.672 1.92v.912c0 .821-.293 1.44-.88 1.856.694.384 1.04 1.04 1.04 1.968v1.44zm-1.552-6.32c0-.405-.096-.699-.288-.88-.181-.181-.474-.272-.88-.272h-1.648v3.536h1.648c.33 0 .608-.107.832-.32.224-.213.336-.496.336-.848v-1.216zm.16 4.736c0-.352-.106-.63-.32-.832-.213-.213-.496-.32-.848-.32h-1.808V22h1.792c.406 0 .704-.09.896-.272.192-.192.288-.49.288-.896v-1.744zM94.669 13.44V12h1.52v1.44h-1.52zm.08 9.76v-8h1.36v8h-1.36zM99.31 23.2c-.362 0-.682-.128-.96-.384-.266-.256-.4-.661-.4-1.216V12h1.36v9.52c0 .17.043.293.129.368.085.075.229.112.432.112h.32v1.2h-.88zM102.671 23.2c-.363 0-.683-.128-.96-.384-.267-.256-.4-.661-.4-1.216V12h1.36v9.52c0 .17.042.293.128.368.085.075.229.112.432.112h.32v1.2h-.88z";
-pdf.addPath(logoBackground, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logoBackground, mm2pt(20), mm2pt(14))
.fillColor("#EA5151")
.fill();
-pdf.addPath(logo, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logo, mm2pt(20), mm2pt(14))
.fillColor("#FFFFFF")
.fill();
-pdf.addPath(logoText, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logoText, mm2pt(20), mm2pt(14))
.fillColor("#454141")
.fill();
```
-We use the `SwissQRBill.mmToPoints()` method to place the logo 2cm from the left side and 14mm from the top. Then we fill the path with our colors.
+We use the `SwissQRBill.mm2pt()` method to place the logo 2cm from the left side and 14mm from the top. Then we fill the path with our colors.
### Adding the addresses
@@ -95,17 +96,17 @@ Next, we add the address of our business and the customer address to the PDF. Yo
pdf.fontSize(12);
pdf.fillColor("black");
pdf.font("Helvetica");
-pdf.text(data.creditor.name + "\n" + data.creditor.address + "\n" + data.creditor.zip + " " + data.creditor.city, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(35), {
- width: SwissQRBill.utils.mmToPoints(100),
- height: SwissQRBill.utils.mmToPoints(50),
+pdf.text(data.creditor.name + "\n" + data.creditor.address + "\n" + data.creditor.zip + " " + data.creditor.city, mm2pt(20), mm2pt(35), {
+ width: mm2pt(100),
+ height: mm2pt(50),
align: "left"
});
pdf.fontSize(12);
pdf.font("Helvetica");
-pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip + " " + data.debtor.city, SwissQRBill.utils.mmToPoints(130), SwissQRBill.utils.mmToPoints(60), {
- width: SwissQRBill.utils.mmToPoints(70),
- height: SwissQRBill.utils.mmToPoints(50),
+pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip + " " + data.debtor.city, mm2pt(130), mm2pt(60), {
+ width: mm2pt(70),
+ height: mm2pt(50),
align: "left"
});
@@ -117,8 +118,8 @@ pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip
```js
pdf.fontSize(14);
pdf.font("Helvetica-Bold");
-pdf.text("Rechnung Nr. 1071672", SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(100), {
- width: SwissQRBill.utils.mmToPoints(170),
+pdf.text("Rechnung Nr. 1071672", mm2pt(20), mm2pt(100), {
+ width: mm2pt(170),
align: "left"
});
@@ -127,7 +128,7 @@ const date = new Date();
pdf.fontSize(11);
pdf.font("Helvetica");
pdf.text("Musterstadt " + date.getDate() + "." + (date.getMonth() + 1) + "." + date.getFullYear(), {
- width: SwissQRBill.utils.mmToPoints(170),
+ width: mm2pt(170),
align: "right"
});
```
@@ -139,7 +140,7 @@ To create a table we can use the `addTable()` method.
```js
const table = {
- width: SwissQRBill.utils.mmToPoints(170),
+ width: mm2pt(170),
rows: [
{
height: 30,
@@ -147,45 +148,45 @@ const table = {
columns: [
{
text: "Position",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Anzahl",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Bezeichnung"
}, {
text: "Total",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "1",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "14 Std.",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Programmierung SwissQRBill"
}, {
text: "CHF 1'540.00",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "2",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "8 Std.",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Dokumentation"
}, {
text: "CHF 880.00",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
@@ -193,47 +194,47 @@ const table = {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Summe",
font: "Helvetica-Bold"
}, {
text: "CHF 2'420.00",
font: "Helvetica-Bold",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "MwSt."
}, {
text: "7.7%",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "MwSt. Betrag"
}, {
text: "CHF 186.35",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
@@ -241,16 +242,16 @@ const table = {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Rechnungstotal",
font: "Helvetica-Bold"
}, {
text: "CHF 2'606.35",
- width: SwissQRBill.utils.mmToPoints(30),
+ width: mm2pt(30),
font: "Helvetica-Bold"
}
]
@@ -277,9 +278,9 @@ Once our document is finished, we have to call the `end()` method to finalize th
pdf.end();
```
-We also have to wait until the file has been finished writing before we are able to interact with the generated pdf file. We can do this either by passing a callback function as the last parameter to `new SwissQRBill()` or by listening for the `finish` event on the SwissQRBill instance. You can find examples using callbacks and events in [examples/callback.js](https://github.com/schoero/SwissQRBill/tree/master/examples/callback.js) and [examples/event.js](https://github.com/schoero/SwissQRBill/tree/master/examples/event.js)
+We also have to wait until the file has been finished writing before we are able to interact with the generated pdf file. We can do this either by passing a callback function as the last parameter to `new SwissQRBill()` or by listening for the `finish` event on the SwissQRBill instance. You can find examples using callbacks and events in [examples/callback.mjs](https://github.com/schoero/SwissQRBill/tree/master/examples/callback.mjs) and [examples/event.mjs](https://github.com/schoero/SwissQRBill/tree/master/examples/event.mjs)
-The complete code can be found in [examples/how-to-create-a-complete-bill.js](https://github.com/schoero/SwissQRBill/tree/master/examples/how-to-create-a-complete-bill.js).
+The complete code can be found in [examples/how-to-create-a-complete-bill.mjs](https://github.com/schoero/SwissQRBill/tree/master/examples/how-to-create-a-complete-bill.mjs).
When you run the code above, SwissQRBill should generate a PDF file name complete-qr-bill.pdf that looks like this:
diff --git a/examples/qr-iban.js b/examples/a4.mjs
similarity index 80%
rename from examples/qr-iban.js
rename to examples/a4.mjs
index 48df2dc..516dce9 100644
--- a/examples/qr-iban.js
+++ b/examples/a4.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/qr-iban.pdf");
\ No newline at end of file
+const pdf = new PDF(data, "./output/a4.pdf", { "size": "A4" });
\ No newline at end of file
diff --git a/tests/a6-5.js b/examples/a6.mjs
similarity index 78%
rename from tests/a6-5.js
rename to examples/a6.mjs
index b4d40d8..36d4bd9 100644
--- a/tests/a6-5.js
+++ b/examples/a6.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("../");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/a6-5.pdf", { "size": "A6/5" });
\ No newline at end of file
+const pdf = new PDF(data, "./output/a6.pdf", { "size": "A6/5" });
\ No newline at end of file
diff --git a/examples/browser.js b/examples/browser.js
index 39c26ad..c361ce0 100644
--- a/examples/browser.js
+++ b/examples/browser.js
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill/lib/browser");
+import SwissQRBill from "swissqrbill/bundle";
const data = {
currency: "CHF",
@@ -23,7 +23,6 @@ const data = {
const stream = new SwissQRBill.BlobStream();
-
const pdf = new SwissQRBill.PDF(data, stream);
pdf.on("finish", () => {
diff --git a/examples/callback.js b/examples/callback.mjs
similarity index 80%
rename from examples/callback.js
rename to examples/callback.mjs
index 5015880..e9186d1 100644
--- a/examples/callback.js
+++ b/examples/callback.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,6 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/callback.pdf", () => {
+const pdf = new PDF(data, "./output/callback.pdf", () => {
console.log("File has been successfully created.");
});
\ No newline at end of file
diff --git a/examples/event.js b/examples/event.mjs
similarity index 82%
rename from examples/event.js
rename to examples/event.mjs
index c6bd043..a7283fa 100644
--- a/examples/event.js
+++ b/examples/event.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,7 +21,7 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/event.pdf");
+const pdf = new PDF(data, "./output/event.pdf");
pdf.on("finish", () => {
console.log("File has been successfully created.");
diff --git a/examples/how-to-create-a-complete-bill.js b/examples/how-to-create-a-complete-bill.mjs
similarity index 78%
rename from examples/how-to-create-a-complete-bill.js
rename to examples/how-to-create-a-complete-bill.mjs
index fbabca0..140cf2c 100644
--- a/examples/how-to-create-a-complete-bill.js
+++ b/examples/how-to-create-a-complete-bill.mjs
@@ -1,4 +1,5 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
+import { mm2pt } from "swissqrbill/utils";
//-- SVG paths for the logo
@@ -31,20 +32,20 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "complete-qr-bill.pdf", { "autoGenerate": false, "size": "A4" });
+const pdf = new PDF(data, "complete-qr-bill.pdf", { "autoGenerate": false, "size": "A4" });
//-- Add logo
-pdf.addPath(logoBackground, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logoBackground, mm2pt(20), mm2pt(14))
.fillColor("#EA5151")
.fill();
-pdf.addPath(logo, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logo, mm2pt(20), mm2pt(14))
.fillColor("#FFFFFF")
.fill();
-pdf.addPath(logoText, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(14))
+pdf.addPath(logoText, mm2pt(20), mm2pt(14))
.fillColor("#454141")
.fill();
@@ -54,9 +55,9 @@ pdf.addPath(logoText, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPo
pdf.fontSize(12);
pdf.fillColor("black");
pdf.font("Helvetica");
-pdf.text(data.creditor.name + "\n" + data.creditor.address + "\n" + data.creditor.zip + " " + data.creditor.city, SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(35), {
- width: SwissQRBill.utils.mmToPoints(100),
- height: SwissQRBill.utils.mmToPoints(50),
+pdf.text(data.creditor.name + "\n" + data.creditor.address + "\n" + data.creditor.zip + " " + data.creditor.city, mm2pt(20), mm2pt(35), {
+ width: mm2pt(100),
+ height: mm2pt(50),
align: "left"
});
@@ -65,9 +66,9 @@ pdf.text(data.creditor.name + "\n" + data.creditor.address + "\n" + data.credito
pdf.fontSize(12);
pdf.font("Helvetica");
-pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip + " " + data.debtor.city, SwissQRBill.utils.mmToPoints(130), SwissQRBill.utils.mmToPoints(60), {
- width: SwissQRBill.utils.mmToPoints(70),
- height: SwissQRBill.utils.mmToPoints(50),
+pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip + " " + data.debtor.city, mm2pt(130), mm2pt(60), {
+ width: mm2pt(70),
+ height: mm2pt(50),
align: "left"
});
@@ -76,8 +77,8 @@ pdf.text(data.debtor.name + "\n" + data.debtor.address + "\n" + data.debtor.zip
pdf.fontSize(14);
pdf.font("Helvetica-Bold");
-pdf.text("Rechnung Nr. 1071672", SwissQRBill.utils.mmToPoints(20), SwissQRBill.utils.mmToPoints(100), {
- width: SwissQRBill.utils.mmToPoints(170),
+pdf.text("Rechnung Nr. 1071672", mm2pt(20), mm2pt(100), {
+ width: mm2pt(170),
align: "left"
});
@@ -86,7 +87,7 @@ const date = new Date();
pdf.fontSize(11);
pdf.font("Helvetica");
pdf.text("Musterstadt " + date.getDate() + "." + (date.getMonth() + 1) + "." + date.getFullYear(), {
- width: SwissQRBill.utils.mmToPoints(170),
+ width: mm2pt(170),
align: "right"
});
@@ -94,7 +95,7 @@ pdf.text("Musterstadt " + date.getDate() + "." + (date.getMonth() + 1) + "." + d
//-- Add table
const table = {
- width: SwissQRBill.utils.mmToPoints(170),
+ width: mm2pt(170),
rows: [
{
height: 30,
@@ -102,45 +103,45 @@ const table = {
columns: [
{
text: "Position",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Anzahl",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Bezeichnung"
}, {
text: "Total",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "1",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "14 Std.",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Programmierung SwissQRBill"
}, {
text: "CHF 1'540.00",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "2",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "8 Std.",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Dokumentation"
}, {
text: "CHF 880.00",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
@@ -148,47 +149,47 @@ const table = {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Summe",
font: "Helvetica-Bold"
}, {
text: "CHF 2'420.00",
font: "Helvetica-Bold",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "MwSt."
}, {
text: "7.7%",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "MwSt. Betrag"
}, {
text: "CHF 186.35",
- width: SwissQRBill.utils.mmToPoints(30)
+ width: mm2pt(30)
}
]
}, {
@@ -196,16 +197,16 @@ const table = {
columns: [
{
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "",
- width: SwissQRBill.utils.mmToPoints(20)
+ width: mm2pt(20)
}, {
text: "Rechnungstotal",
font: "Helvetica-Bold"
}, {
text: "CHF 2'606.35",
- width: SwissQRBill.utils.mmToPoints(30),
+ width: mm2pt(30),
font: "Helvetica-Bold"
}
]
diff --git a/examples/multipage.js b/examples/multipage.js
deleted file mode 100644
index f8ac6e2..0000000
--- a/examples/multipage.js
+++ /dev/null
@@ -1,50 +0,0 @@
-const SwissQRBill = require("swissqrpdf");
-
-const data = {
- currency: "CHF",
- amount: 1199.95,
- reference: "210000000003139471430009017",
- creditor: {
- name: "Robert Schneider AG",
- address: "Rue du Lac 1268",
- zip: 2501,
- city: "Biel",
- account: "CH4431999123000889012",
- country: "CH"
- },
- debtor: {
- name: "Pia-Maria Rutschmann-Schnyder",
- address: "Grosse Marktgasse 28",
- zip: 9400,
- city: "Rorschach",
- country: "CH"
- }
-};
-
-const pdf = new SwissQRBill.PDF(data, "./output/multipage.pdf", { "autoGenerate": false });
-
-pdf.fontSize(11);
-pdf.font("Helvetica-Bold");
-
-pdf.text("PAGE 1", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
-});
-
-pdf.addPage();
-
-pdf.text("PAGE 2", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
-});
-
-pdf.addPage();
-
-pdf.text("PAGE 3", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
-});
-
-pdf.addQRBill();
-
-pdf.end();
\ No newline at end of file
diff --git a/examples/multipage.mjs b/examples/multipage.mjs
new file mode 100644
index 0000000..b16e9c1
--- /dev/null
+++ b/examples/multipage.mjs
@@ -0,0 +1,50 @@
+import { PDF } from "swissqrbill/pdf";
+
+const data = {
+ currency: "CHF",
+ amount: 1199.95,
+ reference: "210000000003139471430009017",
+ creditor: {
+ name: "Robert Schneider AG",
+ address: "Rue du Lac 1268",
+ zip: 2501,
+ city: "Biel",
+ account: "CH4431999123000889012",
+ country: "CH"
+ },
+ debtor: {
+ name: "Pia-Maria Rutschmann-Schnyder",
+ address: "Grosse Marktgasse 28",
+ zip: 9400,
+ city: "Rorschach",
+ country: "CH"
+ }
+};
+
+const pdf = new PDF(data, "./output/multipage.pdf", { "autoGenerate": false });
+
+pdf.fontSize(11);
+pdf.font("Helvetica-Bold");
+
+pdf.text("PAGE 1", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
+});
+
+pdf.addPage();
+
+pdf.text("PAGE 2", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
+});
+
+pdf.addPage();
+
+pdf.text("PAGE 3", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
+});
+
+pdf.addQRBill();
+
+pdf.end();
\ No newline at end of file
diff --git a/examples/normal-iban-creditor-reference.js b/examples/normal-iban-creditor-reference.mjs
similarity index 76%
rename from examples/normal-iban-creditor-reference.js
rename to examples/normal-iban-creditor-reference.mjs
index 64d1b20..29b5a9f 100644
--- a/examples/normal-iban-creditor-reference.js
+++ b/examples/normal-iban-creditor-reference.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/normal-iban-creditor-reference.pdf");
\ No newline at end of file
+const pdf = new PDF(data, "./output/normal-iban-creditor-reference.pdf");
\ No newline at end of file
diff --git a/examples/normal-iban-no-reference.js b/examples/normal-iban-no-reference.mjs
similarity index 75%
rename from examples/normal-iban-no-reference.js
rename to examples/normal-iban-no-reference.mjs
index 262f2fc..cffde9a 100644
--- a/examples/normal-iban-no-reference.js
+++ b/examples/normal-iban-no-reference.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -20,4 +20,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/normal-iban-no-reference.pdf");
\ No newline at end of file
+const pdf = new PDF(data, "./output/normal-iban-no-reference.pdf");
\ No newline at end of file
diff --git a/examples/a4.js b/examples/qr-iban.mjs
similarity index 78%
rename from examples/a4.js
rename to examples/qr-iban.mjs
index 41878e7..2f0feb2 100644
--- a/examples/a4.js
+++ b/examples/qr-iban.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { PDF } from "swissqrbill/pdf";
const data = {
currency: "CHF",
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/a4.pdf", { "size": "A4" });
\ No newline at end of file
+const pdf = new PDF(data, "./output/qr-iban.pdf");
\ No newline at end of file
diff --git a/examples/a6.js b/examples/svg.mjs
similarity index 77%
rename from examples/a6.js
rename to examples/svg.mjs
index b1253e3..3c75001 100644
--- a/examples/a6.js
+++ b/examples/svg.mjs
@@ -1,4 +1,4 @@
-const SwissQRBill = require("swissqrbill");
+import { SVG } from "swissqrbill/svg";
const data = {
currency: "CHF",
@@ -21,4 +21,5 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/a6.pdf", { "size": "A6/5" });
\ No newline at end of file
+const svg = new SVG(data);
+console.log(svg.toString());
\ No newline at end of file
diff --git a/fix-exports.sh b/fix-exports.sh
new file mode 100644
index 0000000..2dc36d9
--- /dev/null
+++ b/fix-exports.sh
@@ -0,0 +1,17 @@
+cat >./lib/node/cjs/package.json <./lib/node/esm/package.json <./lib/browser/esm/package.json <=6.9.0"
+ }
},
"node_modules/@babel/highlight": {
- "version": "7.13.10",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz",
- "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==",
+ "version": "7.14.5",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
+ "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
"dev": true,
"dependencies": {
- "@babel/helper-validator-identifier": "^7.12.11",
+ "@babel/helper-validator-identifier": "^7.14.5",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=6.9.0"
}
},
"node_modules/@babel/highlight/node_modules/ansi-styles": {
@@ -101,6 +112,15 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
+ "node_modules/@babel/highlight/node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
"node_modules/@babel/highlight/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
@@ -123,9 +143,9 @@
}
},
"node_modules/@discoveryjs/json-ext": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz",
- "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==",
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz",
+ "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==",
"dev": true,
"engines": {
"node": ">=10.0.0"
@@ -233,9 +253,9 @@
}
},
"node_modules/@types/eslint": {
- "version": "7.2.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz",
- "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==",
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz",
+ "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==",
"dev": true,
"dependencies": {
"@types/estree": "*",
@@ -243,9 +263,9 @@
}
},
"node_modules/@types/eslint-scope": {
- "version": "3.7.0",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz",
- "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==",
+ "version": "3.7.1",
+ "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz",
+ "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==",
"dev": true,
"dependencies": {
"@types/eslint": "*",
@@ -259,16 +279,23 @@
"dev": true
},
"node_modules/@types/json-schema": {
- "version": "7.0.8",
- "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz",
- "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==",
+ "version": "7.0.9",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
+ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==",
"dev": true
},
"node_modules/@types/node": {
- "version": "16.7.2",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.2.tgz",
- "integrity": "sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw==",
- "dev": true
+ "version": "16.10.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.1.tgz",
+ "integrity": "sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w=="
+ },
+ "node_modules/@types/pdfkit": {
+ "version": "0.11.2",
+ "resolved": "https://registry.npmjs.org/@types/pdfkit/-/pdfkit-0.11.2.tgz",
+ "integrity": "sha512-4FS1b4ZqSdE4vrHIxpiaPbOIvELlssavpknaRRrdrRH7IgRvO6nbGeI3PEiC7vJSDfxQ8GBZwGVybqgUX4oqww==",
+ "dependencies": {
+ "@types/node": "*"
+ }
},
"node_modules/@types/qrcode": {
"version": "1.4.1",
@@ -292,13 +319,13 @@
"dev": true
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.3.tgz",
- "integrity": "sha512-tBgfA3K/3TsZY46ROGvoRxQr1wBkclbVqRQep97MjVHJzcRBURRY3sNFqLk0/Xr//BY5hM9H2p/kp+6qim85SA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz",
+ "integrity": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/experimental-utils": "4.29.3",
- "@typescript-eslint/scope-manager": "4.29.3",
+ "@typescript-eslint/experimental-utils": "4.31.2",
+ "@typescript-eslint/scope-manager": "4.31.2",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0",
@@ -323,15 +350,15 @@
}
},
"node_modules/@typescript-eslint/experimental-utils": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.3.tgz",
- "integrity": "sha512-ffIvbytTVWz+3keg+Sy94FG1QeOvmV9dP2YSdLFHw/ieLXWCa3U1TYu8IRCOpMv2/SPS8XqhM1+ou1YHsdzKrg==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz",
+ "integrity": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==",
"dev": true,
"dependencies": {
"@types/json-schema": "^7.0.7",
- "@typescript-eslint/scope-manager": "4.29.3",
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/typescript-estree": "4.29.3",
+ "@typescript-eslint/scope-manager": "4.31.2",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/typescript-estree": "4.31.2",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
},
@@ -346,33 +373,15 @@
"eslint": "*"
}
},
- "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "dependencies": {
- "eslint-visitor-keys": "^2.0.0"
- },
- "engines": {
- "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
- },
- "funding": {
- "url": "https://github.com/sponsors/mysticatea"
- },
- "peerDependencies": {
- "eslint": ">=5"
- }
- },
"node_modules/@typescript-eslint/parser": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.3.tgz",
- "integrity": "sha512-jrHOV5g2u8ROghmspKoW7pN8T/qUzk0+DITun0MELptvngtMrwUJ1tv5zMI04CYVEUsSrN4jV7AKSv+I0y0EfQ==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.2.tgz",
+ "integrity": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==",
"dev": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "4.29.3",
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/typescript-estree": "4.29.3",
+ "@typescript-eslint/scope-manager": "4.31.2",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/typescript-estree": "4.31.2",
"debug": "^4.3.1"
},
"engines": {
@@ -392,13 +401,13 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.3.tgz",
- "integrity": "sha512-x+w8BLXO7iWPkG5mEy9bA1iFRnk36p/goVlYobVWHyDw69YmaH9q6eA+Fgl7kYHmFvWlebUTUfhtIg4zbbl8PA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz",
+ "integrity": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/visitor-keys": "4.29.3"
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/visitor-keys": "4.31.2"
},
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@@ -409,9 +418,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.3.tgz",
- "integrity": "sha512-s1eV1lKNgoIYLAl1JUba8NhULmf+jOmmeFO1G5MN/RBCyyzg4TIOfIOICVNC06lor+Xmy4FypIIhFiJXOknhIg==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.2.tgz",
+ "integrity": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==",
"dev": true,
"engines": {
"node": "^8.10.0 || ^10.13.0 || >=11.10.1"
@@ -422,13 +431,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.3.tgz",
- "integrity": "sha512-45oQJA0bxna4O5TMwz55/TpgjX1YrAPOI/rb6kPgmdnemRZx/dB0rsx+Ku8jpDvqTxcE1C/qEbVHbS3h0hflag==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz",
+ "integrity": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/visitor-keys": "4.29.3",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/visitor-keys": "4.31.2",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@@ -449,12 +458,12 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.3.tgz",
- "integrity": "sha512-MGGfJvXT4asUTeVs0Q2m+sY63UsfnA+C/FDgBKV3itLBmM9H0u+URcneePtkd0at1YELmZK6HSolCqM4Fzs6yA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz",
+ "integrity": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==",
"dev": true,
"dependencies": {
- "@typescript-eslint/types": "4.29.3",
+ "@typescript-eslint/types": "4.31.2",
"eslint-visitor-keys": "^2.0.0"
},
"engines": {
@@ -707,6 +716,10 @@
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
}
},
"node_modules/ajv-keywords": {
@@ -737,9 +750,9 @@
}
},
"node_modules/ansi-regex": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
- "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
"engines": {
"node": ">=8"
}
@@ -753,6 +766,9 @@
},
"engines": {
"node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/argparse": {
@@ -764,12 +780,6 @@
"sprintf-js": "~1.0.2"
}
},
- "node_modules/array-filter": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz",
- "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=",
- "dev": true
- },
"node_modules/array-from": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz",
@@ -784,6 +794,18 @@
"node": ">=8"
}
},
+ "node_modules/assert": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz",
+ "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==",
+ "dev": true,
+ "dependencies": {
+ "es6-object-assign": "^1.1.0",
+ "is-nan": "^1.2.1",
+ "object-is": "^1.0.1",
+ "util": "^0.12.0"
+ }
+ },
"node_modules/ast-transform": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/ast-transform/-/ast-transform-0.0.0.tgz",
@@ -794,26 +816,6 @@
"through": "~2.3.4"
}
},
- "node_modules/ast-transform/node_modules/escodegen": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.2.0.tgz",
- "integrity": "sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=",
- "dependencies": {
- "esprima": "~1.0.4",
- "estraverse": "~1.5.0",
- "esutils": "~1.0.0"
- },
- "bin": {
- "escodegen": "bin/escodegen.js",
- "esgenerate": "bin/esgenerate.js"
- },
- "engines": {
- "node": ">=0.4.0"
- },
- "optionalDependencies": {
- "source-map": "~0.1.30"
- }
- },
"node_modules/ast-transform/node_modules/esprima": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
@@ -826,34 +828,6 @@
"node": ">=0.4.0"
}
},
- "node_modules/ast-transform/node_modules/estraverse": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
- "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=",
- "engines": {
- "node": ">=0.4.0"
- }
- },
- "node_modules/ast-transform/node_modules/esutils": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
- "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=",
- "engines": {
- "node": ">=0.10.0"
- }
- },
- "node_modules/ast-transform/node_modules/source-map": {
- "version": "0.1.43",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
- "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
- "optional": true,
- "dependencies": {
- "amdefine": ">=0.0.4"
- },
- "engines": {
- "node": ">=0.8.0"
- }
- },
"node_modules/ast-types": {
"version": "0.7.8",
"resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.7.8.tgz",
@@ -872,15 +846,15 @@
}
},
"node_modules/available-typed-arrays": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz",
- "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
+ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
"dev": true,
- "dependencies": {
- "array-filter": "^1.0.0"
- },
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/babel-runtime": {
@@ -893,15 +867,38 @@
}
},
"node_modules/balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
- "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/big.js": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
+ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
+ "dev": true,
+ "engines": {
+ "node": "*"
+ }
},
"node_modules/blob": {
"version": "0.0.4",
@@ -983,36 +980,63 @@
"browser-resolve": "^1.8.1"
}
},
+ "node_modules/browserify-zlib": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
+ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
+ "dev": true,
+ "dependencies": {
+ "pako": "~1.0.5"
+ }
+ },
+ "node_modules/browserify-zlib/node_modules/pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+ "dev": true
+ },
"node_modules/browserslist": {
- "version": "4.16.6",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",
- "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==",
+ "version": "4.17.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz",
+ "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==",
"dev": true,
"dependencies": {
- "caniuse-lite": "^1.0.30001219",
- "colorette": "^1.2.2",
- "electron-to-chromium": "^1.3.723",
+ "caniuse-lite": "^1.0.30001254",
+ "colorette": "^1.3.0",
+ "electron-to-chromium": "^1.3.830",
"escalade": "^3.1.1",
- "node-releases": "^1.1.71"
+ "node-releases": "^1.1.75"
},
"bin": {
"browserslist": "cli.js"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
}
},
- "node_modules/browserslist/node_modules/colorette": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
- "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
- "dev": true
- },
"node_modules/buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
"dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.2.1"
@@ -1027,9 +1051,9 @@
}
},
"node_modules/buffer-from": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"node_modules/call-bind": {
"version": "1.0.2",
@@ -1038,6 +1062,9 @@
"dependencies": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/callsites": {
@@ -1058,15 +1085,19 @@
}
},
"node_modules/caniuse-lite": {
- "version": "1.0.30001228",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",
- "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==",
- "dev": true
+ "version": "1.0.30001258",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001258.tgz",
+ "integrity": "sha512-RBByOG6xWXUp0CR2/WU2amXz3stjKpSl5J1xU49F1n2OxD//uBZO4wCKUiG+QMGf7CHGfDDcqoKriomoGVxTeA==",
+ "dev": true,
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/browserslist"
+ }
},
"node_modules/chalk": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
- "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"dependencies": {
"ansi-styles": "^4.1.0",
@@ -1074,6 +1105,9 @@
},
"engines": {
"node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/chrome-trace-event": {
@@ -1134,9 +1168,9 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"node_modules/colorette": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz",
- "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz",
+ "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==",
"dev": true
},
"node_modules/commander": {
@@ -1165,10 +1199,24 @@
"typedarray": "^0.0.6"
}
},
+ "node_modules/concat-stream/node_modules/readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
"node_modules/convert-source-map": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
- "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
+ "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
"dependencies": {
"safe-buffer": "~5.1.1"
}
@@ -1176,12 +1224,14 @@
"node_modules/core-js": {
"version": "2.6.12",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz",
- "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
+ "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==",
+ "deprecated": "core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.",
+ "hasInstallScript": true
},
"node_modules/core-util-is": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"node_modules/cross-spawn": {
"version": "7.0.3",
@@ -1217,15 +1267,20 @@
"integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA=="
},
"node_modules/debug": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
- "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
+ "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"dependencies": {
"ms": "2.1.2"
},
"engines": {
"node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
"node_modules/decamelize": {
@@ -1247,12 +1302,15 @@
"object-is": "^1.0.1",
"object-keys": "^1.1.1",
"regexp.prototype.flags": "^1.2.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/deep-is": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
- "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
},
"node_modules/define-properties": {
"version": "1.1.3",
@@ -1271,9 +1329,9 @@
"integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q=="
},
"node_modules/dijkstrajs": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz",
- "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs="
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.2.tgz",
+ "integrity": "sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg=="
},
"node_modules/dir-glob": {
"version": "3.0.1",
@@ -1307,10 +1365,24 @@
"readable-stream": "^2.0.2"
}
},
+ "node_modules/duplexer2/node_modules/readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
"node_modules/electron-to-chromium": {
- "version": "1.3.727",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz",
- "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==",
+ "version": "1.3.843",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.843.tgz",
+ "integrity": "sha512-OWEwAbzaVd1Lk9MohVw8LxMXFlnYd9oYTYxfX8KS++kLLjDfbovLOcEEXwRhG612dqGQ6+44SZvim0GXuBRiKg==",
"dev": true
},
"node_modules/emoji-regex": {
@@ -1318,15 +1390,24 @@
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
+ "node_modules/emojis-list": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
+ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
+ "dev": true,
+ "engines": {
+ "node": ">= 4"
+ }
+ },
"node_modules/encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"node_modules/enhanced-resolve": {
- "version": "5.8.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz",
- "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==",
+ "version": "5.8.3",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
+ "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.4",
@@ -1361,34 +1442,41 @@
}
},
"node_modules/es-abstract": {
- "version": "1.18.0-next.2",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz",
- "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==",
+ "version": "1.18.6",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz",
+ "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==",
"dev": true,
"dependencies": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2",
+ "get-intrinsic": "^1.1.1",
+ "get-symbol-description": "^1.0.0",
"has": "^1.0.3",
- "has-symbols": "^1.0.1",
- "is-callable": "^1.2.2",
+ "has-symbols": "^1.0.2",
+ "internal-slot": "^1.0.3",
+ "is-callable": "^1.2.4",
"is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.1",
- "object-inspect": "^1.9.0",
+ "is-regex": "^1.1.4",
+ "is-string": "^1.0.7",
+ "object-inspect": "^1.11.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.3",
- "string.prototype.trimstart": "^1.0.3"
+ "string.prototype.trimend": "^1.0.4",
+ "string.prototype.trimstart": "^1.0.4",
+ "unbox-primitive": "^1.0.1"
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/es-module-lexer": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz",
- "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==",
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.0.tgz",
+ "integrity": "sha512-qU2eN/XHsrl3E4y7mK1wdWnyy5c8gXtCbfP6Xcsemm7fPUR1PIV1JhZfP7ojcN0Fzp69CfrS3u76h2tusvfKiQ==",
"dev": true
},
"node_modules/es-to-primitive": {
@@ -1403,6 +1491,9 @@
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/es5-ext": {
@@ -1438,6 +1529,12 @@
"event-emitter": "~0.3.5"
}
},
+ "node_modules/es6-object-assign": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz",
+ "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=",
+ "dev": true
+ },
"node_modules/es6-set": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
@@ -1478,78 +1575,63 @@
}
},
"node_modules/escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"engines": {
- "node": ">=0.8.0"
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/escodegen": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
- "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.2.0.tgz",
+ "integrity": "sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=",
"dependencies": {
- "esprima": "^4.0.1",
- "estraverse": "^4.2.0",
- "esutils": "^2.0.2",
- "optionator": "^0.8.1",
- "source-map": "~0.6.1"
+ "esprima": "~1.0.4",
+ "estraverse": "~1.5.0",
+ "esutils": "~1.0.0"
},
"bin": {
"escodegen": "bin/escodegen.js",
"esgenerate": "bin/esgenerate.js"
},
"engines": {
- "node": ">=4.0"
+ "node": ">=0.4.0"
+ },
+ "optionalDependencies": {
+ "source-map": "~0.1.30"
}
},
- "node_modules/escodegen/node_modules/levn": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
- "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
- "dependencies": {
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2"
- },
- "engines": {
- "node": ">= 0.8.0"
- }
- },
- "node_modules/escodegen/node_modules/optionator": {
- "version": "0.8.3",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
- "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
- "dependencies": {
- "deep-is": "~0.1.3",
- "fast-levenshtein": "~2.0.6",
- "levn": "~0.3.0",
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2",
- "word-wrap": "~1.2.3"
+ "node_modules/escodegen/node_modules/esprima": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
+ "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0=",
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
},
"engines": {
- "node": ">= 0.8.0"
+ "node": ">=0.4.0"
}
},
- "node_modules/escodegen/node_modules/prelude-ls": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
- "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
+ "node_modules/escodegen/node_modules/estraverse": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
+ "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E=",
"engines": {
- "node": ">= 0.8.0"
+ "node": ">=0.4.0"
}
},
- "node_modules/escodegen/node_modules/type-check": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
- "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
- "dependencies": {
- "prelude-ls": "~1.1.2"
- },
+ "node_modules/escodegen/node_modules/esutils": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
+ "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA=",
"engines": {
- "node": ">= 0.8.0"
+ "node": ">=0.10.0"
}
},
"node_modules/eslint": {
@@ -1623,6 +1705,33 @@
}
},
"node_modules/eslint-utils": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
+ "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
+ "dev": true,
+ "dependencies": {
+ "eslint-visitor-keys": "^2.0.0"
+ },
+ "engines": {
+ "node": "^10.0.0 || ^12.0.0 || >= 14.0.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mysticatea"
+ },
+ "peerDependencies": {
+ "eslint": ">=5"
+ }
+ },
+ "node_modules/eslint-visitor-keys": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
+ "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/eslint/node_modules/eslint-utils": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
"integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
@@ -1632,9 +1741,12 @@
},
"engines": {
"node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mysticatea"
}
},
- "node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
+ "node_modules/eslint/node_modules/eslint-utils/node_modules/eslint-visitor-keys": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
"integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
@@ -1643,27 +1755,6 @@
"node": ">=4"
}
},
- "node_modules/eslint-visitor-keys": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
- "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
- "dev": true,
- "engines": {
- "node": ">=10"
- }
- },
- "node_modules/eslint/node_modules/escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true,
- "engines": {
- "node": ">=10"
- },
- "funding": {
- "url": "https://github.com/sponsors/sindresorhus"
- }
- },
"node_modules/espree": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz",
@@ -1781,9 +1872,9 @@
}
},
"node_modules/execa": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
- "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.3",
@@ -1798,14 +1889,17 @@
},
"engines": {
"node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
"node_modules/ext": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
- "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/ext/-/ext-1.5.0.tgz",
+ "integrity": "sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q==",
"dependencies": {
- "type": "^2.0.0"
+ "type": "^2.5.0"
}
},
"node_modules/ext/node_modules/type": {
@@ -1853,9 +1947,9 @@
"dev": true
},
"node_modules/fastq": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz",
- "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==",
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
+ "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
"dev": true,
"dependencies": {
"reusify": "^1.0.4"
@@ -1911,9 +2005,9 @@
}
},
"node_modules/flatted": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
- "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz",
+ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true
},
"node_modules/fontkit": {
@@ -1978,21 +2072,43 @@
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-stream": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
- "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true,
"engines": {
"node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/get-symbol-description": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
+ "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/glob": {
- "version": "7.1.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
- "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
+ "version": "7.1.7",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
+ "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
"dev": true,
"dependencies": {
"fs.realpath": "^1.0.0",
@@ -2004,6 +2120,9 @@
},
"engines": {
"node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/glob-parent": {
@@ -2025,9 +2144,9 @@
"dev": true
},
"node_modules/globals": {
- "version": "13.10.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz",
- "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==",
+ "version": "13.11.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz",
+ "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==",
"dev": true,
"dependencies": {
"type-fest": "^0.20.2"
@@ -2069,9 +2188,9 @@
}
},
"node_modules/graceful-fs": {
- "version": "4.2.5",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz",
- "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==",
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
+ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
"dev": true
},
"node_modules/has": {
@@ -2085,6 +2204,15 @@
"node": ">= 0.4.0"
}
},
+ "node_modules/has-bigints": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
+ "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
+ "dev": true,
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -2095,11 +2223,28 @@
}
},
"node_modules/has-symbols": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
- "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
+ "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-tostringtag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
+ "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
+ "dependencies": {
+ "has-symbols": "^1.0.2"
+ },
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/human-signals": {
@@ -2115,7 +2260,21 @@
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
"integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
- "dev": true
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
},
"node_modules/ignore": {
"version": "4.0.6",
@@ -2182,6 +2341,20 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
+ "node_modules/internal-slot": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
+ "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
+ "dev": true,
+ "dependencies": {
+ "get-intrinsic": "^1.1.0",
+ "has": "^1.0.3",
+ "side-channel": "^1.0.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
"node_modules/interpret": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz",
@@ -2192,39 +2365,83 @@
}
},
"node_modules/is-arguments": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz",
- "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==",
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
+ "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
+ "dependencies": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-bigint": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+ "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+ "dev": true,
+ "dependencies": {
+ "has-bigints": "^1.0.1"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-boolean-object": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+ "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
+ "dev": true,
"dependencies": {
- "call-bind": "^1.0.0"
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-callable": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
- "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
+ "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
"dev": true,
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-core-module": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
- "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz",
+ "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==",
"dependencies": {
"has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-date-object": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
- "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+ "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-extglob": {
@@ -2245,12 +2462,18 @@
}
},
"node_modules/is-generator-function": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz",
- "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==",
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
+ "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
"dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-glob": {
@@ -2265,6 +2488,22 @@
"node": ">=0.10.0"
}
},
+ "node_modules/is-nan": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz",
+ "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/is-negative-zero": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
@@ -2272,6 +2511,9 @@
"dev": true,
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-number": {
@@ -2283,6 +2525,21 @@
"node": ">=0.12.0"
}
},
+ "node_modules/is-number-object": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
+ "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
@@ -2296,53 +2553,80 @@
}
},
"node_modules/is-regex": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
- "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+ "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
"dependencies": {
"call-bind": "^1.0.2",
- "has-symbols": "^1.0.1"
+ "has-tostringtag": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
- "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
"dev": true,
"engines": {
"node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/is-string": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+ "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+ "dev": true,
+ "dependencies": {
+ "has-tostringtag": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-symbol": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
- "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
+ "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
"dev": true,
"dependencies": {
- "has-symbols": "^1.0.1"
+ "has-symbols": "^1.0.2"
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/is-typed-array": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.4.tgz",
- "integrity": "sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA==",
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz",
+ "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==",
"dev": true,
"dependencies": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.0",
- "es-abstract": "^1.18.0-next.1",
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "es-abstract": "^1.18.5",
"foreach": "^2.0.5",
- "has-symbols": "^1.0.1"
+ "has-tostringtag": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
- }
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/isarray": {
"version": "1.0.0",
@@ -2365,9 +2649,9 @@
}
},
"node_modules/jest-worker": {
- "version": "27.0.6",
- "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz",
- "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==",
+ "version": "27.2.0",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz",
+ "integrity": "sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA==",
"dev": true,
"dependencies": {
"@types/node": "*",
@@ -2430,6 +2714,18 @@
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
"dev": true
},
+ "node_modules/json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dev": true,
+ "dependencies": {
+ "minimist": "^1.2.0"
+ },
+ "bin": {
+ "json5": "lib/cli.js"
+ }
+ },
"node_modules/kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -2488,6 +2784,20 @@
"node": ">=6.11.5"
}
},
+ "node_modules/loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+ "dev": true,
+ "dependencies": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ }
+ },
"node_modules/locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -2582,21 +2892,21 @@
}
},
"node_modules/mime-db": {
- "version": "1.47.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
- "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
+ "version": "1.49.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
+ "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==",
"dev": true,
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
- "version": "2.1.30",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
- "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+ "version": "2.1.32",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
+ "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
"dev": true,
"dependencies": {
- "mime-db": "1.47.0"
+ "mime-db": "1.49.0"
},
"engines": {
"node": ">= 0.6"
@@ -2652,9 +2962,9 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node_modules/node-releases": {
- "version": "1.1.71",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz",
- "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==",
+ "version": "1.1.76",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz",
+ "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
"dev": true
},
"node_modules/npm-run-path": {
@@ -2670,9 +2980,12 @@
}
},
"node_modules/object-inspect": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz",
- "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw=="
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
+ "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
},
"node_modules/object-is": {
"version": "1.1.5",
@@ -2684,6 +2997,9 @@
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/object-keys": {
@@ -2707,6 +3023,9 @@
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/once": {
@@ -2728,6 +3047,9 @@
},
"engines": {
"node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/optionator": {
@@ -2782,6 +3104,9 @@
},
"engines": {
"node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/p-try": {
@@ -2981,23 +3306,23 @@
}
},
"node_modules/readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dev": true,
"dependencies": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
}
},
"node_modules/rechoir": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz",
- "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==",
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
+ "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
"dev": true,
"dependencies": {
"resolve": "^1.9.0"
@@ -3021,15 +3346,21 @@
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/regexpp": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
- "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
+ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
"dev": true,
"engines": {
"node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/mysticatea"
}
},
"node_modules/require-directory": {
@@ -3055,12 +3386,15 @@
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"node_modules/resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"dependencies": {
- "is-core-module": "^2.1.0",
+ "is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/resolve-cwd": {
@@ -3121,6 +3455,9 @@
},
"bin": {
"rimraf": "bin.js"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/run-parallel": {
@@ -3250,10 +3587,24 @@
"node": ">=8"
}
},
+ "node_modules/side-channel": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+ "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dev": true,
+ "dependencies": {
+ "call-bind": "^1.0.0",
+ "get-intrinsic": "^1.0.2",
+ "object-inspect": "^1.9.0"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/signal-exit": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
- "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz",
+ "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==",
"dev": true
},
"node_modules/slash": {
@@ -3283,23 +3634,36 @@
}
},
"node_modules/source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "version": "0.1.43",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
+ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
+ "optional": true,
+ "dependencies": {
+ "amdefine": ">=0.0.4"
+ },
"engines": {
- "node": ">=0.10.0"
+ "node": ">=0.8.0"
}
},
"node_modules/source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "version": "0.5.20",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz",
+ "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==",
"dev": true,
"dependencies": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
+ "node_modules/source-map-support/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/sourcemap-codec": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
@@ -3319,6 +3683,83 @@
"escodegen": "^1.11.1"
}
},
+ "node_modules/static-eval/node_modules/escodegen": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
+ "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+ "dependencies": {
+ "esprima": "^4.0.1",
+ "estraverse": "^4.2.0",
+ "esutils": "^2.0.2",
+ "optionator": "^0.8.1"
+ },
+ "bin": {
+ "escodegen": "bin/escodegen.js",
+ "esgenerate": "bin/esgenerate.js"
+ },
+ "engines": {
+ "node": ">=4.0"
+ },
+ "optionalDependencies": {
+ "source-map": "~0.6.1"
+ }
+ },
+ "node_modules/static-eval/node_modules/levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "dependencies": {
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-eval/node_modules/optionator": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "dependencies": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.6",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "word-wrap": "~1.2.3"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-eval/node_modules/prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-eval/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-eval/node_modules/type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+ "dependencies": {
+ "prelude-ls": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
"node_modules/static-module": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/static-module/-/static-module-3.0.4.tgz",
@@ -3340,28 +3781,95 @@
"through2": "~2.0.3"
}
},
- "node_modules/stream-browserify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz",
- "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==",
- "dev": true,
+ "node_modules/static-module/node_modules/escodegen": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
+ "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
"dependencies": {
- "inherits": "~2.0.4",
- "readable-stream": "^3.5.0"
+ "esprima": "^4.0.1",
+ "estraverse": "^4.2.0",
+ "esutils": "^2.0.2",
+ "optionator": "^0.8.1"
+ },
+ "bin": {
+ "escodegen": "bin/escodegen.js",
+ "esgenerate": "bin/esgenerate.js"
+ },
+ "engines": {
+ "node": ">=4.0"
+ },
+ "optionalDependencies": {
+ "source-map": "~0.6.1"
}
},
- "node_modules/stream-browserify/node_modules/readable-stream": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
- "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
- "dev": true,
+ "node_modules/static-module/node_modules/levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
"dependencies": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
},
"engines": {
- "node": ">= 6"
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-module/node_modules/optionator": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "dependencies": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.6",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "word-wrap": "~1.2.3"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-module/node_modules/prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=",
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/static-module/node_modules/readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "node_modules/static-module/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "optional": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/static-module/node_modules/type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+ "dependencies": {
+ "prelude-ls": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
}
},
"node_modules/string_decoder": {
@@ -3373,9 +3881,9 @@
}
},
"node_modules/string-width": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
+ "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
@@ -3386,23 +3894,29 @@
}
},
"node_modules/string.prototype.trimend": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
- "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
+ "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
"dev": true,
"dependencies": {
- "call-bind": "^1.0.0",
+ "call-bind": "^1.0.2",
"define-properties": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/string.prototype.trimstart": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
- "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
+ "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
"dev": true,
"dependencies": {
- "call-bind": "^1.0.0",
+ "call-bind": "^1.0.2",
"define-properties": "^1.1.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/strip-ansi": {
@@ -3449,10 +3963,10 @@
"node": ">=8"
}
},
- "node_modules/svg-parser": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz",
- "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ=="
+ "node_modules/svg-engine": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/svg-engine/-/svg-engine-0.2.0.tgz",
+ "integrity": "sha512-84JQzeAIEdztkhsR2hWZIR56A4HHxg3dojUqLsxfLR6FmJjSs4GOvRKQAIePDuofaIuFJR9A2tiuTIEf0+nWZw=="
},
"node_modules/svgpath": {
"version": "2.3.1",
@@ -3477,9 +3991,9 @@
}
},
"node_modules/table/node_modules/ajv": {
- "version": "8.6.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz",
- "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==",
+ "version": "8.6.3",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz",
+ "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==",
"dev": true,
"dependencies": {
"fast-deep-equal": "^3.1.1",
@@ -3499,23 +4013,23 @@
"dev": true
},
"node_modules/tapable": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz",
- "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==",
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
"dev": true,
"engines": {
"node": ">=6"
}
},
"node_modules/terser": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
- "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz",
+ "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==",
"dev": true,
"dependencies": {
"commander": "^2.20.0",
"source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
+ "source-map-support": "~0.5.20"
},
"bin": {
"terser": "bin/terser"
@@ -3525,17 +4039,17 @@
}
},
"node_modules/terser-webpack-plugin": {
- "version": "5.1.4",
- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz",
- "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==",
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz",
+ "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==",
"dev": true,
"dependencies": {
- "jest-worker": "^27.0.2",
+ "jest-worker": "^27.0.6",
"p-limit": "^3.1.0",
- "schema-utils": "^3.0.0",
+ "schema-utils": "^3.1.1",
"serialize-javascript": "^6.0.0",
"source-map": "^0.6.1",
- "terser": "^5.7.0"
+ "terser": "^5.7.2"
},
"engines": {
"node": ">= 10.13.0"
@@ -3546,6 +4060,26 @@
},
"peerDependencies": {
"webpack": "^5.1.0"
+ },
+ "peerDependenciesMeta": {
+ "@swc/core": {
+ "optional": true
+ },
+ "esbuild": {
+ "optional": true
+ },
+ "uglify-js": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/terser-webpack-plugin/node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
}
},
"node_modules/terser/node_modules/source-map": {
@@ -3577,6 +4111,20 @@
"xtend": "~4.0.1"
}
},
+ "node_modules/through2/node_modules/readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "dependencies": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
"node_modules/tiny-inflate": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz",
@@ -3594,10 +4142,19 @@
"node": ">=8.0"
}
},
+ "node_modules/transform-loader": {
+ "version": "0.2.4",
+ "resolved": "https://registry.npmjs.org/transform-loader/-/transform-loader-0.2.4.tgz",
+ "integrity": "sha1-5ch4d7qW1R0/IlNoWHtG4ibRzsk=",
+ "dev": true,
+ "dependencies": {
+ "loader-utils": "^1.0.2"
+ }
+ },
"node_modules/ts-loader": {
- "version": "9.2.5",
- "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.5.tgz",
- "integrity": "sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==",
+ "version": "9.2.6",
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz",
+ "integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==",
"dev": true,
"dependencies": {
"chalk": "^4.1.0",
@@ -3608,16 +4165,10 @@
"engines": {
"node": ">=12.0.0"
},
- "peerDependencies": {
- "typescript": "*",
- "webpack": "^5.0.0"
- }
- },
- "node_modules/tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
- "dev": true
+ "peerDependencies": {
+ "typescript": "*",
+ "webpack": "^5.0.0"
+ }
},
"node_modules/tsutils": {
"version": "3.21.0",
@@ -3634,6 +4185,12 @@
"typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta"
}
},
+ "node_modules/tsutils/node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
"node_modules/type": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
@@ -3669,9 +4226,9 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"node_modules/typescript": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
- "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
+ "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true,
"bin": {
"tsc": "bin/tsc",
@@ -3681,6 +4238,21 @@
"node": ">=4.2.0"
}
},
+ "node_modules/unbox-primitive": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
+ "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
+ "dev": true,
+ "dependencies": {
+ "function-bind": "^1.1.1",
+ "has-bigints": "^1.0.1",
+ "has-symbols": "^1.0.2",
+ "which-boxed-primitive": "^1.0.2"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/unicode-properties": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.3.1.tgz",
@@ -3737,9 +4309,9 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"node_modules/v8-compile-cache": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
- "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
+ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
"dev": true
},
"node_modules/watchpack": {
@@ -3756,9 +4328,9 @@
}
},
"node_modules/webpack": {
- "version": "5.51.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz",
- "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==",
+ "version": "5.54.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.54.0.tgz",
+ "integrity": "sha512-MAVKJMsIUotOQKzFOmN8ZkmMlj7BOyjDU6t1lomW9dWOme5WTStzGa3HMLdV1KYD1AiFETGsznL4LMSvj4tukw==",
"dev": true,
"dependencies": {
"@types/eslint-scope": "^3.7.0",
@@ -3770,8 +4342,8 @@
"acorn-import-assertions": "^1.7.6",
"browserslist": "^4.14.5",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.8.0",
- "es-module-lexer": "^0.7.1",
+ "enhanced-resolve": "^5.8.3",
+ "es-module-lexer": "^0.9.0",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
@@ -3856,9 +4428,9 @@
}
},
"node_modules/webpack-merge": {
- "version": "5.7.3",
- "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz",
- "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==",
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz",
+ "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==",
"dev": true,
"dependencies": {
"clone-deep": "^4.0.1",
@@ -3869,18 +4441,18 @@
}
},
"node_modules/webpack-sources": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz",
- "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==",
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz",
+ "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==",
"dev": true,
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/webpack/node_modules/acorn": {
- "version": "8.4.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
- "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
+ "version": "8.5.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
+ "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
"dev": true,
"bin": {
"acorn": "bin/acorn"
@@ -3913,27 +4485,45 @@
"node": ">= 8"
}
},
+ "node_modules/which-boxed-primitive": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
+ "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+ "dev": true,
+ "dependencies": {
+ "is-bigint": "^1.0.1",
+ "is-boolean-object": "^1.1.0",
+ "is-number-object": "^1.0.4",
+ "is-string": "^1.0.5",
+ "is-symbol": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
"node_modules/which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
},
"node_modules/which-typed-array": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz",
- "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==",
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz",
+ "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==",
"dev": true,
"dependencies": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.0",
- "es-abstract": "^1.18.0-next.1",
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "es-abstract": "^1.18.5",
"foreach": "^2.0.5",
- "function-bind": "^1.1.1",
- "has-symbols": "^1.0.1",
- "is-typed-array": "^1.1.3"
+ "has-tostringtag": "^1.0.0",
+ "is-typed-array": "^1.1.7"
},
"engines": {
"node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/wildcard": {
@@ -3978,9 +4568,9 @@
}
},
"node_modules/y18n": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
- "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ=="
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
},
"node_modules/yallist": {
"version": "4.0.0",
@@ -4045,18 +4635,18 @@
}
},
"@babel/helper-validator-identifier": {
- "version": "7.12.11",
- "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz",
- "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==",
+ "version": "7.15.7",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz",
+ "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==",
"dev": true
},
"@babel/highlight": {
- "version": "7.13.10",
- "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz",
- "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==",
+ "version": "7.14.5",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz",
+ "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==",
"dev": true,
"requires": {
- "@babel/helper-validator-identifier": "^7.12.11",
+ "@babel/helper-validator-identifier": "^7.14.5",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
@@ -4096,6 +4686,12 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
@@ -4114,9 +4710,9 @@
}
},
"@discoveryjs/json-ext": {
- "version": "0.5.2",
- "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.2.tgz",
- "integrity": "sha512-HyYEUDeIj5rRQU2Hk5HTB2uHsbRQpF70nvMhVzi+VJR0X+xNEhjPui4/kBf3VeH/wqD28PT4sVOm8qqLjBrSZg==",
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz",
+ "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==",
"dev": true
},
"@eslint/eslintrc": {
@@ -4200,9 +4796,9 @@
}
},
"@types/eslint": {
- "version": "7.2.10",
- "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.2.10.tgz",
- "integrity": "sha512-kUEPnMKrqbtpCq/KTaGFFKAcz6Ethm2EjCoKIDaCmfRBWLbFuTcOJfTlorwbnboXBzahqWLgUp1BQeKHiJzPUQ==",
+ "version": "7.28.0",
+ "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-7.28.0.tgz",
+ "integrity": "sha512-07XlgzX0YJUn4iG1ocY4IX9DzKSmMGUs6ESKlxWhZRaa0fatIWaHWUVapcuGa8r5HFnTqzj+4OCjd5f7EZ/i/A==",
"dev": true,
"requires": {
"@types/estree": "*",
@@ -4210,9 +4806,9 @@
}
},
"@types/eslint-scope": {
- "version": "3.7.0",
- "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.0.tgz",
- "integrity": "sha512-O/ql2+rrCUe2W2rs7wMR+GqPRcgB6UiqN5RhrR5xruFlY7l9YLMn0ZkDzjoHLeiFkR8MCQZVudUuuvQ2BLC9Qw==",
+ "version": "3.7.1",
+ "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.1.tgz",
+ "integrity": "sha512-SCFeogqiptms4Fg29WpOTk5nHIzfpKCemSN63ksBQYKTcXoJEmJagV+DhVmbapZzY4/5YaOV1nZwrsU79fFm1g==",
"dev": true,
"requires": {
"@types/eslint": "*",
@@ -4226,16 +4822,23 @@
"dev": true
},
"@types/json-schema": {
- "version": "7.0.8",
- "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz",
- "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==",
+ "version": "7.0.9",
+ "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz",
+ "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==",
"dev": true
},
"@types/node": {
- "version": "16.7.2",
- "resolved": "https://registry.npmjs.org/@types/node/-/node-16.7.2.tgz",
- "integrity": "sha512-TbG4TOx9hng8FKxaVrCisdaxKxqEwJ3zwHoCWXZ0Jw6mnvTInpaB99/2Cy4+XxpXtjNv9/TgfGSvZFyfV/t8Fw==",
- "dev": true
+ "version": "16.10.1",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-16.10.1.tgz",
+ "integrity": "sha512-4/Z9DMPKFexZj/Gn3LylFgamNKHm4K3QDi0gz9B26Uk0c8izYf97B5fxfpspMNkWlFupblKM/nV8+NA9Ffvr+w=="
+ },
+ "@types/pdfkit": {
+ "version": "0.11.2",
+ "resolved": "https://registry.npmjs.org/@types/pdfkit/-/pdfkit-0.11.2.tgz",
+ "integrity": "sha512-4FS1b4ZqSdE4vrHIxpiaPbOIvELlssavpknaRRrdrRH7IgRvO6nbGeI3PEiC7vJSDfxQ8GBZwGVybqgUX4oqww==",
+ "requires": {
+ "@types/node": "*"
+ }
},
"@types/qrcode": {
"version": "1.4.1",
@@ -4259,13 +4862,13 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.29.3.tgz",
- "integrity": "sha512-tBgfA3K/3TsZY46ROGvoRxQr1wBkclbVqRQep97MjVHJzcRBURRY3sNFqLk0/Xr//BY5hM9H2p/kp+6qim85SA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.31.2.tgz",
+ "integrity": "sha512-w63SCQ4bIwWN/+3FxzpnWrDjQRXVEGiTt9tJTRptRXeFvdZc/wLiz3FQUwNQ2CVoRGI6KUWMNUj/pk63noUfcA==",
"dev": true,
"requires": {
- "@typescript-eslint/experimental-utils": "4.29.3",
- "@typescript-eslint/scope-manager": "4.29.3",
+ "@typescript-eslint/experimental-utils": "4.31.2",
+ "@typescript-eslint/scope-manager": "4.31.2",
"debug": "^4.3.1",
"functional-red-black-tree": "^1.0.1",
"regexpp": "^3.1.0",
@@ -4274,66 +4877,55 @@
}
},
"@typescript-eslint/experimental-utils": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.29.3.tgz",
- "integrity": "sha512-ffIvbytTVWz+3keg+Sy94FG1QeOvmV9dP2YSdLFHw/ieLXWCa3U1TYu8IRCOpMv2/SPS8XqhM1+ou1YHsdzKrg==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.2.tgz",
+ "integrity": "sha512-3tm2T4nyA970yQ6R3JZV9l0yilE2FedYg8dcXrTar34zC9r6JB7WyBQbpIVongKPlhEMjhQ01qkwrzWy38Bk1Q==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.7",
- "@typescript-eslint/scope-manager": "4.29.3",
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/typescript-estree": "4.29.3",
+ "@typescript-eslint/scope-manager": "4.31.2",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/typescript-estree": "4.31.2",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
- },
- "dependencies": {
- "eslint-utils": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
- "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
- "dev": true,
- "requires": {
- "eslint-visitor-keys": "^2.0.0"
- }
- }
}
},
"@typescript-eslint/parser": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.29.3.tgz",
- "integrity": "sha512-jrHOV5g2u8ROghmspKoW7pN8T/qUzk0+DITun0MELptvngtMrwUJ1tv5zMI04CYVEUsSrN4jV7AKSv+I0y0EfQ==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.31.2.tgz",
+ "integrity": "sha512-EcdO0E7M/sv23S/rLvenHkb58l3XhuSZzKf6DBvLgHqOYdL6YFMYVtreGFWirxaU2mS1GYDby3Lyxco7X5+Vjw==",
"dev": true,
"requires": {
- "@typescript-eslint/scope-manager": "4.29.3",
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/typescript-estree": "4.29.3",
+ "@typescript-eslint/scope-manager": "4.31.2",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/typescript-estree": "4.31.2",
"debug": "^4.3.1"
}
},
"@typescript-eslint/scope-manager": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.29.3.tgz",
- "integrity": "sha512-x+w8BLXO7iWPkG5mEy9bA1iFRnk36p/goVlYobVWHyDw69YmaH9q6eA+Fgl7kYHmFvWlebUTUfhtIg4zbbl8PA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.2.tgz",
+ "integrity": "sha512-2JGwudpFoR/3Czq6mPpE8zBPYdHWFGL6lUNIGolbKQeSNv4EAiHaR5GVDQaLA0FwgcdcMtRk+SBJbFGL7+La5w==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/visitor-keys": "4.29.3"
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/visitor-keys": "4.31.2"
}
},
"@typescript-eslint/types": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.29.3.tgz",
- "integrity": "sha512-s1eV1lKNgoIYLAl1JUba8NhULmf+jOmmeFO1G5MN/RBCyyzg4TIOfIOICVNC06lor+Xmy4FypIIhFiJXOknhIg==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.2.tgz",
+ "integrity": "sha512-kWiTTBCTKEdBGrZKwFvOlGNcAsKGJSBc8xLvSjSppFO88AqGxGNYtF36EuEYG6XZ9vT0xX8RNiHbQUKglbSi1w==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.29.3.tgz",
- "integrity": "sha512-45oQJA0bxna4O5TMwz55/TpgjX1YrAPOI/rb6kPgmdnemRZx/dB0rsx+Ku8jpDvqTxcE1C/qEbVHbS3h0hflag==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.2.tgz",
+ "integrity": "sha512-ieBq8U9at6PvaC7/Z6oe8D3czeW5d//Fo1xkF/s9394VR0bg/UaMYPdARiWyKX+lLEjY3w/FNZJxitMsiWv+wA==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "4.29.3",
- "@typescript-eslint/visitor-keys": "4.29.3",
+ "@typescript-eslint/types": "4.31.2",
+ "@typescript-eslint/visitor-keys": "4.31.2",
"debug": "^4.3.1",
"globby": "^11.0.3",
"is-glob": "^4.0.1",
@@ -4342,12 +4934,12 @@
}
},
"@typescript-eslint/visitor-keys": {
- "version": "4.29.3",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.29.3.tgz",
- "integrity": "sha512-MGGfJvXT4asUTeVs0Q2m+sY63UsfnA+C/FDgBKV3itLBmM9H0u+URcneePtkd0at1YELmZK6HSolCqM4Fzs6yA==",
+ "version": "4.31.2",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.2.tgz",
+ "integrity": "sha512-PrBId7EQq2Nibns7dd/ch6S6/M4/iwLM9McbgeEbCXfxdwRUNxJ4UNreJ6Gh3fI2GNKNrWnQxKL7oCPmngKBug==",
"dev": true,
"requires": {
- "@typescript-eslint/types": "4.29.3",
+ "@typescript-eslint/types": "4.31.2",
"eslint-visitor-keys": "^2.0.0"
}
},
@@ -4591,9 +5183,9 @@
"dev": true
},
"ansi-regex": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
- "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg=="
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="
},
"ansi-styles": {
"version": "4.3.0",
@@ -4612,12 +5204,6 @@
"sprintf-js": "~1.0.2"
}
},
- "array-filter": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-1.0.0.tgz",
- "integrity": "sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=",
- "dev": true
- },
"array-from": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz",
@@ -4629,6 +5215,18 @@
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
+ "assert": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/assert/-/assert-2.0.0.tgz",
+ "integrity": "sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==",
+ "dev": true,
+ "requires": {
+ "es6-object-assign": "^1.1.0",
+ "is-nan": "^1.2.1",
+ "object-is": "^1.0.1",
+ "util": "^0.12.0"
+ }
+ },
"ast-transform": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/ast-transform/-/ast-transform-0.0.0.tgz",
@@ -4639,40 +5237,10 @@
"through": "~2.3.4"
},
"dependencies": {
- "escodegen": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.2.0.tgz",
- "integrity": "sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=",
- "requires": {
- "esprima": "~1.0.4",
- "estraverse": "~1.5.0",
- "esutils": "~1.0.0",
- "source-map": "~0.1.30"
- }
- },
"esprima": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
"integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
- },
- "estraverse": {
- "version": "1.5.1",
- "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
- "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E="
- },
- "esutils": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
- "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA="
- },
- "source-map": {
- "version": "0.1.43",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
- "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
- "optional": true,
- "requires": {
- "amdefine": ">=0.0.4"
- }
}
}
},
@@ -4688,13 +5256,10 @@
"dev": true
},
"available-typed-arrays": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz",
- "integrity": "sha512-XWX3OX8Onv97LMk/ftVyBibpGwY5a8SmuxZPzeOxqmuEqUCOM9ZE+uIaD1VNJ5QnvU2UQusvmKbuM1FR8QWGfQ==",
- "dev": true,
- "requires": {
- "array-filter": "^1.0.0"
- }
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
+ "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
+ "dev": true
},
"babel-runtime": {
"version": "6.26.0",
@@ -4706,9 +5271,9 @@
}
},
"balanced-match": {
- "version": "1.0.0",
- "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
- "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
"base64-js": {
@@ -4716,6 +5281,12 @@
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
},
+ "big.js": {
+ "version": "5.2.2",
+ "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz",
+ "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==",
+ "dev": true
+ },
"blob": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz",
@@ -4792,27 +5363,36 @@
"browser-resolve": "^1.8.1"
}
},
- "browserslist": {
- "version": "4.16.6",
- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz",
- "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==",
+ "browserify-zlib": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
+ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
"dev": true,
"requires": {
- "caniuse-lite": "^1.0.30001219",
- "colorette": "^1.2.2",
- "electron-to-chromium": "^1.3.723",
- "escalade": "^3.1.1",
- "node-releases": "^1.1.71"
+ "pako": "~1.0.5"
},
"dependencies": {
- "colorette": {
- "version": "1.2.2",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz",
- "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==",
+ "pako": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+ "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
"dev": true
}
}
},
+ "browserslist": {
+ "version": "4.17.0",
+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz",
+ "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==",
+ "dev": true,
+ "requires": {
+ "caniuse-lite": "^1.0.30001254",
+ "colorette": "^1.3.0",
+ "electron-to-chromium": "^1.3.830",
+ "escalade": "^3.1.1",
+ "node-releases": "^1.1.75"
+ }
+ },
"buffer": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
@@ -4829,9 +5409,9 @@
"integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs="
},
"buffer-from": {
- "version": "1.1.1",
- "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
- "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"call-bind": {
"version": "1.0.2",
@@ -4854,15 +5434,15 @@
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
},
"caniuse-lite": {
- "version": "1.0.30001228",
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001228.tgz",
- "integrity": "sha512-QQmLOGJ3DEgokHbMSA8cj2a+geXqmnpyOFT0lhQV6P3/YOJvGDEwoedcwxEQ30gJIwIIunHIicunJ2rzK5gB2A==",
+ "version": "1.0.30001258",
+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001258.tgz",
+ "integrity": "sha512-RBByOG6xWXUp0CR2/WU2amXz3stjKpSl5J1xU49F1n2OxD//uBZO4wCKUiG+QMGf7CHGfDDcqoKriomoGVxTeA==",
"dev": true
},
"chalk": {
- "version": "4.1.0",
- "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz",
- "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==",
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
@@ -4915,9 +5495,9 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
},
"colorette": {
- "version": "1.2.1",
- "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.1.tgz",
- "integrity": "sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==",
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz",
+ "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==",
"dev": true
},
"commander": {
@@ -4941,12 +5521,28 @@
"inherits": "^2.0.3",
"readable-stream": "^2.2.2",
"typedarray": "^0.0.6"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ }
}
},
"convert-source-map": {
- "version": "1.7.0",
- "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
- "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
+ "version": "1.8.0",
+ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz",
+ "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==",
"requires": {
"safe-buffer": "~5.1.1"
}
@@ -4957,9 +5553,9 @@
"integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ=="
},
"core-util-is": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
- "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
},
"cross-spawn": {
"version": "7.0.3",
@@ -4992,9 +5588,9 @@
"integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA=="
},
"debug": {
- "version": "4.3.1",
- "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
- "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
+ "version": "4.3.2",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
+ "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"requires": {
"ms": "2.1.2"
@@ -5019,9 +5615,9 @@
}
},
"deep-is": {
- "version": "0.1.3",
- "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
- "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
+ "version": "0.1.4",
+ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="
},
"define-properties": {
"version": "1.1.3",
@@ -5037,9 +5633,9 @@
"integrity": "sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q=="
},
"dijkstrajs": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz",
- "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs="
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.2.tgz",
+ "integrity": "sha512-QV6PMaHTCNmKSeP6QoXhVTw9snc9VD8MulTT0Bd99Pacp4SS1cjcrYPgBPmibqKVtMJJfqC6XvOXgPMEEPH/fg=="
},
"dir-glob": {
"version": "3.0.1",
@@ -5065,12 +5661,28 @@
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"requires": {
"readable-stream": "^2.0.2"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ }
}
},
"electron-to-chromium": {
- "version": "1.3.727",
- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.727.tgz",
- "integrity": "sha512-Mfz4FIB4FSvEwBpDfdipRIrwd6uo8gUDoRDF4QEYb4h4tSuI3ov594OrjU6on042UlFHouIJpClDODGkPcBSbg==",
+ "version": "1.3.843",
+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.843.tgz",
+ "integrity": "sha512-OWEwAbzaVd1Lk9MohVw8LxMXFlnYd9oYTYxfX8KS++kLLjDfbovLOcEEXwRhG612dqGQ6+44SZvim0GXuBRiKg==",
"dev": true
},
"emoji-regex": {
@@ -5078,15 +5690,21 @@
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
},
+ "emojis-list": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz",
+ "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==",
+ "dev": true
+ },
"encode-utf8": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/encode-utf8/-/encode-utf8-1.0.3.tgz",
"integrity": "sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw=="
},
"enhanced-resolve": {
- "version": "5.8.0",
- "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.0.tgz",
- "integrity": "sha512-Sl3KRpJA8OpprrtaIswVki3cWPiPKxXuFxJXBp+zNb6s6VwNWwFRUdtmzd2ReUut8n+sCPx7QCtQ7w5wfJhSgQ==",
+ "version": "5.8.3",
+ "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.8.3.tgz",
+ "integrity": "sha512-EGAbGvH7j7Xt2nc0E7D99La1OiEs8LnyimkRgwExpUMScN6O+3x9tIWs7PLQZVNx4YD+00skHXPXi1yQHpAmZA==",
"dev": true,
"requires": {
"graceful-fs": "^4.2.4",
@@ -5109,31 +5727,35 @@
"dev": true
},
"es-abstract": {
- "version": "1.18.0-next.2",
- "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.2.tgz",
- "integrity": "sha512-Ih4ZMFHEtZupnUh6497zEL4y2+w8+1ljnCyaTa+adcoafI1GOvMwFlDjBLfWR7y9VLfrjRJe9ocuHY1PSR9jjw==",
+ "version": "1.18.6",
+ "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz",
+ "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==",
"dev": true,
"requires": {
"call-bind": "^1.0.2",
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
- "get-intrinsic": "^1.0.2",
+ "get-intrinsic": "^1.1.1",
+ "get-symbol-description": "^1.0.0",
"has": "^1.0.3",
- "has-symbols": "^1.0.1",
- "is-callable": "^1.2.2",
+ "has-symbols": "^1.0.2",
+ "internal-slot": "^1.0.3",
+ "is-callable": "^1.2.4",
"is-negative-zero": "^2.0.1",
- "is-regex": "^1.1.1",
- "object-inspect": "^1.9.0",
+ "is-regex": "^1.1.4",
+ "is-string": "^1.0.7",
+ "object-inspect": "^1.11.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.2",
- "string.prototype.trimend": "^1.0.3",
- "string.prototype.trimstart": "^1.0.3"
+ "string.prototype.trimend": "^1.0.4",
+ "string.prototype.trimstart": "^1.0.4",
+ "unbox-primitive": "^1.0.1"
}
},
"es-module-lexer": {
- "version": "0.7.1",
- "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.7.1.tgz",
- "integrity": "sha512-MgtWFl5No+4S3TmhDmCz2ObFGm6lEpTnzbQi+Dd+pw4mlTIZTmM2iAs5gRlmx5zS9luzobCSBSI90JM/1/JgOw==",
+ "version": "0.9.0",
+ "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.0.tgz",
+ "integrity": "sha512-qU2eN/XHsrl3E4y7mK1wdWnyy5c8gXtCbfP6Xcsemm7fPUR1PIV1JhZfP7ojcN0Fzp69CfrS3u76h2tusvfKiQ==",
"dev": true
},
"es-to-primitive": {
@@ -5180,6 +5802,12 @@
"event-emitter": "~0.3.5"
}
},
+ "es6-object-assign": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/es6-object-assign/-/es6-object-assign-1.1.0.tgz",
+ "integrity": "sha1-wsNYJlYkfDnqEHyx5mUrb58kUjw=",
+ "dev": true
+ },
"es6-set": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
@@ -5219,57 +5847,36 @@
"dev": true
},
"escape-string-regexp": {
- "version": "1.0.5",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
- "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true
},
"escodegen": {
- "version": "1.14.3",
- "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
- "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.2.0.tgz",
+ "integrity": "sha1-Cd55Z3kcyVi3+Jot220jRRrzJ+E=",
"requires": {
- "esprima": "^4.0.1",
- "estraverse": "^4.2.0",
- "esutils": "^2.0.2",
- "optionator": "^0.8.1",
- "source-map": "~0.6.1"
+ "esprima": "~1.0.4",
+ "estraverse": "~1.5.0",
+ "esutils": "~1.0.0",
+ "source-map": "~0.1.30"
},
"dependencies": {
- "levn": {
- "version": "0.3.0",
- "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
- "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
- "requires": {
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2"
- }
- },
- "optionator": {
- "version": "0.8.3",
- "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
- "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
- "requires": {
- "deep-is": "~0.1.3",
- "fast-levenshtein": "~2.0.6",
- "levn": "~0.3.0",
- "prelude-ls": "~1.1.2",
- "type-check": "~0.3.2",
- "word-wrap": "~1.2.3"
- }
+ "esprima": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
+ "integrity": "sha1-n1V+CPw7TSbs6d00+Pv0drYlha0="
},
- "prelude-ls": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
- "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ "estraverse": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
+ "integrity": "sha1-hno+jlip+EYYr7bC3bzZFrfLr3E="
},
- "type-check": {
- "version": "0.3.2",
- "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
- "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
- "requires": {
- "prelude-ls": "~1.1.2"
- }
+ "esutils": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
+ "integrity": "sha1-gVHTWOIMisx/t0XnRywAJf5JZXA="
}
}
},
@@ -5321,11 +5928,22 @@
"v8-compile-cache": "^2.0.3"
},
"dependencies": {
- "escape-string-regexp": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
- "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
- "dev": true
+ "eslint-utils": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
+ "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "dev": true,
+ "requires": {
+ "eslint-visitor-keys": "^1.1.0"
+ },
+ "dependencies": {
+ "eslint-visitor-keys": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+ "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+ "dev": true
+ }
+ }
}
}
},
@@ -5340,26 +5958,18 @@
}
},
"eslint-utils": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz",
- "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==",
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz",
+ "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==",
"dev": true,
"requires": {
- "eslint-visitor-keys": "^1.1.0"
- },
- "dependencies": {
- "eslint-visitor-keys": {
- "version": "1.3.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
- "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
- "dev": true
- }
+ "eslint-visitor-keys": "^2.0.0"
}
},
"eslint-visitor-keys": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz",
- "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz",
+ "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==",
"dev": true
},
"espree": {
@@ -5451,9 +6061,9 @@
"dev": true
},
"execa": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz",
- "integrity": "sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ==",
+ "version": "5.1.1",
+ "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz",
+ "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
@@ -5468,11 +6078,11 @@
}
},
"ext": {
- "version": "1.4.0",
- "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz",
- "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==",
+ "version": "1.5.0",
+ "resolved": "https://registry.npmjs.org/ext/-/ext-1.5.0.tgz",
+ "integrity": "sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q==",
"requires": {
- "type": "^2.0.0"
+ "type": "^2.5.0"
},
"dependencies": {
"type": {
@@ -5519,9 +6129,9 @@
"dev": true
},
"fastq": {
- "version": "1.12.0",
- "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.12.0.tgz",
- "integrity": "sha512-VNX0QkHK3RsXVKr9KrlUv/FoTa0NdbYoHHl7uXHv2rzyHSlxjdNAKug2twd9luJxpcyNeAgf5iPPMutJO67Dfg==",
+ "version": "1.13.0",
+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz",
+ "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==",
"dev": true,
"requires": {
"reusify": "^1.0.4"
@@ -5565,9 +6175,9 @@
}
},
"flatted": {
- "version": "3.1.1",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
- "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
+ "version": "3.2.2",
+ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz",
+ "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true
},
"fontkit": {
@@ -5632,15 +6242,25 @@
}
},
"get-stream": {
- "version": "6.0.0",
- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz",
- "integrity": "sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg==",
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz",
+ "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true
},
+ "get-symbol-description": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
+ "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.2",
+ "get-intrinsic": "^1.1.1"
+ }
+ },
"glob": {
- "version": "7.1.6",
- "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
- "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
+ "version": "7.1.7",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
+ "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==",
"dev": true,
"requires": {
"fs.realpath": "^1.0.0",
@@ -5667,9 +6287,9 @@
"dev": true
},
"globals": {
- "version": "13.10.0",
- "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz",
- "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==",
+ "version": "13.11.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.11.0.tgz",
+ "integrity": "sha512-08/xrJ7wQjK9kkkRoI3OFUBbLx4f+6x3SGwcPvQ0QH6goFDrOU2oyAWrmh3dJezu65buo+HBMzAMQy6rovVC3g==",
"dev": true,
"requires": {
"type-fest": "^0.20.2"
@@ -5698,9 +6318,9 @@
}
},
"graceful-fs": {
- "version": "4.2.5",
- "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.5.tgz",
- "integrity": "sha512-kBBSQbz2K0Nyn+31j/w36fUfxkBW9/gfwRWdUY1ULReH3iokVJgddZAFcD1D0xlgTmFxJCbUkUclAlc6/IDJkw==",
+ "version": "4.2.8",
+ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz",
+ "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==",
"dev": true
},
"has": {
@@ -5711,6 +6331,12 @@
"function-bind": "^1.1.1"
}
},
+ "has-bigints": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.1.tgz",
+ "integrity": "sha512-LSBS2LjbNBTf6287JEbEzvJgftkF5qFkmCo9hDRpAzKhUOlJ+hx8dd4USs00SgsUNwc4617J9ki5YtEClM2ffA==",
+ "dev": true
+ },
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
@@ -5718,9 +6344,17 @@
"dev": true
},
"has-symbols": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
- "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg=="
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz",
+ "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw=="
+ },
+ "has-tostringtag": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
+ "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
+ "requires": {
+ "has-symbols": "^1.0.2"
+ }
},
"human-signals": {
"version": "2.1.0",
@@ -5781,38 +6415,72 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
},
+ "internal-slot": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz",
+ "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==",
+ "dev": true,
+ "requires": {
+ "get-intrinsic": "^1.1.0",
+ "has": "^1.0.3",
+ "side-channel": "^1.0.4"
+ }
+ },
"interpret": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz",
"integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==",
"dev": true
},
- "is-arguments": {
- "version": "1.1.0",
- "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz",
- "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==",
+ "is-arguments": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz",
+ "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==",
+ "requires": {
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
+ }
+ },
+ "is-bigint": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+ "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+ "dev": true,
+ "requires": {
+ "has-bigints": "^1.0.1"
+ }
+ },
+ "is-boolean-object": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+ "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
+ "dev": true,
"requires": {
- "call-bind": "^1.0.0"
+ "call-bind": "^1.0.2",
+ "has-tostringtag": "^1.0.0"
}
},
"is-callable": {
- "version": "1.2.3",
- "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz",
- "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==",
+ "version": "1.2.4",
+ "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz",
+ "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==",
"dev": true
},
"is-core-module": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz",
- "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==",
+ "version": "2.6.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz",
+ "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==",
"requires": {
"has": "^1.0.3"
}
},
"is-date-object": {
- "version": "1.0.2",
- "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
- "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g=="
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+ "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+ "requires": {
+ "has-tostringtag": "^1.0.0"
+ }
},
"is-extglob": {
"version": "2.1.1",
@@ -5826,10 +6494,13 @@
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg=="
},
"is-generator-function": {
- "version": "1.0.8",
- "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.8.tgz",
- "integrity": "sha512-2Omr/twNtufVZFr1GhxjOMFPAj2sjc/dKaIqBhvo4qciXfJmITGH6ZGd8eZYNHza8t1y0e01AuqRhJwfWp26WQ==",
- "dev": true
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz",
+ "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==",
+ "dev": true,
+ "requires": {
+ "has-tostringtag": "^1.0.0"
+ }
},
"is-glob": {
"version": "4.0.1",
@@ -5840,6 +6511,16 @@
"is-extglob": "^2.1.1"
}
},
+ "is-nan": {
+ "version": "1.3.2",
+ "resolved": "https://registry.npmjs.org/is-nan/-/is-nan-1.3.2.tgz",
+ "integrity": "sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "define-properties": "^1.1.3"
+ }
+ },
"is-negative-zero": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz",
@@ -5852,6 +6533,15 @@
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
"dev": true
},
+ "is-number-object": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz",
+ "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==",
+ "dev": true,
+ "requires": {
+ "has-tostringtag": "^1.0.0"
+ }
+ },
"is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
@@ -5862,40 +6552,49 @@
}
},
"is-regex": {
- "version": "1.1.2",
- "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.2.tgz",
- "integrity": "sha512-axvdhb5pdhEVThqJzYXwMlVuZwC+FF2DpcOhTS+y/8jVq4trxyPgfcwIxIKiyeuLlSQYKkmUaPQJ8ZE4yNKXDg==",
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+ "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
"requires": {
"call-bind": "^1.0.2",
- "has-symbols": "^1.0.1"
+ "has-tostringtag": "^1.0.0"
}
},
"is-stream": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz",
- "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
+ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==",
"dev": true
},
+ "is-string": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+ "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+ "dev": true,
+ "requires": {
+ "has-tostringtag": "^1.0.0"
+ }
+ },
"is-symbol": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
- "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
+ "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
"dev": true,
"requires": {
- "has-symbols": "^1.0.1"
+ "has-symbols": "^1.0.2"
}
},
"is-typed-array": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.4.tgz",
- "integrity": "sha512-ILaRgn4zaSrVNXNGtON6iFNotXW3hAPF3+0fB1usg2jFlWqo5fEDdmJkz0zBfoi7Dgskr8Khi2xZ8cXqZEfXNA==",
+ "version": "1.1.8",
+ "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz",
+ "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==",
"dev": true,
"requires": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.0",
- "es-abstract": "^1.18.0-next.1",
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "es-abstract": "^1.18.5",
"foreach": "^2.0.5",
- "has-symbols": "^1.0.1"
+ "has-tostringtag": "^1.0.0"
}
},
"isarray": {
@@ -5916,9 +6615,9 @@
"dev": true
},
"jest-worker": {
- "version": "27.0.6",
- "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz",
- "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==",
+ "version": "27.2.0",
+ "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz",
+ "integrity": "sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA==",
"dev": true,
"requires": {
"@types/node": "*",
@@ -5971,6 +6670,15 @@
"integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
"dev": true
},
+ "json5": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
+ "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
+ "dev": true,
+ "requires": {
+ "minimist": "^1.2.0"
+ }
+ },
"kind-of": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
@@ -6019,6 +6727,17 @@
"integrity": "sha512-92+huvxMvYlMzMt0iIOukcwYBFpkYJdpl2xsZ7LrlayO7E8SOv+JJUEK17B/dJIHAOLMfh2dZZ/Y18WgmGtYNw==",
"dev": true
},
+ "loader-utils": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz",
+ "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==",
+ "dev": true,
+ "requires": {
+ "big.js": "^5.2.2",
+ "emojis-list": "^3.0.0",
+ "json5": "^1.0.1"
+ }
+ },
"locate-path": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
@@ -6100,18 +6819,18 @@
}
},
"mime-db": {
- "version": "1.47.0",
- "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
- "integrity": "sha512-QBmA/G2y+IfeS4oktet3qRZ+P5kPhCKRXxXnQEudYqUaEioAU1/Lq2us3D/t1Jfo4hE9REQPrbB7K5sOczJVIw==",
+ "version": "1.49.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.49.0.tgz",
+ "integrity": "sha512-CIc8j9URtOVApSFCQIF+VBkX1RwXp/oMMOrqdyXSBXq5RWNEsRfyj1kiRnQgmNXmHxPoFIxOroKA3zcU9P+nAA==",
"dev": true
},
"mime-types": {
- "version": "2.1.30",
- "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.30.tgz",
- "integrity": "sha512-crmjA4bLtR8m9qLpHvgxSChT+XoSlZi8J4n/aIdn3z92e/U47Z0V/yl+Wh9W046GgFVAmoNR/fmdbZYcSSIUeg==",
+ "version": "2.1.32",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.32.tgz",
+ "integrity": "sha512-hJGaVS4G4c9TSMYh2n6SQAGrC4RnfU+daP8G7cSCmaqNjiOoUY0VHCMS42pxnQmVF1GWwFhbHWn3RIxCqTmZ9A==",
"dev": true,
"requires": {
- "mime-db": "1.47.0"
+ "mime-db": "1.49.0"
}
},
"mimic-fn": {
@@ -6158,9 +6877,9 @@
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw="
},
"node-releases": {
- "version": "1.1.71",
- "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.71.tgz",
- "integrity": "sha512-zR6HoT6LrLCRBwukmrVbHv0EpEQjksO6GmFcZQQuCAy139BEsoVKPYnf3jongYW83fAa1torLGYwxxky/p28sg==",
+ "version": "1.1.76",
+ "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.76.tgz",
+ "integrity": "sha512-9/IECtNr8dXNmPWmFXepT0/7o5eolGesHUa3mtr0KlgnCvnZxwh2qensKL42JJY2vQKC3nIBXetFAqR+PW1CmA==",
"dev": true
},
"npm-run-path": {
@@ -6173,9 +6892,9 @@
}
},
"object-inspect": {
- "version": "1.9.0",
- "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz",
- "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw=="
+ "version": "1.11.0",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz",
+ "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg=="
},
"object-is": {
"version": "1.1.5",
@@ -6400,23 +7119,20 @@
}
},
"readable-stream": {
- "version": "2.3.7",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
- "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
+ "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
+ "dev": true,
"requires": {
- "core-util-is": "~1.0.0",
- "inherits": "~2.0.3",
- "isarray": "~1.0.0",
- "process-nextick-args": "~2.0.0",
- "safe-buffer": "~5.1.1",
- "string_decoder": "~1.1.1",
- "util-deprecate": "~1.0.1"
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
}
},
"rechoir": {
- "version": "0.7.0",
- "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.0.tgz",
- "integrity": "sha512-ADsDEH2bvbjltXEP+hTIAmeFekTFK0V2BTxMkok6qILyAJEXV0AFfoWcAq4yfll5VdIMd/RVXq0lR+wQi5ZU3Q==",
+ "version": "0.7.1",
+ "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.7.1.tgz",
+ "integrity": "sha512-/njmZ8s1wVeR6pjTZ+0nCnv8SpZNRMT2D1RLOJQESlYFDBvwpTA4KWJpZ+sBJ4+vhjILRcK7JIFdGCdxEAAitg==",
"dev": true,
"requires": {
"resolve": "^1.9.0"
@@ -6437,9 +7153,9 @@
}
},
"regexpp": {
- "version": "3.1.0",
- "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz",
- "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==",
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz",
+ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==",
"dev": true
},
"require-directory": {
@@ -6459,11 +7175,11 @@
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg=="
},
"resolve": {
- "version": "1.19.0",
- "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz",
- "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==",
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
"requires": {
- "is-core-module": "^2.1.0",
+ "is-core-module": "^2.2.0",
"path-parse": "^1.0.6"
}
},
@@ -6604,10 +7320,21 @@
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
+ "side-channel": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+ "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+ "dev": true,
+ "requires": {
+ "call-bind": "^1.0.0",
+ "get-intrinsic": "^1.0.2",
+ "object-inspect": "^1.9.0"
+ }
+ },
"signal-exit": {
- "version": "3.0.3",
- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz",
- "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==",
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz",
+ "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==",
"dev": true
},
"slash": {
@@ -6628,18 +7355,30 @@
}
},
"source-map": {
- "version": "0.6.1",
- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
- "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
+ "version": "0.1.43",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
+ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
+ "optional": true,
+ "requires": {
+ "amdefine": ">=0.0.4"
+ }
},
"source-map-support": {
- "version": "0.5.19",
- "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
- "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "version": "0.5.20",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz",
+ "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==",
"dev": true,
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
}
},
"sourcemap-codec": {
@@ -6659,6 +7398,61 @@
"integrity": "sha512-agtxZ/kWSsCkI5E4QifRwsaPs0P0JmZV6dkLz6ILYfFYQGn+5plctanRN+IC8dJRiFkyXHrwEE3W9Wmx67uDbw==",
"requires": {
"escodegen": "^1.11.1"
+ },
+ "dependencies": {
+ "escodegen": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
+ "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+ "requires": {
+ "esprima": "^4.0.1",
+ "estraverse": "^4.2.0",
+ "esutils": "^2.0.2",
+ "optionator": "^0.8.1",
+ "source-map": "~0.6.1"
+ }
+ },
+ "levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "requires": {
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ }
+ },
+ "optionator": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "requires": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.6",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "word-wrap": "~1.2.3"
+ }
+ },
+ "prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "optional": true
+ },
+ "type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
+ "requires": {
+ "prelude-ls": "~1.1.2"
+ }
+ }
}
},
"static-module": {
@@ -6680,27 +7474,73 @@
"shallow-copy": "~0.0.1",
"static-eval": "^2.0.5",
"through2": "~2.0.3"
- }
- },
- "stream-browserify": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-3.0.0.tgz",
- "integrity": "sha512-H73RAHsVBapbim0tU2JwwOiXUj+fikfiaoYAKHF3VJfA0pe2BCzkhAHBlLG6REzE+2WNZcxOXjK7lkso+9euLA==",
- "dev": true,
- "requires": {
- "inherits": "~2.0.4",
- "readable-stream": "^3.5.0"
},
"dependencies": {
+ "escodegen": {
+ "version": "1.14.3",
+ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
+ "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+ "requires": {
+ "esprima": "^4.0.1",
+ "estraverse": "^4.2.0",
+ "esutils": "^2.0.2",
+ "optionator": "^0.8.1",
+ "source-map": "~0.6.1"
+ }
+ },
+ "levn": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
+ "requires": {
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2"
+ }
+ },
+ "optionator": {
+ "version": "0.8.3",
+ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+ "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+ "requires": {
+ "deep-is": "~0.1.3",
+ "fast-levenshtein": "~2.0.6",
+ "levn": "~0.3.0",
+ "prelude-ls": "~1.1.2",
+ "type-check": "~0.3.2",
+ "word-wrap": "~1.2.3"
+ }
+ },
+ "prelude-ls": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
+ },
"readable-stream": {
- "version": "3.6.0",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
- "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
- "dev": true,
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "optional": true
+ },
+ "type-check": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
"requires": {
- "inherits": "^2.0.3",
- "string_decoder": "^1.1.1",
- "util-deprecate": "^1.0.1"
+ "prelude-ls": "~1.1.2"
}
}
}
@@ -6714,9 +7554,9 @@
}
},
"string-width": {
- "version": "4.2.0",
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
- "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
+ "version": "4.2.2",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz",
+ "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
@@ -6724,22 +7564,22 @@
}
},
"string.prototype.trimend": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz",
- "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz",
+ "integrity": "sha512-y9xCjw1P23Awk8EvTpcyL2NIr1j7wJ39f+k6lvRnSMz+mz9CGz9NYPelDk42kOz6+ql8xjfK8oYzy3jAP5QU5A==",
"dev": true,
"requires": {
- "call-bind": "^1.0.0",
+ "call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
},
"string.prototype.trimstart": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz",
- "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==",
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.4.tgz",
+ "integrity": "sha512-jh6e984OBfvxS50tdY2nRZnoC5/mLFKOREQfw8t5yytkoUsJRNxvI/E39qu1sD0OtWI3OC0XgKSmcWwziwYuZw==",
"dev": true,
"requires": {
- "call-bind": "^1.0.0",
+ "call-bind": "^1.0.2",
"define-properties": "^1.1.3"
}
},
@@ -6772,10 +7612,10 @@
"has-flag": "^4.0.0"
}
},
- "svg-parser": {
- "version": "2.0.4",
- "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz",
- "integrity": "sha512-e4hG1hRwoOdRb37cIMSgzNsxyzKfayW6VOflrwvR+/bzrkyxY/31WkbgnQpgtrNp1SdpJvpUAGTa/ZoiPNDuRQ=="
+ "svg-engine": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/svg-engine/-/svg-engine-0.2.0.tgz",
+ "integrity": "sha512-84JQzeAIEdztkhsR2hWZIR56A4HHxg3dojUqLsxfLR6FmJjSs4GOvRKQAIePDuofaIuFJR9A2tiuTIEf0+nWZw=="
},
"svgpath": {
"version": "2.3.1",
@@ -6797,9 +7637,9 @@
},
"dependencies": {
"ajv": {
- "version": "8.6.0",
- "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz",
- "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==",
+ "version": "8.6.3",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz",
+ "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==",
"dev": true,
"requires": {
"fast-deep-equal": "^3.1.1",
@@ -6817,20 +7657,20 @@
}
},
"tapable": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz",
- "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==",
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz",
+ "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==",
"dev": true
},
"terser": {
- "version": "5.7.1",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
- "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz",
+ "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==",
"dev": true,
"requires": {
"commander": "^2.20.0",
"source-map": "~0.7.2",
- "source-map-support": "~0.5.19"
+ "source-map-support": "~0.5.20"
},
"dependencies": {
"source-map": {
@@ -6842,17 +7682,25 @@
}
},
"terser-webpack-plugin": {
- "version": "5.1.4",
- "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz",
- "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==",
+ "version": "5.2.4",
+ "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz",
+ "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==",
"dev": true,
"requires": {
- "jest-worker": "^27.0.2",
+ "jest-worker": "^27.0.6",
"p-limit": "^3.1.0",
- "schema-utils": "^3.0.0",
+ "schema-utils": "^3.1.1",
"serialize-javascript": "^6.0.0",
"source-map": "^0.6.1",
- "terser": "^5.7.0"
+ "terser": "^5.7.2"
+ },
+ "dependencies": {
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ }
}
},
"text-table": {
@@ -6873,6 +7721,22 @@
"requires": {
"readable-stream": "~2.3.6",
"xtend": "~4.0.1"
+ },
+ "dependencies": {
+ "readable-stream": {
+ "version": "2.3.7",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+ "requires": {
+ "core-util-is": "~1.0.0",
+ "inherits": "~2.0.3",
+ "isarray": "~1.0.0",
+ "process-nextick-args": "~2.0.0",
+ "safe-buffer": "~5.1.1",
+ "string_decoder": "~1.1.1",
+ "util-deprecate": "~1.0.1"
+ }
+ }
}
},
"tiny-inflate": {
@@ -6889,10 +7753,19 @@
"is-number": "^7.0.0"
}
},
+ "transform-loader": {
+ "version": "0.2.4",
+ "resolved": "https://registry.npmjs.org/transform-loader/-/transform-loader-0.2.4.tgz",
+ "integrity": "sha1-5ch4d7qW1R0/IlNoWHtG4ibRzsk=",
+ "dev": true,
+ "requires": {
+ "loader-utils": "^1.0.2"
+ }
+ },
"ts-loader": {
- "version": "9.2.5",
- "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.5.tgz",
- "integrity": "sha512-al/ATFEffybdRMUIr5zMEWQdVnCGMUA9d3fXJ8dBVvBlzytPvIszoG9kZoR+94k6/i293RnVOXwMaWbXhNy9pQ==",
+ "version": "9.2.6",
+ "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.2.6.tgz",
+ "integrity": "sha512-QMTC4UFzHmu9wU2VHZEmWWE9cUajjfcdcws+Gh7FhiO+Dy0RnR1bNz0YCHqhI0yRowCE9arVnNxYHqELOy9Hjw==",
"dev": true,
"requires": {
"chalk": "^4.1.0",
@@ -6901,12 +7774,6 @@
"semver": "^7.3.4"
}
},
- "tslib": {
- "version": "1.14.1",
- "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
- "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
- "dev": true
- },
"tsutils": {
"version": "3.21.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz",
@@ -6914,6 +7781,14 @@
"dev": true,
"requires": {
"tslib": "^1.8.1"
+ },
+ "dependencies": {
+ "tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ }
}
},
"type": {
@@ -6942,11 +7817,23 @@
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
},
"typescript": {
- "version": "4.3.5",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz",
- "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==",
+ "version": "4.4.3",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.3.tgz",
+ "integrity": "sha512-4xfscpisVgqqDfPaJo5vkd+Qd/ItkoagnHpufr+i2QCHBsNYp+G7UAoyFl8aPtx879u38wPV65rZ8qbGZijalA==",
"dev": true
},
+ "unbox-primitive": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz",
+ "integrity": "sha512-tZU/3NqK3dA5gpE1KtyiJUrEB0lxnGkMFHptJ7q6ewdZ8s12QrODwNbhIJStmJkd1QDXa1NRA8aF2A1zk/Ypyw==",
+ "dev": true,
+ "requires": {
+ "function-bind": "^1.1.1",
+ "has-bigints": "^1.0.1",
+ "has-symbols": "^1.0.2",
+ "which-boxed-primitive": "^1.0.2"
+ }
+ },
"unicode-properties": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/unicode-properties/-/unicode-properties-1.3.1.tgz",
@@ -7005,9 +7892,9 @@
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
},
"v8-compile-cache": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz",
- "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==",
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
+ "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==",
"dev": true
},
"watchpack": {
@@ -7021,9 +7908,9 @@
}
},
"webpack": {
- "version": "5.51.1",
- "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.51.1.tgz",
- "integrity": "sha512-xsn3lwqEKoFvqn4JQggPSRxE4dhsRcysWTqYABAZlmavcoTmwlOb9b1N36Inbt/eIispSkuHa80/FJkDTPos1A==",
+ "version": "5.54.0",
+ "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.54.0.tgz",
+ "integrity": "sha512-MAVKJMsIUotOQKzFOmN8ZkmMlj7BOyjDU6t1lomW9dWOme5WTStzGa3HMLdV1KYD1AiFETGsznL4LMSvj4tukw==",
"dev": true,
"requires": {
"@types/eslint-scope": "^3.7.0",
@@ -7035,8 +7922,8 @@
"acorn-import-assertions": "^1.7.6",
"browserslist": "^4.14.5",
"chrome-trace-event": "^1.0.2",
- "enhanced-resolve": "^5.8.0",
- "es-module-lexer": "^0.7.1",
+ "enhanced-resolve": "^5.8.3",
+ "es-module-lexer": "^0.9.0",
"eslint-scope": "5.1.1",
"events": "^3.2.0",
"glob-to-regexp": "^0.4.1",
@@ -7053,9 +7940,9 @@
},
"dependencies": {
"acorn": {
- "version": "8.4.1",
- "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
- "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==",
+ "version": "8.5.0",
+ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz",
+ "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==",
"dev": true
},
"acorn-import-assertions": {
@@ -7097,9 +7984,9 @@
}
},
"webpack-merge": {
- "version": "5.7.3",
- "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.7.3.tgz",
- "integrity": "sha512-6/JUQv0ELQ1igjGDzHkXbVDRxkfA57Zw7PfiupdLFJYrgFqY5ZP8xxbpp2lU3EPwYx89ht5Z/aDkD40hFCm5AA==",
+ "version": "5.8.0",
+ "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.8.0.tgz",
+ "integrity": "sha512-/SaI7xY0831XwP6kzuwhKWVKDP9t1QY1h65lAFLbZqMPIuYcD9QAW4u9STIbU9kaJbPBB/geU/gLr1wDjOhQ+Q==",
"dev": true,
"requires": {
"clone-deep": "^4.0.1",
@@ -7107,9 +7994,9 @@
}
},
"webpack-sources": {
- "version": "3.2.0",
- "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.0.tgz",
- "integrity": "sha512-fahN08Et7P9trej8xz/Z7eRu8ltyiygEo/hnRi9KqBUs80KeDcnf96ZJo++ewWd84fEf3xSX9bp4ZS9hbw0OBw==",
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.1.tgz",
+ "integrity": "sha512-t6BMVLQ0AkjBOoRTZgqrWm7xbXMBzD+XDq2EZ96+vMfn3qKgsvdXZhbPZ4ElUOpdv4u+iiGe+w3+J75iy/bYGA==",
"dev": true
},
"which": {
@@ -7121,24 +8008,36 @@
"isexe": "^2.0.0"
}
},
+ "which-boxed-primitive": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
+ "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+ "dev": true,
+ "requires": {
+ "is-bigint": "^1.0.1",
+ "is-boolean-object": "^1.1.0",
+ "is-number-object": "^1.0.4",
+ "is-string": "^1.0.5",
+ "is-symbol": "^1.0.3"
+ }
+ },
"which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="
},
"which-typed-array": {
- "version": "1.1.4",
- "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz",
- "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==",
+ "version": "1.1.7",
+ "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz",
+ "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==",
"dev": true,
"requires": {
- "available-typed-arrays": "^1.0.2",
- "call-bind": "^1.0.0",
- "es-abstract": "^1.18.0-next.1",
+ "available-typed-arrays": "^1.0.5",
+ "call-bind": "^1.0.2",
+ "es-abstract": "^1.18.5",
"foreach": "^2.0.5",
- "function-bind": "^1.1.1",
- "has-symbols": "^1.0.1",
- "is-typed-array": "^1.1.3"
+ "has-tostringtag": "^1.0.0",
+ "is-typed-array": "^1.1.7"
}
},
"wildcard": {
@@ -7174,9 +8073,9 @@
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ=="
},
"y18n": {
- "version": "4.0.1",
- "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz",
- "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ=="
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ=="
},
"yallist": {
"version": "4.0.0",
diff --git a/package.json b/package.json
index e86e24b..720907d 100644
--- a/package.json
+++ b/package.json
@@ -1,17 +1,141 @@
{
"name": "swissqrbill",
- "version": "2.4.2",
- "description": "Swiss QR Bill generation in Node.js and browsers ",
- "main": "./lib/node",
- "browser": "./lib/browser",
+ "version": "3.0.0",
+ "description": "Swiss QR Bill generation in Node.js and browsers",
+ "main": "./lib/node/cjs/node/index.js",
+ "module": "./lib/node/esm/node/index.js",
+ "browser": "./lib/browser/bundle/index.js",
+ "sideEffects": false,
+ "exports": {
+ ".": {
+ "node": {
+ "require": "./lib/node/cjs/node/index.js",
+ "import": "./lib/node/esm/node/index.js"
+ },
+ "browser": {
+ "require": "./lib/browser/bundle/index.js",
+ "import": "./lib/browser/esm/browser/index.js"
+ },
+ "default": {
+ "require": "./lib/node/cjs/node/index.js",
+ "import": "./lib/node/esm/node/index.js"
+ }
+ },
+ "./svg": {
+ "node": {
+ "require": "./lib/node/cjs/node/svg.js",
+ "import": "./lib/node/esm/node/svg.js"
+ },
+ "browser": {
+ "require": "./lib/browser/bundle/index.js",
+ "import": "./lib/browser/esm/browser/svg.js"
+ },
+ "default": {
+ "require": "./lib/node/cjs/node/svg.js",
+ "import": "./lib/node/esm/node/svg.js"
+ }
+ },
+ "./pdf": {
+ "node": {
+ "require": "./lib/node/cjs/node/pdf.js",
+ "import": "./lib/node/esm/node/pdf.js"
+ },
+ "browser": {
+ "require": "./lib/browser/bundle/index.js",
+ "import": "./lib/browser/esm/browser/pdf.js"
+ },
+ "default": {
+ "require": "./lib/node/cjs/node/pdf.js",
+ "import": "./lib/node/esm/node/pdf.js"
+ }
+ },
+ "./utils": {
+ "node": {
+ "require": "./lib/node/cjs/shared/utils.js",
+ "import": "./lib/node/esm/shared/utils.js"
+ },
+ "browser": {
+ "require": "./lib/browser/bundle/index.js",
+ "import": "./lib/browser/esm/shared/utils.js"
+ },
+ "default": {
+ "require": "./lib/node/cjs/shared/utils.js",
+ "import": "./lib/node/esm/shared/utils.js"
+ }
+ },
+ "./types": {
+ "node": {
+ "require": "./lib/node/cjs/shared/types.js",
+ "import": "./lib/node/esm/shared/types.js"
+ },
+ "browser": {
+ "require": "./lib/browser/bundle/index.js",
+ "import": "./lib/browser/esm/shared/types.js"
+ },
+ "default": {
+ "require": "./lib/node/cjs/shared/types.js",
+ "import": "./lib/node/esm/shared/types.js"
+ }
+ },
+
+ "./bundle": "./lib/browser/bundle/index.js",
+
+ "./lib/browser/bundle/index": "./lib/browser/bundle/index",
+ "./lib/browser/bundle/index.js": "./lib/browser/bundle/index.js",
+
+
+ "./lib/node/cjs/node/index": "./lib/node/cjs/node/index",
+ "./lib/node/esm/node/index": "./lib/node/esm/node/index",
+ "./lib/browser/esm/browser/index": "./lib/browser/esm/browser/index",
+
+ "./lib/node/cjs/node/index.js": "./lib/node/cjs/node/index.js",
+ "./lib/node/esm/node/index.js": "./lib/node/esm/node/index.js",
+ "./lib/browser/esm/browser/index.js": "./lib/browser/esm/browser/index.js",
+
+
+ "./lib/node/cjs/node/svg": "./lib/node/cjs/node/svg",
+ "./lib/node/esm/node/svg": "./lib/node/esm/node/svg",
+ "./lib/browser/esm/browser/svg": "./lib/browser/esm/browser/svg",
+
+ "./lib/node/cjs/node/svg.js": "./lib/node/cjs/node/svg.js",
+ "./lib/node/esm/node/svg.js": "./lib/node/esm/node/svg.js",
+ "./lib/browser/esm/browser/svg.js": "./lib/browser/esm/browser/svg.js",
+
+
+ "./lib/node/cjs/node/pdf": "./lib/node/cjs/node/pdf",
+ "./lib/node/esm/node/pdf": "./lib/node/esm/node/pdf",
+ "./lib/browser/esm/browser/pdf": "./lib/browser/esm/browser/pdf",
+
+ "./lib/node/cjs/node/pdf.js": "./lib/node/cjs/node/pdf.js",
+ "./lib/node/esm/node/pdf.js": "./lib/node/esm/node/pdf.js",
+ "./lib/browser/esm/browser/pdf.js": "./lib/browser/esm/browser/pdf.js",
+
+
+ "./lib/node/cjs/shared/utils": "./lib/node/cjs/shared/utils",
+ "./lib/node/esm/shared/utils": "./lib/node/esm/shared/utils",
+ "./lib/browser/esm/shared/utils": "./lib/browser/esm/shared/utils",
+
+ "./lib/node/cjs/shared/utils.js": "./lib/node/cjs/shared/utils.js",
+ "./lib/node/esm/shared/utils.js": "./lib/node/esm/shared/utils.js",
+ "./lib/browser/esm/shared/utils.js": "./lib/browser/esm/shared/utils.js",
+
+
+ "./lib/node/cjs/shared/types": "./lib/node/cjs/shared/types",
+ "./lib/node/esm/shared/types": "./lib/node/esm/shared/types",
+ "./lib/browser/esm/shared/types": "./lib/browser/esm/shared/types",
+
+ "./lib/node/cjs/shared/types.js": "./lib/node/cjs/shared/types.js",
+ "./lib/node/esm/shared/types.js": "./lib/node/esm/shared/types.js",
+ "./lib/browser/esm/shared/types.js": "./lib/browser/esm/shared/types.js"
+
+ },
"files": [
- "lib/**/*",
- "pdfkit.d.ts"
+ "lib"
],
"scripts": {
- "test": "tsc && cd tests && sh run.sh",
- "test-windows": "tsc && cd tests && call run-windows.bat",
- "build": "tsc && webpack --mode production"
+ "test": "npm run build && cd tests && sh run.sh",
+ "build": "tsc -p tsconfig.esm.json && tsc -p tsconfig.cjs.json && tsc -p tsconfig.browser.esm.json && webpack --mode production",
+ "postbuild": "sh fix-exports.sh"
},
"repository": {
"type": "git",
@@ -32,7 +156,9 @@
"qr-fattura",
"qr-facture",
"fattura",
- "facture"
+ "facture",
+ "pdf",
+ "svg"
],
"author": "Roger Schönbächler",
"license": "MIT",
@@ -42,27 +168,32 @@
"homepage": "https://github.com/schoero/SwissQRBill#readme",
"devDependencies": {
"@types/blob-stream": "^0.1.30",
- "@types/node": "^16.7.2",
+ "@types/node": "^16.10.1",
"@types/qrcode": "^1.4.1",
"@types/qrcode-svg": "^1.1.1",
"@types/svg-parser": "^2.0.3",
- "@typescript-eslint/eslint-plugin": "^4.29.3",
- "@typescript-eslint/parser": "^4.29.3",
+ "@typescript-eslint/eslint-plugin": "^4.31.2",
+ "@typescript-eslint/parser": "^4.31.2",
+ "assert": "^2.0.0",
+ "brfs": "^2.0.2",
+ "browserify-zlib": "^0.2.0",
"buffer": "^6.0.3",
"eslint": "^7.32.0",
"process": "^0.11.10",
- "stream-browserify": "^3.0.0",
- "ts-loader": "^9.2.5",
- "typescript": "^4.3.5",
+ "readable-stream": "^3.6.0",
+ "transform-loader": "^0.2.4",
+ "ts-loader": "^9.2.6",
+ "typescript": "^4.4.3",
"util": "^0.12.4",
- "webpack": "^5.51.1",
+ "webpack": "^5.54.0",
"webpack-cli": "^4.8.0"
},
"dependencies": {
"@schoero/qrcode": "^1.4.5",
+ "@types/pdfkit": "^0.11.2",
"blob-stream": "^0.1.3",
"pdfkit": "^0.12.3",
- "svg-parser": "^2.0.4",
+ "svg-engine": "^0.2.0",
"svgpath": "^2.3.1"
}
}
diff --git a/pdfkit.d.ts b/pdfkit.d.ts
deleted file mode 100644
index 9de41f4..0000000
--- a/pdfkit.d.ts
+++ /dev/null
@@ -1,473 +0,0 @@
-// Type definitions for Pdfkit v0.10.0
-// Project: http://pdfkit.org
-// Definitions by: Eric Hillah
-// Erik Berreßem
-// Jeroen Vervaeke
-// Thales Agapito
-// Evgeny Baram
-// BamButz
-// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
-
-///
-
-declare namespace PDFKit {
- interface PDFGradient {
- new (document: any): PDFGradient;
- stop(pos: number, color?: string | PDFKit.PDFGradient, opacity?: number): PDFGradient;
- embed(): void;
- apply(): void;
- }
-
- interface PDFLinearGradient extends PDFGradient {
- new (document: any, x1: number, y1: number, x2: number, y2: number): PDFLinearGradient;
- shader(fn: () => any): any;
- opacityGradient(): PDFLinearGradient;
- }
-
- interface PDFRadialGradient extends PDFGradient {
- new (document: any, x1: number, y1: number, x2: number, y2: number): PDFRadialGradient;
- shader(fn: () => any): any;
- opacityGradient(): PDFRadialGradient;
- }
-}
-
-declare namespace PDFKit.Mixins {
- interface AnnotationOption {
- Type?: string;
- Rect?: any;
- Border?: Array;
- SubType?: string;
- Contents?: string;
- Name?: string;
- color?: string;
- QuadPoints?: Array;
-
- A?: any;
- B?: any;
- C?: any;
- L?: any;
- DA?: string;
- }
-
- interface PDFAnnotation {
- annotate(x: number, y: number, w: number, h: number, option: AnnotationOption): this;
- note(x: number, y: number, w: number, h: number, content: string, option?: AnnotationOption): this;
- goTo(x: number, y: number, w: number, h: number, name: string, options?: AnnotationOption): this;
- link(x: number, y: number, w: number, h: number, url: string, option?: AnnotationOption): this;
- highlight(x: number, y: number, w: number, h: number, option?: AnnotationOption): this;
- underline(x: number, y: number, w: number, h: number, option?: AnnotationOption): this;
- strike(x: number, y: number, w: number, h: number, option?: AnnotationOption): this;
- lineAnnotation(x1: number, y1: number, x2: number, y2: number, option?: AnnotationOption): this;
- rectAnnotation(x: number, y: number, w: number, h: number, option?: AnnotationOption): this;
- ellipseAnnotation(x: number, y: number, w: number, h: number, option?: AnnotationOption): this;
- textAnnotation(x: number, y: number, w: number, h: number, text: string, option?: AnnotationOption): this;
- }
-
- // The color forms accepted by PDFKit:
- // example: "red" [R, G, B] [C, M, Y, K]
- type ColorValue = string | PDFGradient | [number, number, number] | [number, number, number, number];
-
- // The winding / filling rule accepted by PDFKit:
- type RuleValue = "even-odd" | "evenodd" | "non-zero" | "nonzero";
-
- // Text option opentype features as listed at https://docs.microsoft.com/en-us/typography/opentype/spec/featurelist
- type OpenTypeFeatures =
- | "aalt" | "abvf" | "abvm" | "abvs" | "afrc" | "akhn" | "blwf" | "blwm" | "blws" | "calt" | "case"
- | "cfar" | "cjct" | "clig" | "cpct" | "cpsp" | "cswh" | "curs" | "cv01" | "cv02" | "cv03" | "cv04"
- | "cv05" | "cv06" | "cv07" | "cv08" | "cv09" | "cv10" | "cv11" | "cv12" | "cv13" | "cv14" | "cv15"
- | "cv16" | "cv17" | "cv18" | "cv19" | "cv20" | "cv21" | "cv22" | "cv23" | "cv24" | "cv25" | "cv26"
- | "cv27" | "cv28" | "cv29" | "cv30" | "cv31" | "cv32" | "cv33" | "cv34" | "cv35" | "cv36" | "cv37"
- | "cv38" | "cv39" | "cv40" | "cv41" | "cv42" | "cv43" | "cv44" | "cv45" | "cv46" | "cv47" | "cv48"
- | "cv49" | "cv50" | "cv51" | "cv52" | "cv53" | "cv54" | "cv55" | "cv56" | "cv57" | "cv58" | "cv59"
- | "cv60" | "cv61" | "cv62" | "cv63" | "cv64" | "cv65" | "cv66" | "cv67" | "cv68" | "cv69" | "cv70"
- | "cv71" | "cv72" | "cv73" | "cv74" | "cv75" | "cv76" | "cv77" | "cv78" | "cv79" | "cv80" | "cv81"
- | "cv82" | "cv83" | "cv84" | "cv85" | "cv86" | "cv87" | "cv88" | "cv89" | "cv90" | "cv91" | "cv92"
- | "cv93" | "cv94" | "cv95" | "cv96" | "cv97" | "cv98" | "cv99" | "c2pc" | "c2sc" | "dist" | "ccmp"
- | "dlig" | "dnom" | "dtls" | "expt" | "falt" | "fin2" | "fin3" | "fina" | "flac" | "frac" | "fwid"
- | "half" | "haln" | "halt" | "hist" | "hkna" | "hlig" | "hngl" | "hojo" | "hwid" | "init" | "isol"
- | "ital" | "jalt" | "jp78" | "jp83" | "jp90" | "jp04" | "kern" | "lfbd" | "liga" | "ljmo" | "lnum"
- | "locl" | "ltra" | "ltrm" | "mark" | "med2" | "medi" | "mgrk" | "mkmk" | "mset" | "nalt" | "nlck"
- | "nukt" | "numr" | "onum" | "opbd" | "ordn" | "ornm" | "palt" | "pcap" | "pkna" | "pnum" | "pref"
- | "pres" | "pstf" | "psts" | "pwid" | "qwid" | "rand" | "rclt" | "rkrf" | "rlig" | "rphf" | "rtbd"
- | "rtla" | "rtlm" | "ruby" | "rvrn" | "salt" | "sinf" | "size" | "smcp" | "smpl" | "ss01" | "ss02"
- | "ss03" | "ss04" | "ss05" | "ss06" | "ss07" | "ss08" | "ss09" | "ss10" | "ss11" | "ss12" | "ss13"
- | "ss14" | "ss15" | "ss16" | "ss17" | "ss18" | "ss19" | "ss20" | "ssty" | "stch" | "subs" | "sups"
- | "swsh" | "titl" | "tjmo" | "tnam" | "tnum" | "trad" | "twid" | "unic" | "valt" | "vatu" | "vert"
- | "vhal" | "vjmo" | "vkna" | "vkrn" | "vpal" | "vrt2" | "vrtr" | "zero";
-
- interface PDFColor {
- fillColor(color: ColorValue, opacity?: number): this;
- strokeColor(color: ColorValue, opacity?: number): this;
- opacity(opacity: number): this;
- fillOpacity(opacity: number): this;
- strokeOpacity(opacity: number): this;
- linearGradient(x1: number, y1: number, x2: number, y2: number): PDFLinearGradient;
- radialGradient(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): PDFRadialGradient;
- }
-
- type PDFFontSource = string | Buffer | Uint8Array | ArrayBuffer;
-
- interface PDFFont {
- font(buffer: Buffer): this;
- font(src: string, family?: string, size?: number): this;
- fontSize(size: number): this;
- currentLineHeight(includeGap?: boolean): number;
- registerFont(name: string, src?: PDFFontSource, family?: string): this;
- }
-
- interface ImageOption {
- width?: number;
- height?: number;
- /** Scale percentage */
- scale?: number;
- /** Two elements array specifying dimensions(w,h) */
- fit?: [number, number];
- cover?: [number, number];
- align?: "center" | "right";
- valign?: "center" | "bottom";
- link?: AnnotationOption;
- goTo?: AnnotationOption;
- destination?: string;
- }
-
- interface PDFImage {
- /**
- * Draw an image in PDFKit document.
- */
- image(src: any, x?: number, y?: number, options?: ImageOption): this;
- image(src: any, options?: ImageOption): this;
- }
-
- interface TextOptions {
- /** Set to false to disable line wrapping all together */
- lineBreak?: boolean;
- /** The width that text should be wrapped to (by default, the page width minus the left and right margin) */
- width?: number;
- /** The maximum height that text should be clipped to */
- height?: number;
- /** The character to display at the end of the text when it is too long. Set to true to use the default character. */
- ellipsis?: boolean | string;
- /** the number of columns to flow the text into */
- columns?: number;
- /** the amount of space between each column (1/4 inch by default) */
- columnGap?: number;
- /** The amount in PDF points (72 per inch) to indent each paragraph of text */
- indent?: number;
- /** the amount of space between each paragraph of text */
- paragraphGap?: number;
- /** the amount of space between each line of text */
- lineGap?: number;
- /** the amount of space between each word in the text */
- wordSpacing?: number;
- /** the amount of space between each character in the text */
- characterSpacing?: number;
- /** whether to fill the text (true by default) */
- fill?: boolean;
- /** whether to stroke the text */
- stroke?: boolean;
- /** A URL to link this text to (shortcut to create an annotation) */
- link?: string;
- /** whether to underline the text */
- underline?: boolean;
- /** whether to strike out the text */
- strike?: boolean;
- /** whether the text segment will be followed immediately by another segment. Useful for changing styling in the middle of a paragraph. */
- continued?: boolean;
- /** whether to slant the text (angle in degrees or true) */
- oblique?: boolean | number;
- /** the alignment of the text (center, justify, left, right) */
- //TODO check this
- align?: "center" | "justify" | "left" | "right" | string;
- /** the vertical alignment of the text with respect to its insertion point */
- baseline?: number | "svg-middle" | "middle" | "svg-central" | "bottom" | "ideographic" | "alphabetic" | "mathematical" | "hanging" | "top";
- /** an array of OpenType feature tags to apply. If not provided, a set of defaults is used. */
- features?: OpenTypeFeatures[];
- }
-
- interface PDFText {
- lineGap(lineGap: number): this;
- moveDown(line?: number): this;
- moveUp(line?: number): this;
- text(text: string, x?: number, y?: number, options?: TextOptions): this;
- text(text: string, options?: TextOptions): this;
- widthOfString(text: string, options?: TextOptions): number;
- heightOfString(text: string, options?: TextOptions): number;
- list(list: Array, x?: number, y?: number, options?: TextOptions): this;
- list(list: Array, options?: TextOptions): this;
- }
-
- interface PDFVector {
- save(): this;
- restore(): this;
- closePath(): this;
- lineWidth(w: number): this;
- lineCap(c: string): this;
- lineJoin(j: string): this;
- miterLimit(m: any): this;
- dash(length: number, option: any): this;
- undash(): this;
- moveTo(x: number, y: number): this;
- lineTo(x: number, y: number): this;
- bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): this;
- quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): this;
- rect(x: number, y: number, w: number, h: number): this;
- roundedRect(x: number, y: number, w: number, h: number, r?: number): this;
- ellipse(x: number, y: number, r1: number, r2?: number): this;
- circle(x: number, y: number, raduis: number): this;
- polygon(...points: number[][]): this;
- path(path: string): this;
- fill(color?: ColorValue, rule?: RuleValue): this;
- fill(rule: RuleValue): this;
- stroke(color?: ColorValue): this;
- fillAndStroke(fillColor?: ColorValue, strokeColor?: ColorValue, rule?: RuleValue): this;
- fillAndStroke(fillColor: ColorValue, rule?: RuleValue): this;
- fillAndStroke(rule: RuleValue): this;
- clip(rule?: RuleValue): this;
- transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): this;
- translate(x: number, y: number): this;
- rotate(angle: number, options?: { origin?: number[] }): this;
- scale(xFactor: number, yFactor?: number, options?: { origin?: number[] }): this;
- }
-}
-
-declare namespace PDFKit {
- /**
- * PDFKit data
- */
- interface PDFData {
- new (data: any[]): PDFData;
- readByte(): any;
- writeByte(byte: any): void;
- byteAt(index: number): any;
- readBool(): boolean;
- writeBool(val: boolean): boolean;
- readUInt32(): number;
- writeUInt32(val: number): void;
- readInt32(): number;
- writeInt32(val: number): void;
- readUInt16(): number;
- writeUInt16(val: number): void;
- readInt16(): number;
- writeInt16(val: number): void;
- readString(length: number): string;
- writeString(val: string): void;
- stringAt(pos: number, length: number): string;
- readShort(): number;
- writeShort(val: number): void;
- readLongLong(): number;
- writeLongLong(val: number): void;
- readInt(): number;
- writeInt(val: number): void;
- slice(start: number, end: number): any[];
- read(length: number): any[];
- write(bytes: any[]): void;
- }
-}
-
-declare module "pdfkit/js/data" {
- var PDFKitData: PDFKit.PDFData;
- export = PDFKitData;
-}
-
-declare namespace PDFKit {
- interface DocumentInfo {
- Producer?: string;
- Creator?: string;
- CreationDate?: Date;
- Title?: string;
- Author?: string;
- Keywords?: string;
- ModDate?: Date;
- }
-
- interface DocumentPermissions {
- modifying?: boolean;
- copying?: boolean;
- annotating?: boolean;
- fillingForms?: boolean;
- contentAccessibility?: boolean;
- documentAssembly?: boolean;
- printing?: "lowResolution" | "highResolution";
- }
-
- interface PDFDocumentOptions {
- compress?: boolean;
- info?: DocumentInfo;
- userPassword?: string;
- ownerPassword?: string;
- permissions?: DocumentPermissions;
- pdfVersion?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.7ext3";
- autoFirstPage?: boolean;
- size?: number[] | string;
- margin?: number;
- margins?: { top: number; left: number; bottom: number; right: number };
- layout?: "portrait" | "landscape";
-
- bufferPages?: boolean;
- }
-
- interface PDFDocument
- extends NodeJS.ReadableStream,
- Mixins.PDFAnnotation,
- Mixins.PDFColor,
- Mixins.PDFImage,
- Mixins.PDFText,
- Mixins.PDFVector,
- Mixins.PDFFont {
- /**
- * PDF Version
- */
- version: number;
- /**
- * Wheter streams should be compressed
- */
- compress: boolean;
- /**
- * PDF document Metadata
- */
- info: DocumentInfo;
- /**
- * Options for the document
- */
- options: PDFDocumentOptions;
- /**
- * Represent the current page.
- */
- page: PDFPage;
-
- x: number;
- y: number;
-
- new (options?: PDFDocumentOptions): PDFDocument;
-
- addPage(options?: PDFDocumentOptions): PDFDocument;
- bufferedPageRange(): { start: number; count: number };
- switchToPage(n?: number): PDFPage;
- flushPages(): void;
- ref(data: {}): PDFKitReference;
- addContent(data: any): PDFDocument;
- /**
- * Deprecated
- */
- write(fileName: string, fn: any): void;
- /**
- * Deprecated. Throws exception
- */
- output(fn: any): void;
- end(): void;
- toString(): string;
- }
-}
-
-declare module "pdfkit" {
- var doc: PDFKit.PDFDocument;
- export = doc;
-}
-
-declare module "pdfkit/js/pdfkit.standalone" {
- var doc: PDFKit.PDFDocument;
- export = doc;
-}
-
-declare module "pdfkit/js/gradient" {
- var gradient: {
- PDFGradient: PDFKit.PDFGradient;
- PDFLinearGradient: PDFKit.PDFLinearGradient;
- PDFRadialGradiant: PDFKit.PDFRadialGradient;
- };
-
- export = gradient;
-}
-
-declare namespace PDFKit {
- /**
- * Represent a single page in the PDF document
- */
- interface PDFPage {
- size: string;
- layout: string;
- margins: { top: number; left: number; bottom: number; right: number };
- width: number;
- height: number;
- document: PDFDocument;
- content: PDFKitReference;
-
- /**
- * The page dictionnary
- */
- dictionary: PDFKitReference;
-
- fonts: any;
- xobjects: any;
- ext_gstates: any;
- patterns: any;
- annotations: any;
-
- maxY(): number;
- write(chunk: any): void;
- end(): void;
- }
-}
-
-declare module "pdfkit/js/page" {
- var PDFKitPage: PDFKit.PDFPage;
-
- export = PDFKitPage;
-}
-
-declare namespace PDFKit {
- /** PDFReference - represents a reference to another object in the PDF object heirarchy */
- class PDFKitReference {
- id: number;
- gen: number;
- deflate: any;
- compress: boolean;
- uncompressedLength: number;
- chunks: any[];
- data: { Font?: any; XObject?: any; ExtGState?: any; Pattern: any; Annots: any };
- document: PDFDocument;
-
- constructor(document: PDFDocument, id: number, data: {});
- initDeflate(): void;
- write(chunk: any): void;
- end(chunk: any): void;
- finalize(): void;
- toString(): string;
- }
-}
-
-declare module "pdfkit/js/reference" {
- var PDFKitReference: PDFKit.PDFKitReference;
-
- export = PDFKitReference;
-}
-
-declare module "pdfkit/js/mixins/annotations" {
- var PDFKitAnnotation: PDFKit.Mixins.PDFAnnotation;
- export = PDFKitAnnotation;
-}
-
-declare module "pdfkit/js/mixins/color" {
- var PDFKitColor: PDFKit.Mixins.PDFColor;
- export = PDFKitColor;
-}
-
-declare module "pdfkit/js/mixins/fonts" {
- var PDFKitFont: PDFKit.Mixins.PDFFont;
- export = PDFKitFont;
-}
-
-declare module "pdfkit/js/mixins/images" {
- var PDFKitImage: PDFKit.Mixins.PDFImage;
- export = PDFKitImage;
-}
-
-declare module "pdfkit/js/mixins/text" {
- var PDFKitText: PDFKit.Mixins.PDFText;
- export = PDFKitText;
-}
-
-declare module "pdfkit/js/mixins/vector" {
- var PDFKitVector: PDFKit.Mixins.PDFVector;
- export = PDFKitVector;
-}
diff --git a/src/browser.ts b/src/browser.ts
deleted file mode 100644
index 1f96a10..0000000
--- a/src/browser.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-import * as SwissQRBill_ from "./swissqrbill";
-import BlobStream_ from "blob-stream";
-
-module SwissQRBill {
-
- export import data = SwissQRBill_.data;
- export import debtor = SwissQRBill_.debtor;
- export import creditor = SwissQRBill_.creditor;
- export import options = SwissQRBill_.options;
- export import PDFTable = SwissQRBill_.PDFTable;
- export import PDFRow = SwissQRBill_.PDFRow;
- export import PDFColumn = SwissQRBill_.PDFColumn;
- export import currency = SwissQRBill_.currency;
- export import size = SwissQRBill_.size;
- export import languages = SwissQRBill_.languages;
-
- export import utils = SwissQRBill_.utils;
-
- export import blobStream = BlobStream_;
- export import BlobStream = BlobStream_;
-
- export class PDF extends SwissQRBill_.PDF {
-
- constructor(data: data, writableStream: BlobStream_.IBlobStream, options?: options)
- constructor(data: data, writableStream: BlobStream_.IBlobStream, options?: options, callback?: Function)
- constructor(data: data, writableStream: BlobStream_.IBlobStream, callback?: Function)
- constructor(data: data, writableStream: BlobStream_.IBlobStream, optionsOrCallback?: options | Function, callbackOrUndefined?: Function | undefined) {
-
- let callback: Function | undefined = undefined;
- let options: options | undefined = undefined;
-
- if(typeof optionsOrCallback === "object"){
-
- options = optionsOrCallback;
-
- if(typeof callbackOrUndefined === "function"){
- callback = callbackOrUndefined;
- }
-
- } else if(typeof optionsOrCallback === "function"){
- callback = optionsOrCallback;
- }
-
- super(data, options);
-
- const stream = super.pipe(writableStream);
-
- stream.on("finish", ev => {
-
- if(typeof callback === "function"){
- callback(this);
- }
-
- this.emit("finish", ev);
-
- });
-
- }
-
- }
-
-}
-
-export default SwissQRBill;
\ No newline at end of file
diff --git a/src/browser/bundle.ts b/src/browser/bundle.ts
new file mode 100644
index 0000000..b34cbe3
--- /dev/null
+++ b/src/browser/bundle.ts
@@ -0,0 +1,40 @@
+import { PDF } from "./pdf.js";
+import { SVG } from "./svg.js";
+import BlobStream_ from "blob-stream";
+
+import * as utils from "../shared/utils.js";
+export * as utils from "../shared/utils.js";
+
+import * as types from "../shared/types.js";
+export * as types from "../shared/types.js";
+
+export * from "./svg.js";
+export * from "./pdf.js";
+
+import fs from "fs";
+
+
+//-- Register fonts for the bundled version
+
+//@ts-ignore
+import Helvetica from "../../node_modules/pdfkit/js/data/Helvetica.afm";
+//@ts-ignore
+import HelveticaBold from "../../node_modules/pdfkit/js/data/Helvetica-Bold.afm";
+
+fs.writeFileSync("data/Helvetica.afm", Helvetica);
+fs.writeFileSync("data/Helvetica-Bold.afm", HelveticaBold);
+
+
+export import blobStream = BlobStream_;
+export import BlobStream = BlobStream_;
+
+const SwissQRBill = {
+ utils: utils,
+ types: types,
+ BlobStream: BlobStream_,
+ blobStream: BlobStream_,
+ PDF: PDF,
+ SVG: SVG
+};
+
+export default SwissQRBill;
\ No newline at end of file
diff --git a/src/browser/index.ts b/src/browser/index.ts
new file mode 100644
index 0000000..c9a6795
--- /dev/null
+++ b/src/browser/index.ts
@@ -0,0 +1,23 @@
+import { PDF, BlobStream } from "./pdf.js";
+import { SVG } from "./svg.js";
+
+import * as utils from "../shared/utils.js";
+export * as utils from "../shared/utils.js";
+
+import * as types from "../shared/types.js";
+export * as types from "../shared/types.js";
+
+export * from "./svg.js";
+export * from "./pdf.js";
+
+
+const SwissQRBill = {
+ utils: utils,
+ types: types,
+ BlobStream: BlobStream,
+ blobStream: BlobStream,
+ PDF: PDF,
+ SVG: SVG
+};
+
+export default SwissQRBill;
\ No newline at end of file
diff --git a/src/browser/pdf.ts b/src/browser/pdf.ts
new file mode 100644
index 0000000..d27465d
--- /dev/null
+++ b/src/browser/pdf.ts
@@ -0,0 +1,47 @@
+import { PDF_ } from "../pdf/pdf.js";
+import { default as BlobStream_, IBlobStream } from "blob-stream";
+import { PDFOptions, Data } from "../shared/types.js";
+
+export import blobStream = BlobStream_;
+export import BlobStream = BlobStream_;
+
+
+export class PDF extends PDF_ {
+
+ constructor(data: Data, writableStream: IBlobStream, options?: PDFOptions)
+ constructor(data: Data, writeableStream: IBlobStream, options?: PDFOptions, callback?: Function)
+ constructor(data: Data, writeableStream: IBlobStream, callback?: Function)
+ constructor(data: Data, writeableStream: IBlobStream, optionsOrCallback?: PDFOptions | Function, callbackOrUndefined?: Function | undefined) {
+
+ let callback: Function | undefined = undefined;
+ let options: PDFOptions | undefined = undefined;
+
+ if(typeof optionsOrCallback === "object"){
+
+ options = optionsOrCallback;
+
+ if(typeof callbackOrUndefined === "function"){
+ callback = callbackOrUndefined;
+ }
+
+ } else if(typeof optionsOrCallback === "function"){
+ callback = optionsOrCallback;
+ }
+
+ super(data, options);
+
+ const stream = this.pipe(writeableStream);
+
+ stream.on("finish", ev => {
+
+ if(typeof callback === "function"){
+ callback(this);
+ }
+
+ this.emit("finish", ev);
+
+ });
+
+ }
+
+}
diff --git a/src/browser/svg.ts b/src/browser/svg.ts
new file mode 100644
index 0000000..319cc21
--- /dev/null
+++ b/src/browser/svg.ts
@@ -0,0 +1,21 @@
+import { SVG_ } from "../svg/svg.js";
+import { SVGOptions, Data } from "../shared/types.js";
+
+
+export class SVG extends SVG_ {
+
+ constructor(data: Data, options?: SVGOptions) {
+ super(data, options);
+ }
+
+
+ public toString(): string {
+ return this.outerHTML;
+ }
+
+
+ public get element(): SVGElement {
+ return this.instance.element as unknown as SVGElement;
+ }
+
+}
\ No newline at end of file
diff --git a/src/extended-pdf.ts b/src/extended-pdf.ts
deleted file mode 100644
index 44954b5..0000000
--- a/src/extended-pdf.ts
+++ /dev/null
@@ -1,238 +0,0 @@
-///
-import PDFDocument from "pdfkit/js/pdfkit.standalone";
-import svgpath from "svgpath";
-
-module ExtendedPDF {
-
- export interface PDFTable {
- rows: Array,
- width?: number,
- x?: number,
- y?: number,
- padding?: number | [number, number?, number?, number?],
- lineWidth?: number,
- font?: string,
- fontSize?: number
- }
-
- export interface PDFRow {
- columns: Array,
- fillColor?: string,
- strokeColor?: string,
- height?: number,
- padding?: number | [number, number?, number?, number?],
- font?: string,
- fontSize?: number,
- header?: boolean
- }
-
- export interface PDFColumn {
- text: string | number | boolean,
- width?: number,
- padding?: number | [number, number?, number?, number?],
- fillColor?: string,
- strokeColor?: string,
- font?: string,
- fontSize?: number,
- textOptions?: PDFKit.Mixins.TextOptions
- }
-
- export class PDF extends PDFDocument {
-
- constructor(options?: PDFKit.PDFDocumentOptions){
-
- super(options);
-
- }
-
-
- public addTable(table: PDFTable): PDFKit.PDFDocument {
-
- if(table.rows === undefined){
- throw new Error("No table rows provided.");
- }
-
- const tableX = table.x !== undefined ? table.x : this.x;
- const tableY = table.y !== undefined ? table.y : this.y;
- const tableWidth = table.width !== undefined ? table.width : this.page.width - tableX - this.page.margins.right;
- const amountOfRows = table.rows.length;
- const lineWidth = table.lineWidth !== undefined ? table.lineWidth : 0.3;
- const defaultPadding = 5;
- const basePadding = table.padding !== undefined ? table.padding : defaultPadding;
- const baseFontSize = table.fontSize !== undefined ? table.fontSize: 11;
- const baseFont = table.font !== undefined ? table.font: "Helvetica";
-
- let rowY = tableY;
- rowLoop: for(let rowIndex = 0; rowIndex < table.rows.length; rowIndex ++){
-
- const row = table.rows[rowIndex];
-
- const amountOfColumns = row.columns.length;
- const columnWidth = tableWidth / amountOfColumns;
- const rowNumber = rowIndex + 1;
-
- let rowHeight = row.height !== undefined ? row.height : 20;
- let padding = row.padding !== undefined ? row.padding : basePadding;
- let fillColor = row.fillColor !== undefined ? row.fillColor : "";
- let strokeColor = row.strokeColor !== undefined ? row.strokeColor : "";
- let fontSize = row.fontSize !== undefined ? row.fontSize : baseFontSize;
- let font = row.font !== undefined ? row.font : baseFont;
-
-
- //-- Move to start position
-
- this.moveTo(tableX, tableY);
- this.lineWidth(lineWidth);
-
-
- //-- Draw columns
-
- let columnX = tableX;
- for(let columnIndex = 0; columnIndex < row.columns.length; columnIndex++){
-
- const column = row.columns[columnIndex];
- const columnNumber = columnIndex + 1;
- let remainingColumns = row.columns.length;
-
-
- //-- Calculate autowidth
-
- let widthUsed = 0;
- for(const rowColumn of row.columns){
- if(rowColumn.width !== undefined){
- widthUsed += rowColumn.width;
- remainingColumns --;
- }
- }
-
-
- //-- Set properties
-
- const columnWidth = column.width !== undefined ? column.width : (tableWidth - widthUsed) / (remainingColumns);
- padding = column.padding !== undefined ? column.padding : padding;
- fillColor = column.fillColor !== undefined ? column.fillColor : fillColor;
- strokeColor = column.strokeColor !== undefined ? column.strokeColor : strokeColor;
- fontSize = column.fontSize !== undefined ? fontSize = column.fontSize : fontSize;
- font = column.font !== undefined ? font = column.font : font;
- const fillOpacity = fillColor === "" ? 0 : 1;
- const strokeOpacity = strokeColor === "" ? 0 : 1;
-
-
- //-- Apply text options
-
- const textOptions: PDFKit.Mixins.TextOptions = {
- width: columnWidth,
- lineBreak: true,
- baseline: "top"
- };
-
- if(column.textOptions !== undefined){
- Object.assign(textOptions, column.textOptions);
- }
-
- this.moveTo(columnX + columnWidth, rowY);
-
- this.font(font);
- this.fontSize(fontSize);
-
-
- //-- Set padding
-
- let paddings = {
- top: defaultPadding,
- right: defaultPadding,
- bottom: defaultPadding,
- left: defaultPadding
- };
-
- if(typeof padding === "object"){
- if(padding[0] !== undefined){ paddings.top = padding[0]; }
- if(padding[1] !== undefined){ paddings.right = padding[1]; }
- if(padding[2] !== undefined){ paddings.bottom = padding[2]; }
- if(padding[3] !== undefined){ paddings.left = padding[3]; }
- } else if(typeof padding === "number"){
- paddings = {
- top: padding,
- right: padding,
- bottom: padding,
- left: padding
- };
- }
-
- const columnHeight = this.heightOfString(column.text + "", textOptions) + paddings.top + paddings.bottom;
-
- if(columnHeight > rowHeight){
- rowHeight = columnHeight;
- }
-
- textOptions.height = rowHeight;
-
-
- //-- Check for page overflow
-
- if(rowY + rowHeight >= this.page.height - this.page.margins.bottom){
-
-
- //-- Insert new page
-
- this.addPage();
- rowY = this.y;
-
-
- //-- Insert header
-
- for(const headerRow of table.rows){
- if(headerRow.header === true){
- table.rows.splice(rowIndex, 0, headerRow, headerRow);
- continue rowLoop;
- }
- }
-
- }
-
-
- //-- Draw rectangle
-
- this.rect(columnX, rowY, columnWidth, rowHeight)
- .fillColor(fillColor)
- .fillOpacity(fillOpacity)
- .strokeOpacity(strokeOpacity)
- .strokeColor(strokeColor)
- .fillAndStroke();
-
-
- this.fillColor("black")
- .fillOpacity(1);
-
- this.text(column.text + "", columnX + paddings.left, rowY + paddings.top, textOptions);
-
- columnX = columnX + columnWidth;
-
- }
-
- rowY = rowY + rowHeight;
-
- }
-
- return this;
-
- }
-
-
- public addPath(path: string, x: number, y: number): PDFKit.PDFDocument {
-
- path = svgpath(path)
- .translate(x, y)
- .toString();
-
- this.path(path);
-
- return this;
-
- }
-
- }
-
-}
-
-export = ExtendedPDF;
\ No newline at end of file
diff --git a/src/node.ts b/src/node.ts
deleted file mode 100644
index 78b92a0..0000000
--- a/src/node.ts
+++ /dev/null
@@ -1,74 +0,0 @@
-import fs from "fs";
-import stream from "stream";
-import * as SwissQRBill_ from "./swissqrbill";
-
-
-module SwissQRBill {
-
- export import data = SwissQRBill_.data;
- export import debtor = SwissQRBill_.debtor;
- export import creditor = SwissQRBill_.creditor;
- export import options = SwissQRBill_.options;
- export import PDFTable = SwissQRBill_.PDFTable;
- export import PDFRow = SwissQRBill_.PDFRow;
- export import PDFColumn = SwissQRBill_.PDFColumn;
- export import currency = SwissQRBill_.currency;
- export import size = SwissQRBill_.size;
- export import languages = SwissQRBill_.languages;
-
- export import utils = SwissQRBill_.utils;
-
- export class PDF extends SwissQRBill_.PDF {
-
- constructor(data: data, outputPath: string, options?: options)
- constructor(data: data, writableStream: stream.Writable, options?: options)
- constructor(data: data, outputPath: string, options?: options, callback?: Function)
- constructor(data: data, writableStream: stream.Writable, options?: options, callback?: Function)
- constructor(data: data, outputPath: string, callback?: Function)
- constructor(data: data, writableStream: stream.Writable, callback?: Function)
- constructor(data: data, outputPathOrWritableStream: string | stream.Writable, optionsOrCallback?: options | Function, callbackOrUndefined?: Function | undefined) {
-
- let callback: Function | undefined = undefined;
- let options: options | undefined = undefined;
-
- if(typeof optionsOrCallback === "object"){
-
- options = optionsOrCallback;
-
- if(typeof callbackOrUndefined === "function"){
- callback = callbackOrUndefined;
- }
-
- } else if(typeof optionsOrCallback === "function"){
- callback = optionsOrCallback;
- }
-
- super(data, options);
-
- let stream: stream.Writable | undefined;
-
- if(typeof outputPathOrWritableStream === "string"){
- stream = fs.createWriteStream(outputPathOrWritableStream);
- } else {
- stream = outputPathOrWritableStream;
- }
-
- super.pipe(stream);
-
- stream.on("finish", ev => {
-
- if(typeof callback === "function"){
- callback(this);
- }
-
- this.emit("finish", ev);
-
- });
-
- }
-
- }
-
-}
-
-export = SwissQRBill;
\ No newline at end of file
diff --git a/src/node/index.ts b/src/node/index.ts
new file mode 100644
index 0000000..93f1e77
--- /dev/null
+++ b/src/node/index.ts
@@ -0,0 +1,21 @@
+import { PDF } from "./pdf.js";
+import { SVG } from "./svg.js";
+
+import * as utils from "../shared/utils.js";
+export * as utils from "../shared/utils.js";
+
+import * as types from "../shared/types.js";
+export * as types from "../shared/types.js";
+
+export * from "./svg.js";
+export * from "./pdf.js";
+
+
+const SwissQRBill = {
+ utils: utils,
+ types: types,
+ PDF: PDF,
+ SVG: SVG
+};
+
+export default SwissQRBill;
\ No newline at end of file
diff --git a/src/node/pdf.ts b/src/node/pdf.ts
new file mode 100644
index 0000000..84728bd
--- /dev/null
+++ b/src/node/pdf.ts
@@ -0,0 +1,56 @@
+import { createWriteStream } from "fs";
+import { Writable } from "stream";
+import { PDF_ } from "../pdf/pdf.js";
+import { PDFOptions, Data } from "../shared/types.js";
+
+
+export class PDF extends PDF_ {
+
+ constructor(data: Data, outputPath: string, options?: PDFOptions)
+ constructor(data: Data, writableStream: Writable, options?: PDFOptions)
+ constructor(data: Data, outputPath: string, options?: PDFOptions, callback?: Function)
+ constructor(data: Data, writableStream: Writable, options?: PDFOptions, callback?: Function)
+ constructor(data: Data, outputPath: string, callback?: Function)
+ constructor(data: Data, writableStream: Writable, callback?: Function)
+ constructor(data: Data, outputPathOrWritableStream: string | Writable, optionsOrCallback?: PDFOptions | Function, callbackOrUndefined?: Function | undefined) {
+
+ let callback: Function | undefined = undefined;
+ let options: PDFOptions | undefined = undefined;
+
+ if(typeof optionsOrCallback === "object"){
+
+ options = optionsOrCallback;
+
+ if(typeof callbackOrUndefined === "function"){
+ callback = callbackOrUndefined;
+ }
+
+ } else if(typeof optionsOrCallback === "function"){
+ callback = optionsOrCallback;
+ }
+
+ super(data, options);
+
+ let stream: Writable | undefined;
+
+ if(typeof outputPathOrWritableStream === "string"){
+ stream = createWriteStream(outputPathOrWritableStream);
+ } else {
+ stream = outputPathOrWritableStream;
+ }
+
+ super.pipe(stream);
+
+ stream.on("finish", ev => {
+
+ if(typeof callback === "function"){
+ callback(this);
+ }
+
+ this.emit("finish", ev);
+
+ });
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/node/svg.ts b/src/node/svg.ts
new file mode 100644
index 0000000..74fc2cc
--- /dev/null
+++ b/src/node/svg.ts
@@ -0,0 +1,15 @@
+import { SVG_ } from "../svg/svg.js";
+import { SVGOptions, Data } from "../shared/types.js";
+
+
+export class SVG extends SVG_ {
+
+ constructor(data: Data, options?: SVGOptions) {
+ super(data, options);
+ }
+
+ public toString(): string {
+ return this.outerHTML;
+ }
+
+}
diff --git a/src/pdf/extended-pdf.ts b/src/pdf/extended-pdf.ts
new file mode 100644
index 0000000..6c002ca
--- /dev/null
+++ b/src/pdf/extended-pdf.ts
@@ -0,0 +1,230 @@
+import PDFDocument from "pdfkit";
+import svgpath from "svgpath";
+
+
+export interface PDFTable {
+ rows: Array,
+ width?: number,
+ x?: number,
+ y?: number,
+ padding?: number | [number, number?, number?, number?],
+ lineWidth?: number,
+ font?: string,
+ fontSize?: number
+}
+
+export interface PDFRow {
+ columns: Array,
+ fillColor?: string,
+ strokeColor?: string,
+ height?: number,
+ padding?: number | [number, number?, number?, number?],
+ font?: string,
+ fontSize?: number,
+ header?: boolean
+}
+
+export interface PDFColumn {
+ text: string | number | boolean,
+ width?: number,
+ padding?: number | [number, number?, number?, number?],
+ fillColor?: string,
+ strokeColor?: string,
+ font?: string,
+ fontSize?: number,
+ textOptions?: PDFKit.Mixins.TextOptions
+}
+
+export class ExtendedPDF extends PDFDocument {
+
+ constructor(options?: PDFKit.PDFDocumentOptions) {
+ super(options);
+ }
+
+
+ public addTable(table: PDFTable): PDFKit.PDFDocument {
+
+ if(table.rows === undefined){
+ throw new Error("No table rows provided.");
+ }
+
+ const tableX = table.x !== undefined ? table.x : this.x;
+ const tableY = table.y !== undefined ? table.y : this.y;
+ const tableWidth = table.width !== undefined ? table.width : this.page.width - tableX - this.page.margins.right;
+ const amountOfRows = table.rows.length;
+ const lineWidth = table.lineWidth !== undefined ? table.lineWidth : 0.3;
+ const defaultPadding = 5;
+ const basePadding = table.padding !== undefined ? table.padding : defaultPadding;
+ const baseFontSize = table.fontSize !== undefined ? table.fontSize : 11;
+ const baseFont = table.font !== undefined ? table.font : "Helvetica";
+
+ let rowY = tableY;
+ rowLoop: for(let rowIndex = 0; rowIndex < table.rows.length; rowIndex ++){
+
+ const row = table.rows[rowIndex];
+
+ const amountOfColumns = row.columns.length;
+ const columnWidth = tableWidth / amountOfColumns;
+ const rowNumber = rowIndex + 1;
+
+ let rowHeight = row.height !== undefined ? row.height : 20;
+ let padding = row.padding !== undefined ? row.padding : basePadding;
+ let fillColor = row.fillColor !== undefined ? row.fillColor : "";
+ let strokeColor = row.strokeColor !== undefined ? row.strokeColor : "";
+ let fontSize = row.fontSize !== undefined ? row.fontSize : baseFontSize;
+ let font = row.font !== undefined ? row.font : baseFont;
+
+
+ //-- Move to start position
+
+ this.moveTo(tableX, tableY);
+ this.lineWidth(lineWidth);
+
+
+ //-- Draw columns
+
+ let columnX = tableX;
+ for(let columnIndex = 0; columnIndex < row.columns.length; columnIndex++){
+
+ const column = row.columns[columnIndex];
+ const columnNumber = columnIndex + 1;
+ let remainingColumns = row.columns.length;
+
+
+ //-- Calculate autowidth
+
+ let widthUsed = 0;
+ for(const rowColumn of row.columns){
+ if(rowColumn.width !== undefined){
+ widthUsed += rowColumn.width;
+ remainingColumns --;
+ }
+ }
+
+
+ //-- Set properties
+
+ const columnWidth = column.width !== undefined ? column.width : (tableWidth - widthUsed) / (remainingColumns);
+ padding = column.padding !== undefined ? column.padding : padding;
+ fillColor = column.fillColor !== undefined ? column.fillColor : fillColor;
+ strokeColor = column.strokeColor !== undefined ? column.strokeColor : strokeColor;
+ fontSize = column.fontSize !== undefined ? fontSize = column.fontSize : fontSize;
+ font = column.font !== undefined ? font = column.font : font;
+ const fillOpacity = fillColor === "" ? 0 : 1;
+ const strokeOpacity = strokeColor === "" ? 0 : 1;
+
+
+ //-- Apply text options
+
+ const textOptions: PDFKit.Mixins.TextOptions = {
+ width: columnWidth,
+ lineBreak: true,
+ baseline: "top"
+ };
+
+ if(column.textOptions !== undefined){
+ Object.assign(textOptions, column.textOptions);
+ }
+
+ this.moveTo(columnX + columnWidth, rowY);
+
+ this.font(font);
+ this.fontSize(fontSize);
+
+
+ //-- Set padding
+
+ let paddings = {
+ top: defaultPadding,
+ right: defaultPadding,
+ bottom: defaultPadding,
+ left: defaultPadding
+ };
+
+ if(typeof padding === "object"){
+ if(padding[0] !== undefined){ paddings.top = padding[0]; }
+ if(padding[1] !== undefined){ paddings.right = padding[1]; }
+ if(padding[2] !== undefined){ paddings.bottom = padding[2]; }
+ if(padding[3] !== undefined){ paddings.left = padding[3]; }
+ } else if(typeof padding === "number"){
+ paddings = {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+
+ const columnHeight = this.heightOfString(column.text + "", textOptions) + paddings.top + paddings.bottom;
+
+ if(columnHeight > rowHeight){
+ rowHeight = columnHeight;
+ }
+
+ textOptions.height = rowHeight;
+
+
+ //-- Check for page overflow
+
+ if(rowY + rowHeight >= this.page.height - this.page.margins.bottom){
+
+
+ //-- Insert new page
+
+ this.addPage();
+ rowY = this.y;
+
+
+ //-- Insert header
+
+ for(const headerRow of table.rows){
+ if(headerRow.header === true){
+ table.rows.splice(rowIndex, 0, headerRow, headerRow);
+ continue rowLoop;
+ }
+ }
+
+ }
+
+
+ //-- Add rectangle
+
+ this.rect(columnX, rowY, columnWidth, rowHeight)
+ .fillColor(fillColor)
+ .fillOpacity(fillOpacity)
+ .strokeOpacity(strokeOpacity)
+ .strokeColor(strokeColor)
+ .fillAndStroke();
+
+
+ this.fillColor("black")
+ .fillOpacity(1);
+
+ this.text(column.text + "", columnX + paddings.left, rowY + paddings.top, textOptions);
+
+ columnX = columnX + columnWidth;
+
+ }
+
+ rowY = rowY + rowHeight;
+
+ }
+
+ return this;
+
+ }
+
+
+ public addPath(path: string, x: number, y: number): PDFKit.PDFDocument {
+
+ path = svgpath(path)
+ .translate(x, y)
+ .toString();
+
+ this.path(path);
+
+ return this;
+
+ }
+
+}
diff --git a/src/pdf/pdf.ts b/src/pdf/pdf.ts
new file mode 100644
index 0000000..bb65544
--- /dev/null
+++ b/src/pdf/pdf.ts
@@ -0,0 +1,581 @@
+import { ExtendedPDF } from "./extended-pdf.js";
+import { Size, Data, Languages, PDFOptions, Debtor, Creditor } from "../shared/types";
+import { validateData, cleanData } from "../shared/shared.js";
+import * as utils from "../shared/utils.js";
+import translations from "../shared/translations.js";
+import generateQRCode from "../shared/qr-code.js";
+
+
+export class PDF_ extends ExtendedPDF {
+
+ public size: Size = "A6/5";
+ private _data: Data;
+ private _scissors: boolean = true;
+ private _separate: boolean = false;
+ private _outlines: boolean = true;
+ private _language: Languages = "DE";
+ private _marginTop: number = 0;
+ private _autoGenerate: boolean = true;
+
+
+ constructor(data: Data, options?: PDFOptions) {
+
+ super({ autoFirstPage: false, bufferPages: true });
+
+ this._data = data;
+
+
+ //-- Clean data (remove line breaks and unnecessary whitespaces)
+
+ this._data = cleanData(this._data);
+
+
+ //-- Validate data
+
+ validateData(this._data);
+
+
+ //-- Apply options
+
+ if(options !== undefined){
+ if(options.language !== undefined){
+ this._language = options.language;
+ }
+ if(options.size !== undefined){
+ this.size = options.size;
+ }
+ if(options.scissors !== undefined){
+ this._scissors = options.scissors;
+ this._separate = !options.scissors;
+ }
+ if(options.separate !== undefined){
+ this._separate = options.separate;
+ this._scissors = !options.separate;
+ }
+ if(options.scissors === false && options.separate === false){
+ this._separate = false;
+ this._scissors = false;
+ }
+ if(options.outlines !== undefined){
+ this._outlines = options.outlines;
+ }
+ if(options.autoGenerate !== undefined){
+ this._autoGenerate = options.autoGenerate;
+ }
+ }
+
+ this.info.Producer = this.info.Creator = this.info.Author = "SwissQRBill";
+
+ this.addPage();
+
+ if(this._autoGenerate === true){
+ this.addQRBill();
+ this.end();
+ }
+
+ }
+
+
+ public addPage(options?: PDFKit.PDFDocumentOptions): PDFKit.PDFDocument {
+
+ if(options === undefined){
+ options = {
+ margin: utils.mm2pt(5),
+ layout: this.size === "A4" ? "portrait" : "landscape",
+ size: this.size === "A4" ? this.size : [utils.mm2pt(105), utils.mm2pt(210)]
+ };
+ }
+
+ return super.addPage(options);
+
+ }
+
+
+ public end(): void {
+ this.emit("beforeEnd", this);
+ return super.end();
+ }
+
+
+ public addQRBill(size: Size = "A6/5"): void {
+
+ if(this.page.height - this.y < utils.mm2pt(105) && this.y !== this.page.margins.top){
+ this.addPage({
+ margin: 0,
+ layout: size === "A4" ? "portrait" : "landscape",
+ size: size === "A4" ? size : [utils.mm2pt(105), utils.mm2pt(210)]
+ });
+ }
+
+ this._marginTop = this.page.height - utils.mm2pt(105);
+
+ this._render();
+
+ }
+
+
+ private _render(): void {
+
+
+ //-- Lines
+
+ if(this._outlines === true){
+
+
+ //-- Horizontal line
+
+ if(this.page.height > utils.mm2pt(105)){
+
+ this.moveTo(0, this._marginTop)
+ .lineTo(utils.mm2pt(210), this._marginTop)
+ .lineWidth(.75)
+ .strokeOpacity(1)
+ .dash(1, { size: 1 })
+ .strokeColor("black")
+ .stroke();
+
+ }
+
+
+ //-- Vertical line
+
+ this.moveTo(utils.mm2pt(62), this._marginTop)
+ .lineTo(utils.mm2pt(62), this._marginTop + utils.mm2pt(105))
+ .lineWidth(.75)
+ .strokeOpacity(1)
+ .dash(1, { size: 1 })
+ .strokeColor("black")
+ .stroke();
+
+ }
+
+
+ //-- Scissors
+
+ if(this._scissors === true){
+
+ const scissorsTop = "M4.545 -1.803C4.06 -2.388 3.185 -2.368 2.531 -2.116l-4.106 1.539c-1.194 -0.653 -2.374 -0.466 -2.374 -0.784c0 -0.249 0.228 -0.194 0.194 -0.842c-0.033 -0.622 -0.682 -1.082 -1.295 -1.041c-0.614 -0.004 -1.25 0.467 -1.255 1.115c-0.046 0.653 0.504 1.26 1.153 1.303c0.761 0.113 2.109 -0.348 2.741 0.785c-0.471 0.869 -1.307 0.872 -2.063 0.828c-0.627 -0.036 -1.381 0.144 -1.68 0.76c-0.289 0.591 -0.006 1.432 0.658 1.613c0.67 0.246 1.59 -0.065 1.75 -0.835c0.123 -0.594 -0.298 -0.873 -0.136 -1.089c0.122 -0.163 0.895 -0.068 2.274 -0.687L2.838 2.117C3.4 2.273 4.087 2.268 4.584 1.716L-0.026 -0.027L4.545 -1.803zm-9.154 -0.95c0.647 0.361 0.594 1.342 -0.078 1.532c-0.608 0.212 -1.386 -0.379 -1.192 -1.039c0.114 -0.541 0.827 -0.74 1.27 -0.493zm0.028 4.009c0.675 0.249 0.561 1.392 -0.126 1.546c-0.456 0.158 -1.107 -0.069 -1.153 -0.606c-0.089 -0.653 0.678 -1.242 1.279 -0.94z";
+ const scissorsCenter = "M1.803 4.545C2.388 4.06 2.368 3.185 2.116 2.531l-1.539 -4.106c0.653 -1.194 0.466 -2.374 0.784 -2.374c0.249 0 0.194 0.228 0.842 0.194c0.622 -0.033 1.082 -0.682 1.041 -1.295c0.004 -0.614 -0.467 -1.25 -1.115 -1.255c-0.653 -0.046 -1.26 0.504 -1.303 1.153c-0.113 0.761 0.348 2.109 -0.785 2.741c-0.869 -0.471 -0.872 -1.307 -0.828 -2.063c0.036 -0.627 -0.144 -1.381 -0.76 -1.68c-0.591 -0.289 -1.432 -0.006 -1.613 0.658c-0.246 0.67 0.065 1.59 0.835 1.75c0.594 0.123 0.873 -0.298 1.089 -0.136c0.163 0.122 0.068 0.895 0.687 2.274L-2.117 2.838C-2.273 3.4 -2.268 4.087 -1.716 4.584L0.027 -0.026L1.803 4.545zm0.95 -9.154c-0.361 0.647 -1.342 0.594 -1.532 -0.078c-0.212 -0.608 0.379 -1.386 1.039 -1.192c0.541 0.114 0.74 0.827 0.493 1.27zm-4.009 0.028c-0.249 0.675 -1.392 0.561 -1.546 -0.126c-0.158 -0.456 0.069 -1.107 0.606 -1.153c0.653 -0.089 1.242 0.678 0.94 1.279z";
+
+ if(this.page.height > utils.mm2pt(105)){
+
+ this.addPath(scissorsTop, utils.mm2pt(105), this._marginTop)
+ .fillColor("black")
+ .fill();
+
+ }
+
+ this.addPath(scissorsCenter, utils.mm2pt(62), this._marginTop + 30)
+ .fillColor("black")
+ .fill();
+ this.translate(0, 0);
+
+ }
+
+
+ //-- Separation text
+
+ if(this._separate === true){
+
+ if(this.page.height > utils.mm2pt(105)){
+
+ this.fontSize(11);
+ this.font("Helvetica");
+ this.text(translations[this._language].separate, utils.mm2pt(0), this._marginTop - 12, {
+ width: utils.mm2pt(210),
+ align: "center"
+ });
+
+ }
+
+ }
+
+
+ //-- Receipt
+
+ this.fontSize(11);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].receipt, utils.mm2pt(5), this._marginTop + utils.mm2pt(5), {
+ width: utils.mm2pt(52),
+ align: "left"
+ });
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].account, utils.mm2pt(5), this._marginTop + utils.mm2pt(12), {
+ width: utils.mm2pt(52)
+ });
+
+
+ //-- Creditor
+
+ this.fontSize(8);
+ this.font("Helvetica");
+ this.text(`${utils.formatIBAN(this._data.creditor.account)}\n${this._formatAddress(this._data.creditor)}`, {
+ width: utils.mm2pt(52)
+ });
+
+ this.moveDown();
+
+
+ //-- Reference
+
+ if(this._data.reference !== undefined){
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].reference, {
+ width: utils.mm2pt(52)
+ });
+
+ this.fontSize(8);
+ this.font("Helvetica");
+ this.text(this._formatReference(this._data.reference), {
+ width: utils.mm2pt(52)
+ });
+
+ }
+
+
+ //-- Debtor
+
+ if(this._data.debtor !== undefined){
+
+ this.fontSize(9);
+ this.moveDown();
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].payableBy, {
+ width: utils.mm2pt(52)
+ });
+
+ this.fontSize(8);
+ this.font("Helvetica");
+ this.text(this._formatAddress(this._data.debtor), {
+ width: utils.mm2pt(52)
+ });
+
+ } else {
+
+ this.fontSize(9);
+ this.moveDown();
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].payableByName, {
+ width: utils.mm2pt(52)
+ });
+
+
+ //-- Add rectangle
+
+ this._addRectangle(5, utils.pt2mm(this.y), 52, 20);
+
+ }
+
+
+ //-- Amount
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].currency, utils.mm2pt(5), this._marginTop + utils.mm2pt(68), {
+ width: utils.mm2pt(15)
+ });
+
+ this.text(translations[this._language].amount, utils.mm2pt(18), this._marginTop + utils.mm2pt(68), {
+ width: utils.mm2pt(37)
+ });
+
+ this.fontSize(8);
+ this.font("Helvetica");
+ this.text(this._data.currency, utils.mm2pt(5), this._marginTop + utils.mm2pt(71), {
+ width: utils.mm2pt(15)
+ });
+
+ if(this._data.amount !== undefined){
+ this.text(utils.formatAmount(this._data.amount), utils.mm2pt(18), this._marginTop + utils.mm2pt(71), {
+ width: utils.mm2pt(37)
+ });
+ } else {
+ this._addRectangle(27, 68, 30, 10);
+ }
+
+ this.fontSize(6);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].acceptancePoint, utils.mm2pt(5), this._marginTop + utils.mm2pt(82), {
+ width: utils.mm2pt(52),
+ align: "right"
+ });
+
+
+ //-- Payment part middle container
+
+ this.fontSize(11);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].paymentPart, utils.mm2pt(67), this._marginTop + utils.mm2pt(5), {
+ width: utils.mm2pt(51),
+ align: "left"
+ });
+
+
+ //-- QR Code
+
+ this._renderQRCode();
+ this.fillColor("black");
+
+
+ //-- Amount
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].currency, utils.mm2pt(67), this._marginTop + utils.mm2pt(68), {
+ width: utils.mm2pt(15)
+ });
+
+ this.text(translations[this._language].amount, utils.mm2pt(87), this._marginTop + utils.mm2pt(68), {
+ width: utils.mm2pt(36)
+ });
+
+ this.fontSize(10);
+ this.font("Helvetica");
+ this.text(this._data.currency, utils.mm2pt(67), this._marginTop + utils.mm2pt(72), {
+ width: utils.mm2pt(15)
+ });
+
+ if(this._data.amount !== undefined){
+ this.text(utils.formatAmount(this._data.amount), utils.mm2pt(87), this._marginTop + utils.mm2pt(72), {
+ width: utils.mm2pt(36)
+ });
+ } else {
+ this._addRectangle(78, 72, 40, 15);
+ }
+
+
+ //-- AV1 and AV2
+
+ if(this._data.av1 !== undefined){
+ this.fontSize(7);
+ this.font("Helvetica-Bold");
+ this.text("Name AV1:", utils.mm2pt(67), this._marginTop + utils.mm2pt(90), {
+ width: utils.mm2pt(15)
+ });
+
+ this.fontSize(7);
+ this.font("Helvetica");
+ this.text((this._data.av1.length > 87 ? this._data.av1.substr(0, 87) + "..." : this._data.av1), utils.mm2pt(81), this._marginTop + utils.mm2pt(90), {
+ width: utils.mm2pt(37)
+ });
+ }
+
+ if(this._data.av2 !== undefined){
+ this.fontSize(7);
+ this.font("Helvetica-Bold");
+ this.text("Name AV2:", utils.mm2pt(67), this._marginTop + utils.mm2pt(93), {
+ width: utils.mm2pt(15)
+ });
+
+ this.fontSize(7);
+ this.font("Helvetica");
+ this.text((this._data.av2.length > 87 ? this._data.av2.substr(0, 87) + "..." : this._data.av2), utils.mm2pt(81), this._marginTop + utils.mm2pt(93), {
+ width: utils.mm2pt(37)
+ });
+ }
+
+
+ //-- Payment part right column
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].account, utils.mm2pt(118), this._marginTop + utils.mm2pt(5), {
+ width: utils.mm2pt(87)
+ });
+
+ this.fontSize(10);
+ this.font("Helvetica");
+ this.text(`${utils.formatIBAN(this._data.creditor.account)}\n${this._formatAddress(this._data.creditor)}`, utils.mm2pt(118), this._marginTop + utils.mm2pt(8), {
+ width: utils.mm2pt(87)
+ });
+
+ this.moveDown();
+
+ if(this._data.reference !== undefined){
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].reference, {
+ width: utils.mm2pt(87)
+ });
+
+ this.fontSize(10);
+ this.font("Helvetica");
+ this.text(this._formatReference(this._data.reference), {
+ width: utils.mm2pt(87)
+ });
+
+ this.moveDown();
+
+ }
+
+
+ //-- Message / Additional information
+
+ if(this._data.message !== undefined || this._data.additionalInformation !== undefined){
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].additionalInformation, {
+ width: utils.mm2pt(87)
+ });
+
+ this.fontSize(10);
+ this.font("Helvetica");
+
+ const options = {
+ width: utils.mm2pt(87)
+ };
+
+ const singleLineHeight = this.heightOfString("A", options);
+ const referenceType = utils.getReferenceType(this._data.reference);
+ const maxLines = referenceType === "QRR" || referenceType === "SCOR" ? 3 : 4;
+ const linesOfAdditionalInformation = this._data.additionalInformation !== undefined ? this.heightOfString(this._data.additionalInformation, options) / singleLineHeight : 0;
+
+ if(this._data.additionalInformation !== undefined){
+
+ if(referenceType === "QRR" || referenceType === "SCOR"){
+
+ // QRR and SCOR have 1 line for the message and 2 lines for the additional information
+
+ if(this._data.message !== undefined){
+ this.text(this._data.message, { ...options, lineBreak: false, ellipsis: true, height: singleLineHeight });
+ }
+
+ } else {
+
+ // Non QRR and SCOR have 4 lines total available and the message should be shortened if necessary
+
+ if(this._data.message !== undefined){
+ const maxLinesOfMessage = maxLines - linesOfAdditionalInformation;
+ this.text(this._data.message, { ...options, height: singleLineHeight * maxLinesOfMessage, lineBreak: true, ellipsis: true });
+ }
+
+ }
+
+ this.text(this._data.additionalInformation, options);
+
+ } else if(this._data.message !== undefined){
+ this.text(this._data.message, { ...options, height: singleLineHeight * maxLines, lineBreak: true, ellipsis: true });
+ }
+
+ this.moveDown();
+
+ }
+
+ if(this._data.debtor !== undefined){
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].payableBy, {
+ width: utils.mm2pt(87)
+ });
+
+ this.fontSize(10);
+ this.font("Helvetica");
+ this.text(this._formatAddress(this._data.debtor), {
+ width: utils.mm2pt(87)
+ });
+
+ } else {
+
+ this.fontSize(8);
+ this.font("Helvetica-Bold");
+ this.text(translations[this._language].payableByName, {
+ width: utils.mm2pt(87)
+ });
+
+ this._addRectangle(118, utils.pt2mm(this.y), 65, 25);
+
+ }
+
+ }
+
+
+ private _renderQRCode(): void {
+
+ const qrcode = generateQRCode(this._data, utils.mm2pt(46));
+
+
+ //-- Add QR Code
+
+ this.addPath(qrcode, utils.mm2pt(67), this._marginTop + utils.mm2pt(17))
+ .undash()
+ .fillColor("black")
+ .fill();
+
+
+ //-- Add Swiss Cross
+
+ const swissCrossBackground = "M18.3 0.7L1.6 0.7 0.7 0.7 0.7 1.6 0.7 18.3 0.7 19.1 1.6 19.1 18.3 19.1 19.1 19.1 19.1 18.3 19.1 1.6 19.1 0.7Z";
+ const swissCross = "M8.3 4H11.6V15H8.3V4Z M4.4 7.9H15.4V11.2H4.4V7.9Z";
+
+ this.addPath(swissCrossBackground, utils.mm2pt(86), this._marginTop + utils.mm2pt(36))
+ .fillColor("black")
+ .lineWidth(1.42)
+ .strokeColor("white")
+ .fillAndStroke();
+
+ this.addPath(swissCross, utils.mm2pt(86), this._marginTop + utils.mm2pt(36))
+ .fillColor("white")
+ .fill();
+
+ }
+
+
+ private _formatAddress(data: Debtor | Creditor): string {
+ if(data.buildingNumber !== undefined){
+ return `${data.name}\n${data.address} ${data.buildingNumber}\n${data.zip} ${data.city}`;
+ } else {
+ return `${data.name}\n${data.address}\n${data.zip} ${data.city}`;
+ }
+ }
+
+
+ private _formatReference(reference: string): string {
+
+ const referenceType = utils.getReferenceType(reference);
+
+ if(referenceType === "QRR"){
+ return utils.formatQRReference(reference);
+ } else if(referenceType === "SCOR"){
+ return utils.formatSCORReference(reference);
+ }
+
+ return reference;
+
+ }
+
+
+ private _addRectangle(x: number, y: number, width: number, height: number): void {
+
+ const length = 3;
+
+ this.moveTo(utils.mm2pt(x + length), this._marginTop + utils.mm2pt(y))
+ .lineTo(utils.mm2pt(x), this._marginTop + utils.mm2pt(y))
+ .lineTo(utils.mm2pt(x), this._marginTop + utils.mm2pt(y + length))
+ .moveTo(utils.mm2pt(x), this._marginTop + utils.mm2pt(y + height - length))
+ .lineTo(utils.mm2pt(x), this._marginTop + utils.mm2pt(y + height))
+ .lineTo(utils.mm2pt(x + length), this._marginTop + utils.mm2pt(y + height))
+ .moveTo(utils.mm2pt(x + width - length), this._marginTop + utils.mm2pt(y + height))
+ .lineTo(utils.mm2pt(x + width), this._marginTop + utils.mm2pt(y + height))
+ .lineTo(utils.mm2pt(x + width), this._marginTop + utils.mm2pt(y + height - length))
+ .moveTo(utils.mm2pt(x + width), this._marginTop + utils.mm2pt(y + length))
+ .lineTo(utils.mm2pt(x + width), this._marginTop + utils.mm2pt(y))
+ .lineTo(utils.mm2pt(x + width - length), this._marginTop + utils.mm2pt(y))
+ .lineWidth(.75)
+ .undash()
+ .strokeColor("black")
+ .stroke();
+
+ }
+
+}
diff --git a/src/shared/qr-code.ts b/src/shared/qr-code.ts
new file mode 100644
index 0000000..17a8369
--- /dev/null
+++ b/src/shared/qr-code.ts
@@ -0,0 +1,253 @@
+import { getReferenceType } from "../shared/utils.js";
+import { Data } from "./types";
+
+import QRCode from "@schoero/qrcode";
+
+
+export default function generateQRCode(data: Data, size: number): string {
+
+ let qrString = "";
+
+
+ //-- Swiss Payments Code
+
+ qrString += "SPC";
+
+
+ //-- Version
+
+ qrString += "\n0200";
+
+
+ //-- Coding Type UTF-8
+
+ qrString += "\n1";
+
+
+ //-- IBAN
+
+ qrString += "\n" + data.creditor.account ?? "\n";
+
+
+ //-- Creditor
+
+ if(data.creditor.buildingNumber !== undefined){
+
+ // Address Type
+ qrString += "\nS";
+
+ // Name
+ qrString += "\n" + data.creditor.name;
+
+ // Address
+ qrString += "\n" + data.creditor.address;
+
+ // House number
+ qrString += "\n" + data.creditor.buildingNumber;
+
+ // Zip
+ qrString += "\n" + data.creditor.zip;
+
+ // City
+ qrString += "\n" + data.creditor.city;
+
+ } else {
+
+ // Address Type
+ qrString += "\nK";
+
+ // Name
+ qrString += "\n" + data.creditor.name;
+
+ // Address
+ qrString += "\n" + data.creditor.address;
+
+ // Zip + city
+ if((data.creditor.zip + " " + data.creditor.city).length > 70){ throw new Error("Creditor zip plus city must be a maximum of 70 characters."); }
+ qrString += "\n" + data.creditor.zip + " " + data.creditor.city;
+
+ // Empty zip field
+ qrString += "\n";
+
+ // Empty city field
+ qrString += "\n";
+
+ }
+
+ qrString += "\n" + data.creditor.country;
+
+
+ //-- 7 x empty
+
+ qrString += "\n"; // 1
+ qrString += "\n"; // 2
+ qrString += "\n"; // 3
+ qrString += "\n"; // 4
+ qrString += "\n"; // 5
+ qrString += "\n"; // 6
+ qrString += "\n"; // 7
+
+
+ //-- Amount
+
+ if(data.amount !== undefined){
+ qrString += "\n" + data.amount.toFixed(2);
+ } else {
+ qrString += "\n";
+ }
+
+
+ //-- Currency
+
+ qrString += "\n" + data.currency;
+
+
+ //-- Debtor
+
+ if(data.debtor !== undefined){
+ if(data.debtor.buildingNumber !== undefined){
+
+ // Address type
+ qrString += "\nS";
+
+ // Name
+ qrString += "\n" + data.debtor.name;
+
+ // Address
+ qrString += "\n" + data.debtor.address;
+
+ // House number
+ qrString += "\n" + data.debtor.buildingNumber;
+
+ // Zip
+ qrString += "\n" + data.debtor.zip;
+
+ // City
+ qrString += "\n" + data.debtor.city;
+
+ } else {
+
+ // Address type
+ qrString += "\nK";
+
+ // Name
+ qrString += "\n" + data.debtor.name;
+
+ // Address
+ qrString += "\n" + data.debtor.address;
+
+ // Zip + city
+ if((data.debtor.zip + " " + data.debtor.city).length > 70){ throw new Error("Debtor zip plus city must be a maximum of 70 characters."); }
+ qrString += "\n" + data.debtor.zip + " " + data.debtor.city;
+
+ // Empty field zip
+ qrString += "\n";
+
+ // Empty field city
+ qrString += "\n";
+
+ }
+
+ // Country
+ qrString += "\n" + data.debtor.country;
+
+ } else {
+
+
+ // Empty field type
+ qrString += "\n";
+
+ // Empty field name
+ qrString += "\n";
+
+ // Empty field address
+ qrString += "\n";
+
+ // Empty field house number
+ qrString += "\n";
+
+ // Empty field zip
+ qrString += "\n";
+
+ // Empty field city
+ qrString += "\n";
+
+ // Empty field country
+ qrString += "\n";
+
+ }
+
+
+ //-- Reference type
+
+ qrString += "\n" + getReferenceType(data.reference);
+
+
+ //-- Reference
+
+ if(data.reference !== undefined){
+ qrString += "\n" + data.reference;
+ } else {
+ qrString += "\n";
+ }
+
+
+ //-- Unstructured message
+
+ if(data.message !== undefined){
+ qrString += "\n" + data.message;
+ } else {
+ qrString += "\n";
+ }
+
+
+ //-- End Payment Data
+
+ qrString += "\n" + "EPD";
+
+
+ //-- Additional information
+
+ if(data.additionalInformation !== undefined){
+ qrString += "\n" + data.additionalInformation;
+ } else {
+ qrString += "\n";
+ }
+
+
+ //-- AV1
+
+ if(data.av1 !== undefined){
+ qrString += "\n" + data.av1;
+ }
+
+ if(data.av2 !== undefined){
+ qrString += "\n" + data.av2;
+ }
+
+
+ //-- Create QR Code
+
+ const qrcodeString = QRCode.toString(qrString, {
+ type: "svg",
+ margin: 0,
+ width: size,
+ errorCorrectionLevel: "M"
+ }, () => { }) as unknown as string;
+
+ return getSVGPathFromQRCodeString(qrcodeString)!;
+
+}
+
+function getSVGPathFromQRCodeString(qrcodeString: string): string | undefined {
+
+ const regex = //m;
+ const match = regex.exec(qrcodeString);
+
+ if(match !== null){
+ return match[1];
+ }
+
+ return;
+
+}
diff --git a/src/shared/shared.ts b/src/shared/shared.ts
new file mode 100644
index 0000000..68b8cc0
--- /dev/null
+++ b/src/shared/shared.ts
@@ -0,0 +1,258 @@
+import { isQRIBAN, isQRReference, isIBANValid, isQRReferenceValid } from "./utils.js";
+import { Data } from "./types";
+
+
+export function cleanData(data: Data): Data {
+
+ const _cleanObject = (object: object): void => {
+
+ const keys = Object.keys(object);
+
+ for(let k = 0; k < keys.length; k++){
+ if(typeof object[keys[k]] === "string"){
+
+ object[keys[k]] = removeLinebreaks(object[keys[k]]);
+
+ if(keys[k] === "account"){
+ object[keys[k]] = object[keys[k]].replace(/ /g, "");
+ }
+ if(keys[k] === "reference"){
+ object[keys[k]] = object[keys[k]].replace(/ /g, "");
+ }
+
+ } else {
+ if(typeof object[keys[k]] === "object"){
+ _cleanObject(object[keys[k]]);
+ }
+ }
+ }
+ };
+
+ _cleanObject(data);
+
+ return data;
+
+}
+
+
+export function removeLinebreaks(text: string): string {
+ return text.replace(/\n/g, "").replace(/\r/g, "");
+}
+
+
+export function validateData(data: Data) {
+
+
+ //-- Creditor
+
+ if(data.creditor === undefined){ throw new Error("Creditor cannot be undefined."); }
+
+
+ //-- Creditor account
+
+ if(data.creditor.account === undefined){
+ throw new Error("You must provide an IBAN or QR-IBAN number.");
+ }
+
+ if(data.creditor.account.length !== 21){
+ throw new Error(`The provided IBAN number '${data.creditor.account}' is either too long or too short.`);
+ }
+
+ if(isIBANValid(data.creditor.account) === false){
+ throw new Error(`The provided IBAN number '${data.creditor.account}' is not valid.`);
+ }
+
+ if(data.creditor.account.substr(0, 2) !== "CH" && data.creditor.account.substr(0, 2) !== "LI"){
+ throw new Error("Only CH and LI IBAN numbers are allowed.");
+ }
+
+
+ //-- Validate reference
+
+ if(isQRIBAN(data.creditor.account)){
+
+ if(data.reference === undefined){
+ throw new Error("If there is no reference, a conventional IBAN must be used.");
+ }
+
+ if(isQRReference(data.reference)){
+ if(!isQRReferenceValid(data.reference)){
+ throw new Error("QR-Reference checksum is not valid.");
+ }
+ } else {
+ throw new Error("QR-IBAN requires the use of a QR-Reference (and vice versa).");
+ }
+
+ } else {
+
+ if(data.reference !== undefined){
+ if(isQRReference(data.reference)){
+ throw new Error("QR-Reference requires the use of a QR-IBAN (and vice versa).");
+ }
+ }
+
+ }
+
+
+ //-- Creditor name
+
+ if(data.creditor.name === undefined){ throw new Error("Creditor name cannot be undefined."); }
+ if(typeof data.creditor.name !== "string"){ throw new Error("Creditor name must be a string."); }
+ if(data.creditor.name.length > 70){ throw new Error("Creditor name must be a maximum of 70 characters."); }
+
+
+ //-- Creditor Address
+
+ if(data.creditor.address === undefined){ throw new Error("Creditor address cannot be undefined."); }
+ if(typeof data.creditor.address !== "string"){ throw new Error("Creditor address must be a string."); }
+ if(data.creditor.address.length > 70){ throw new Error("Creditor address must be a maximum of 70 characters."); }
+
+
+ //-- Creditor buildingNumber
+
+ if(data.creditor.buildingNumber !== undefined){
+ if(typeof data.creditor.buildingNumber !== "string" && typeof data.creditor.buildingNumber !== "number"){ throw new Error("Debtor buildingNumber must be either a string or a number."); }
+ if(data.creditor.buildingNumber.toString().length > 16){ throw new Error("Creditor buildingNumber can be a maximum of 16 characters."); }
+ }
+
+
+ //-- Creditor Zip
+
+ if(data.creditor.zip === undefined){ throw new Error("Creditor zip cannot be undefined."); }
+ if(typeof data.creditor.zip !== "string" && typeof data.creditor.zip !== "number"){ throw new Error("Creditor zip must be either a string or a number."); }
+ if(data.creditor.zip.toString().length > 16){ throw new Error("Creditor zip must be a maximum of 16 characters."); }
+
+
+ //-- Creditor city
+
+ if(data.creditor.city === undefined){ throw new Error("Creditor city cannot be undefined."); }
+ if(typeof data.creditor.city !== "string"){ throw new Error("Creditor city must be a string."); }
+ if(data.creditor.city.length > 35){ throw new Error("Creditor city must be a maximum of 35 characters."); }
+
+
+ //-- Creditor country
+
+ if(data.creditor.country === undefined){ throw new Error("Creditor country cannot be undefined."); }
+ if(typeof data.creditor.country !== "string"){ throw new Error("Creditor country must be a string."); }
+ if(data.creditor.country.length !== 2){ throw new Error("Creditor country must be 2 characters."); }
+
+
+ //-- Amount
+
+ if(data.amount !== undefined){
+ if(typeof data.amount !== "number"){ throw new Error("Amount must be a number."); }
+ if(data.amount.toFixed(2).toString().length > 12){ throw new Error("Amount must be a maximum of 12 digits."); }
+ }
+
+
+ //-- Currency
+
+ if(data.currency === undefined){ throw new Error("Currency cannot be undefined."); }
+ if(typeof data.currency !== "string"){ throw new Error("Currency must be a string."); }
+ if(data.currency.length !== 3){ throw new Error("Currency must be a length of 3 characters."); }
+ if(data.currency !== "CHF" && data.currency !== "EUR"){ throw new Error("Currency must be either 'CHF' or 'EUR'"); }
+
+
+ //-- Debtor
+
+ if(data.debtor !== undefined){
+
+
+ //-- Debtor name
+
+ if(data.debtor.name === undefined){ throw new Error("Debtor name cannot be undefined if the debtor object is available."); }
+ if(typeof data.debtor.name !== "string"){ throw new Error("Debtor name must be a string."); }
+ if(data.debtor.name.length > 70){ throw new Error("Debtor name must be a maximum of 70 characters."); }
+
+
+ //-- Debtor address
+
+ if(data.debtor.address === undefined){ throw new Error("Debtor address cannot be undefined if the debtor object is available."); }
+ if(typeof data.debtor.address !== "string"){ throw new Error("Debtor address must be a string."); }
+ if(data.debtor.address.length > 70){ throw new Error("Debtor address must be a maximum of 70 characters."); }
+
+
+ //-- Debtor buildingNumber
+
+ if(data.debtor.buildingNumber !== undefined){
+ if(typeof data.debtor.buildingNumber !== "string" && typeof data.debtor.buildingNumber !== "number"){ throw new Error("Debtor house number must be either a string or a number."); }
+ if(data.debtor.buildingNumber.toString().length > 16){ throw new Error("Debtor house number can be a maximum of 16 characters."); }
+ }
+
+
+ //-- Debtor zip
+
+ if(data.debtor.zip === undefined){ throw new Error("Debtor zip cannot be undefined if the debtor object is available."); }
+ if(typeof data.debtor.zip !== "string" && typeof data.debtor.zip !== "number"){ throw new Error("Debtor zip must be either a string or a number."); }
+ if(data.debtor.zip.toString().length > 16){ throw new Error("Debtor zip must be a maximum of 16 characters."); }
+
+
+ //-- Debtor city
+
+ if(data.debtor.city === undefined){ throw new Error("Debtor city cannot be undefined if the debtor object is available."); }
+ if(typeof data.debtor.city !== "string"){ throw new Error("Debtor city must be a string."); }
+ if(data.debtor.city.length > 35){ throw new Error("Debtor city must be a maximum of 35 characters."); }
+
+
+ //-- Debtor country
+
+ if(data.debtor.country === undefined){ throw new Error("Debtor country cannot be undefined if the debtor object is available."); }
+ if(typeof data.debtor.country !== "string"){ throw new Error("Debtor country must be a string."); }
+ if((data.debtor.country).length !== 2){ throw new Error("Debtor country must be 2 characters."); }
+
+ }
+
+
+ //-- Reference
+
+ if(data.reference !== undefined){
+ if(typeof data.reference !== "string"){ throw new Error("Reference name must be a string."); }
+ if(data.reference.length > 27){ throw new Error("Reference name must be a maximum of 27 characters."); }
+ }
+
+
+ //-- Message
+
+ if(data.message !== undefined){
+ if(data.message.length > 140){ throw new Error("Message must be a maximum of 140 characters."); }
+ if(typeof data.message !== "string"){ throw new Error("Message must be a string."); }
+ }
+
+
+ //-- Additional information
+
+ if(data.additionalInformation !== undefined){
+ if(data.additionalInformation.length > 140){ throw new Error("AdditionalInformation must be a maximum of 140 characters."); }
+ if(typeof data.additionalInformation !== "string"){ throw new Error("AdditionalInformation must be a string."); }
+ }
+
+
+ //-- Message + Additional information
+
+ if(data.message !== undefined && data.additionalInformation !== undefined){
+ if(data.additionalInformation.length + data.message.length > 140){ throw new Error("Message and additionalInformation combined must be a maximum of 140 characters."); }
+ }
+
+
+ //-- AV1
+
+ if(data.av1 !== undefined){
+ if(data.av1.length > 100){ throw new Error("AV1 must be a maximum of 100 characters."); }
+ if(typeof data.av1 !== "string"){ throw new Error("AV1 must be a string."); }
+ if(data.av1.substr(0, 5) !== "eBill"){
+ throw new Error("AV1 must begin with eBill");
+ }
+ }
+
+
+ //-- AV2
+
+ if(data.av2 !== undefined){
+ if(data.av2.length > 100){ throw new Error("AV2 must be a maximum of 100 characters."); }
+ if(typeof data.av2 !== "string"){ throw new Error("AV2 must be a string."); }
+ if(data.av2.substr(0, 5) !== "eBill"){
+ throw new Error("AV2 must begin with eBill");
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/shared/translations.ts b/src/shared/translations.ts
new file mode 100644
index 0000000..774f0db
--- /dev/null
+++ b/src/shared/translations.ts
@@ -0,0 +1,60 @@
+const translations = {
+ DE: {
+ paymentPart: "Zahlteil",
+ account: "Konto / Zahlbar an",
+ reference: "Referenz",
+ additionalInformation: "Zusätzliche Informationen",
+ currency: "Währung",
+ amount: "Betrag",
+ receipt: "Empfangsschein",
+ acceptancePoint: "Annahmestelle",
+ separate: "Vor der Einzahlung abzutrennen",
+ payableBy: "Zahlbar durch",
+ payableByName: "Zahlbar durch (Name/Adresse)",
+ inFavourOf: "Zugunsten"
+ },
+ EN: {
+ paymentPart: "Payment part",
+ account: "Account / Payable to",
+ reference: "Reference",
+ additionalInformation: "Additional information",
+ currency: "Currency",
+ amount: "Amount",
+ receipt: "Receipt",
+ acceptancePoint: "Acceptance point",
+ separate: "Separate before paying in",
+ payableBy: "Payable by",
+ payableByName: "Payable by (name/address)",
+ inFavourOf: "In favour of"
+ },
+ IT: {
+ paymentPart: "Sezione pagamento",
+ account: "Conto / Pagabile a",
+ reference: "Riferimento",
+ additionalInformation: "Informazioni supplementari",
+ currency: "Valuta",
+ amount: "Importo",
+ receipt: "Ricevuta",
+ acceptancePoint: "Punto di accettazione",
+ separate: "Da staccare prima del versamento",
+ payableBy: "Pagabile da",
+ payableByName: "Pagabile da (nome/indirizzo)",
+ inFavourOf: "A favore di"
+ },
+ FR: {
+ paymentPart: "Section paiement",
+ account: "Compte / Payable à ",
+ reference: "Référence",
+ additionalInformation: "Informations supplémentaires",
+ currency: "Monnaie",
+ amount: "Montant",
+ receipt: "Récépissé",
+ acceptancePoint: "Point de dépôt",
+ separate: "A détacher avant le versement",
+ payableBy: "Payable par",
+ payableByName: "Payable par (nom/adresse)",
+ inFavourOf: "En faveur de"
+ }
+};
+
+export default translations;
\ No newline at end of file
diff --git a/src/shared/types.ts b/src/shared/types.ts
new file mode 100644
index 0000000..c263dc4
--- /dev/null
+++ b/src/shared/types.ts
@@ -0,0 +1,50 @@
+
+
+//-- PDF types
+
+export { PDFTable, PDFRow, PDFColumn } from "../pdf/extended-pdf";
+
+
+//-- SwissQRBill types
+
+export type Currency = "CHF" | "EUR";
+export type Size = "A4" | "A6/5";
+export type Languages = "DE" | "EN" | "IT" | "FR";
+
+export interface Data {
+ currency: Currency,
+ creditor: Creditor,
+ debtor?: Debtor,
+ amount?: number,
+ reference?: string,
+ message?: string,
+ additionalInformation?: string,
+ av1?: string,
+ av2?: string
+}
+
+export interface Debtor {
+ name: string,
+ address: string,
+ zip: string | number,
+ city: string,
+ country: string
+ buildingNumber?: string | number
+}
+
+export interface Creditor extends Debtor {
+ account: string,
+}
+
+export interface PDFOptions {
+ language?: Languages,
+ size?: Size,
+ scissors?: boolean,
+ separate?: boolean,
+ outlines?: boolean
+ autoGenerate?: boolean,
+}
+
+export interface SVGOptions {
+ language?: Languages,
+}
\ No newline at end of file
diff --git a/src/utils.ts b/src/shared/utils.ts
similarity index 85%
rename from src/utils.ts
rename to src/shared/utils.ts
index 6f38cd0..e7161b9 100644
--- a/src/utils.ts
+++ b/src/shared/utils.ts
@@ -88,6 +88,17 @@ export function isQRReferenceValid(reference: string): boolean {
}
+export function getReferenceType(reference: string | undefined): "QRR" | "SCOR" | "NON" {
+ if(typeof reference === "undefined"){
+ return "NON";
+ } else if(isQRReference(reference)){
+ return "QRR";
+ } else {
+ return "SCOR";
+ }
+}
+
+
export function calculateQRReferenceChecksum(reference: string): string {
return mod10(reference);
}
@@ -145,8 +156,20 @@ export function formatAmount(amount: number): string {
}
-export function mmToPoints(mm: number): number {
- return Math.round(mm * 2.83465);
+export function pt2mm(points: number): number {
+ return points / 2.83465;
+}
+
+export function mm2pt(millimeters: number): number {
+ return millimeters * 2.83465;
+}
+
+export function mm2px(millimeters: number): number {
+ return millimeters * 960 / 254;
+}
+
+export function px2mm(pixels: number): number {
+ return pixels * 254 / 960;
}
diff --git a/src/svg/characterWidth.ts b/src/svg/characterWidth.ts
new file mode 100644
index 0000000..fb433c7
--- /dev/null
+++ b/src/svg/characterWidth.ts
@@ -0,0 +1,399 @@
+export const arial8pt = {
+ "32": 3.05615234375,
+ "33": 3.05615234375,
+ "34": 3.90478515625,
+ "35": 6.11767578125,
+ "36": 6.11767578125,
+ "37": 9.78076171875,
+ "38": 7.3369140625,
+ "39": 2.10009765625,
+ "40": 3.6630859375,
+ "41": 3.6630859375,
+ "42": 4.28076171875,
+ "43": 6.423828125,
+ "44": 3.05615234375,
+ "45": 3.6630859375,
+ "46": 3.05615234375,
+ "47": 3.05615234375,
+ "48": 6.11767578125,
+ "49": 6.11767578125,
+ "50": 6.11767578125,
+ "51": 6.11767578125,
+ "52": 6.11767578125,
+ "53": 6.11767578125,
+ "54": 6.11767578125,
+ "55": 6.11767578125,
+ "56": 6.11767578125,
+ "57": 6.11767578125,
+ "58": 3.05615234375,
+ "59": 3.05615234375,
+ "60": 6.423828125,
+ "61": 6.423828125,
+ "62": 6.423828125,
+ "63": 6.11767578125,
+ "64": 11.16650390625,
+ "65": 7.3369140625,
+ "66": 7.3369140625,
+ "67": 7.94384765625,
+ "68": 7.94384765625,
+ "69": 7.3369140625,
+ "70": 6.71923828125,
+ "71": 8.55615234375,
+ "72": 7.94384765625,
+ "73": 3.05615234375,
+ "74": 5.5,
+ "75": 7.3369140625,
+ "76": 6.11767578125,
+ "77": 9.1630859375,
+ "78": 7.94384765625,
+ "79": 8.55615234375,
+ "80": 7.3369140625,
+ "81": 8.55615234375,
+ "82": 7.94384765625,
+ "83": 7.3369140625,
+ "84": 6.71923828125,
+ "85": 7.94384765625,
+ "86": 7.3369140625,
+ "87": 10.38232421875,
+ "88": 7.3369140625,
+ "89": 7.3369140625,
+ "90": 6.71923828125,
+ "91": 3.05615234375,
+ "92": 3.05615234375,
+ "93": 3.05615234375,
+ "94": 5.16162109375,
+ "95": 6.11767578125,
+ "96": 3.6630859375,
+ "97": 6.11767578125,
+ "98": 6.11767578125,
+ "99": 5.5,
+ "100": 6.11767578125,
+ "101": 6.11767578125,
+ "102": 3.05615234375,
+ "103": 6.11767578125,
+ "104": 6.11767578125,
+ "105": 2.44384765625,
+ "106": 2.44384765625,
+ "107": 5.5,
+ "108": 2.44384765625,
+ "109": 9.1630859375,
+ "110": 6.11767578125,
+ "111": 6.11767578125,
+ "112": 6.11767578125,
+ "113": 6.11767578125,
+ "114": 3.6630859375,
+ "115": 5.5,
+ "116": 3.05615234375,
+ "117": 6.11767578125,
+ "118": 5.5,
+ "119": 7.94384765625,
+ "120": 5.5,
+ "121": 5.5,
+ "122": 5.5,
+ "123": 3.673828125,
+ "124": 2.857421875,
+ "125": 3.673828125,
+ "126": 6.423828125,
+ "160": 3.05615234375,
+ "161": 3.6630859375,
+ "162": 6.11767578125,
+ "163": 6.11767578125,
+ "164": 6.11767578125,
+ "165": 6.11767578125,
+ "166": 2.857421875,
+ "167": 6.11767578125,
+ "168": 3.6630859375,
+ "169": 8.10498046875,
+ "170": 4.0712890625,
+ "171": 6.11767578125,
+ "172": 6.423828125,
+ "173": 0,
+ "174": 8.10498046875,
+ "175": 6.07470703125,
+ "176": 4.39892578125,
+ "177": 6.037109375,
+ "178": 3.6630859375,
+ "179": 3.6630859375,
+ "180": 3.6630859375,
+ "181": 6.337890625,
+ "182": 5.908203125,
+ "183": 3.6630859375,
+ "184": 3.6630859375,
+ "185": 3.6630859375,
+ "186": 4.017578125,
+ "187": 6.11767578125,
+ "188": 9.173828125,
+ "189": 9.173828125,
+ "190": 9.173828125,
+ "191": 6.71923828125,
+ "192": 7.3369140625,
+ "193": 7.3369140625,
+ "194": 7.3369140625,
+ "195": 7.3369140625,
+ "196": 7.3369140625,
+ "197": 7.3369140625,
+ "198": 11,
+ "199": 7.94384765625,
+ "200": 7.3369140625,
+ "201": 7.3369140625,
+ "202": 7.3369140625,
+ "203": 7.3369140625,
+ "204": 3.05615234375,
+ "205": 3.05615234375,
+ "206": 3.05615234375,
+ "207": 3.05615234375,
+ "208": 7.94384765625,
+ "209": 7.94384765625,
+ "210": 8.55615234375,
+ "211": 8.55615234375,
+ "212": 8.55615234375,
+ "213": 8.55615234375,
+ "214": 8.55615234375,
+ "215": 6.423828125,
+ "216": 8.55615234375,
+ "217": 7.94384765625,
+ "218": 7.94384765625,
+ "219": 7.94384765625,
+ "220": 7.94384765625,
+ "221": 7.3369140625,
+ "222": 7.3369140625,
+ "223": 6.71923828125,
+ "224": 6.11767578125,
+ "225": 6.11767578125,
+ "226": 6.11767578125,
+ "227": 6.11767578125,
+ "228": 6.11767578125,
+ "229": 6.11767578125,
+ "230": 9.78076171875,
+ "231": 5.5,
+ "232": 6.11767578125,
+ "233": 6.11767578125,
+ "234": 6.11767578125,
+ "235": 6.11767578125,
+ "236": 3.05615234375,
+ "237": 3.05615234375,
+ "238": 3.05615234375,
+ "239": 3.05615234375,
+ "240": 6.11767578125,
+ "241": 6.11767578125,
+ "242": 6.11767578125,
+ "243": 6.11767578125,
+ "244": 6.11767578125,
+ "245": 6.11767578125,
+ "246": 6.11767578125,
+ "247": 6.037109375,
+ "248": 6.71923828125,
+ "249": 6.11767578125,
+ "250": 6.11767578125,
+ "251": 6.11767578125,
+ "252": 6.11767578125,
+ "253": 5.5,
+ "254": 6.11767578125
+};
+
+export const arial10pt = {
+ "32": 3.61181640625,
+ "33": 3.61181640625,
+ "34": 4.61474609375,
+ "35": 7.22998046875,
+ "36": 7.22998046875,
+ "37": 11.55908203125,
+ "38": 8.6708984375,
+ "39": 2.48193359375,
+ "40": 4.3291015625,
+ "41": 4.3291015625,
+ "42": 5.05908203125,
+ "43": 7.591796875,
+ "44": 3.61181640625,
+ "45": 4.3291015625,
+ "46": 3.61181640625,
+ "47": 3.61181640625,
+ "48": 7.22998046875,
+ "49": 7.22998046875,
+ "50": 7.22998046875,
+ "51": 7.22998046875,
+ "52": 7.22998046875,
+ "53": 7.22998046875,
+ "54": 7.22998046875,
+ "55": 7.22998046875,
+ "56": 7.22998046875,
+ "57": 7.22998046875,
+ "58": 3.61181640625,
+ "59": 3.61181640625,
+ "60": 7.591796875,
+ "61": 7.591796875,
+ "62": 7.591796875,
+ "63": 7.22998046875,
+ "64": 13.19677734375,
+ "65": 8.6708984375,
+ "66": 8.6708984375,
+ "67": 9.38818359375,
+ "68": 9.38818359375,
+ "69": 8.6708984375,
+ "70": 7.94091796875,
+ "71": 10.11181640625,
+ "72": 9.38818359375,
+ "73": 3.61181640625,
+ "74": 6.5,
+ "75": 8.6708984375,
+ "76": 7.22998046875,
+ "77": 10.8291015625,
+ "78": 9.38818359375,
+ "79": 10.11181640625,
+ "80": 8.6708984375,
+ "81": 10.11181640625,
+ "82": 9.38818359375,
+ "83": 8.6708984375,
+ "84": 7.94091796875,
+ "85": 9.38818359375,
+ "86": 8.6708984375,
+ "87": 12.27001953125,
+ "88": 8.6708984375,
+ "89": 8.6708984375,
+ "90": 7.94091796875,
+ "91": 3.61181640625,
+ "92": 3.61181640625,
+ "93": 3.61181640625,
+ "94": 6.10009765625,
+ "95": 7.22998046875,
+ "96": 4.3291015625,
+ "97": 7.22998046875,
+ "98": 7.22998046875,
+ "99": 6.5,
+ "100": 7.22998046875,
+ "101": 7.22998046875,
+ "102": 3.61181640625,
+ "103": 7.22998046875,
+ "104": 7.22998046875,
+ "105": 2.88818359375,
+ "106": 2.88818359375,
+ "107": 6.5,
+ "108": 2.88818359375,
+ "109": 10.8291015625,
+ "110": 7.22998046875,
+ "111": 7.22998046875,
+ "112": 7.22998046875,
+ "113": 7.22998046875,
+ "114": 4.3291015625,
+ "115": 6.5,
+ "116": 3.61181640625,
+ "117": 7.22998046875,
+ "118": 6.5,
+ "119": 9.38818359375,
+ "120": 6.5,
+ "121": 6.5,
+ "122": 6.5,
+ "123": 4.341796875,
+ "124": 3.376953125,
+ "125": 4.341796875,
+ "126": 7.591796875,
+ "160": 3.61181640625,
+ "161": 4.3291015625,
+ "162": 7.22998046875,
+ "163": 7.22998046875,
+ "164": 7.22998046875,
+ "165": 7.22998046875,
+ "166": 3.376953125,
+ "167": 7.22998046875,
+ "168": 4.3291015625,
+ "169": 9.57861328125,
+ "170": 4.8115234375,
+ "171": 7.22998046875,
+ "172": 7.591796875,
+ "173": 0,
+ "174": 9.57861328125,
+ "175": 7.17919921875,
+ "176": 5.19873046875,
+ "177": 7.134765625,
+ "178": 4.3291015625,
+ "179": 4.3291015625,
+ "180": 4.3291015625,
+ "181": 7.490234375,
+ "182": 6.982421875,
+ "183": 4.3291015625,
+ "184": 4.3291015625,
+ "185": 4.3291015625,
+ "186": 4.748046875,
+ "187": 7.22998046875,
+ "188": 10.841796875,
+ "189": 10.841796875,
+ "190": 10.841796875,
+ "191": 7.94091796875,
+ "192": 8.6708984375,
+ "193": 8.6708984375,
+ "194": 8.6708984375,
+ "195": 8.6708984375,
+ "196": 8.6708984375,
+ "197": 8.6708984375,
+ "198": 13,
+ "199": 9.38818359375,
+ "200": 8.6708984375,
+ "201": 8.6708984375,
+ "202": 8.6708984375,
+ "203": 8.6708984375,
+ "204": 3.61181640625,
+ "205": 3.61181640625,
+ "206": 3.61181640625,
+ "207": 3.61181640625,
+ "208": 9.38818359375,
+ "209": 9.38818359375,
+ "210": 10.11181640625,
+ "211": 10.11181640625,
+ "212": 10.11181640625,
+ "213": 10.11181640625,
+ "214": 10.11181640625,
+ "215": 7.591796875,
+ "216": 10.11181640625,
+ "217": 9.38818359375,
+ "218": 9.38818359375,
+ "219": 9.38818359375,
+ "220": 9.38818359375,
+ "221": 8.6708984375,
+ "222": 8.6708984375,
+ "223": 7.94091796875,
+ "224": 7.22998046875,
+ "225": 7.22998046875,
+ "226": 7.22998046875,
+ "227": 7.22998046875,
+ "228": 7.22998046875,
+ "229": 7.22998046875,
+ "230": 11.55908203125,
+ "231": 6.5,
+ "232": 7.22998046875,
+ "233": 7.22998046875,
+ "234": 7.22998046875,
+ "235": 7.22998046875,
+ "236": 3.61181640625,
+ "237": 3.61181640625,
+ "238": 3.61181640625,
+ "239": 3.61181640625,
+ "240": 7.22998046875,
+ "241": 7.22998046875,
+ "242": 7.22998046875,
+ "243": 7.22998046875,
+ "244": 7.22998046875,
+ "245": 7.22998046875,
+ "246": 7.22998046875,
+ "247": 7.134765625,
+ "248": 7.94091796875,
+ "249": 7.22998046875,
+ "250": 7.22998046875,
+ "251": 7.22998046875,
+ "252": 7.22998046875,
+ "253": 6.5,
+ "254": 7.22998046875
+};
+
+export function calculateTextWidth(text: string, size: "8pt" | "10pt") {
+ let width = 0;
+ if(size === "8pt"){
+ for(let c = 0; c < text.length; c++){
+ width += arial8pt[text.charCodeAt(c)];
+ }
+ } else if(size === "10pt"){
+ for(let c = 0; c < text.length; c++){
+ width += arial10pt[text.charCodeAt(c)];
+ }
+ }
+ return width;
+}
\ No newline at end of file
diff --git a/src/svg/svg.ts b/src/svg/svg.ts
new file mode 100644
index 0000000..6a91a80
--- /dev/null
+++ b/src/svg/svg.ts
@@ -0,0 +1,698 @@
+import { Data, Languages, Debtor, Creditor, SVGOptions } from "../shared/types";
+import { validateData, cleanData } from "../shared/shared.js";
+import { calculateTextWidth } from "./characterWidth.js";
+import { SVG, calc } from "svg-engine";
+import * as utils from "../shared/utils.js";
+import translations from "../shared/translations.js";
+import generateQRCode from "../shared/qr-code.js";
+
+export class SVG_ {
+
+ protected instance: SVG;
+ private _data: Data;
+
+ private _language: Languages = "DE";
+
+ constructor(data: Data, options?: SVGOptions) {
+
+ this._data = data;
+
+
+ //-- Clean data (remove line breaks and unnecessary whitespaces)
+
+ this._data = cleanData(this._data);
+
+
+ //-- Validate data
+
+ validateData(this._data);
+
+
+ //-- Apply options
+
+ if(options !== undefined){
+ if(options.language !== undefined){
+ this._language = options.language;
+ }
+ }
+
+
+ //-- Create SVG
+
+ this.instance = new SVG();
+ this.instance.width("210mm");
+ this.instance.height("105mm");
+
+ this._render();
+
+ }
+
+
+ public get outerHTML(): string {
+ return this.instance.outerHTML;
+ }
+
+
+ private _render() {
+
+ const formattedCreditorAddress = this._formatAddress(this._data.creditor);
+ let receiptLineCount = 0;
+ let paymentPartLineCount = 0;
+
+
+ //-- Vertical line
+
+ this.instance.addLine("62mm", "0mm", "62mm", "105mm")
+ .stroke(1, "dashed", "black");
+
+
+ //-- Scissors
+
+ const scissorsCenter = "M8.55299 18.3969C9.54465 17.5748 9.51074 16.0915 9.08357 14.9829L6.47473 8.02261C7.58167 5.9986 7.26467 3.99833 7.80373 3.99833C8.22582 3.99833 8.13259 4.38482 9.23105 4.32719C10.2854 4.27125 11.0652 3.1711 10.9957 2.13197C11.0025 1.09115 10.2041 0.0130391 9.1056 0.00456339C7.99867 -0.0734135 6.96972 0.858918 6.89683 1.95907C6.70527 3.24907 7.48674 5.53413 5.56613 6.60547C4.09305 5.80705 4.08797 4.38991 4.16255 3.10838C4.22358 2.04552 3.91845 0.76738 2.87424 0.260531C1.87241 -0.229367 0.446794 0.25036 0.139972 1.37594C-0.277034 2.51168 0.250156 4.07122 1.55541 4.34244C2.56233 4.55095 3.03528 3.83729 3.40143 4.1119C3.67774 4.31871 3.5167 5.62906 4.566 7.96667L1.908 15.5033C1.64356 16.456 1.65204 17.6206 2.58776 18.463L5.5424 10.6484L8.55299 18.3969ZM10.1634 2.87953C9.55143 3.97629 7.88849 3.88645 7.56641 2.74731C7.20704 1.71666 8.20887 0.397838 9.32767 0.726697C10.2447 0.919943 10.5821 2.12858 10.1634 2.87953ZM3.36753 2.927C2.94544 4.07122 1.00789 3.87797 0.746835 2.71341C0.479001 1.94042 0.8638 0.836881 1.77409 0.758904C2.88102 0.608036 3.87946 1.90821 3.36753 2.927Z";
+
+ const scissorsSVG = this.instance.addSVG("11px", "19px").x(calc("62mm - 5.25px")).y("30pt");
+ scissorsSVG.addPath(scissorsCenter).fill("black");
+
+
+ //-- Receipt
+
+ const receiptContainer = this.instance.addSVG()
+ .x("5mm")
+ .y("5mm");
+
+ const receiptTextContainer = receiptContainer.addText();
+
+ receiptTextContainer.addTSpan(translations[this._language].receipt)
+ .x(0)
+ .y(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("11pt");
+
+
+ //-- Creditor
+
+ receiptTextContainer.addTSpan(translations[this._language].account)
+ .x(0)
+ .y("7mm")
+ .dy("9pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ receiptTextContainer.addTSpan(utils.formatIBAN(this._data.creditor.account))
+ .x(0)
+ .dy("9pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+ receiptLineCount++;
+
+ let receiptCreditorAddressLines: Array = [];
+ for(const line of formattedCreditorAddress){
+ const messageLines = this._fitTextToWidth(line, utils.mm2px(52), 2, "8pt");
+ receiptCreditorAddressLines = [...receiptCreditorAddressLines, ...messageLines];
+ }
+
+ for(const line of receiptCreditorAddressLines){
+ receiptLineCount++;
+ receiptTextContainer.addTSpan(line)
+ .x(0)
+ .dy("9pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+ }
+
+
+ //-- Reference
+
+ if(this._data.reference !== undefined){
+
+ receiptTextContainer.addTSpan(translations[this._language].reference)
+ .x(0)
+ .dy("15pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ receiptTextContainer.addTSpan(utils.formatIBAN(this._data.reference))
+ .x(0)
+ .dy("9pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+ receiptLineCount++;
+
+ }
+
+
+ //-- Debtor
+
+ if(this._data.debtor !== undefined){
+
+ const formattedDebtorAddress = this._formatAddress(this._data.debtor);
+
+ receiptTextContainer.addTSpan(translations[this._language].payableBy)
+ .x(0)
+ .dy("15pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ let receiptDebtorAddressLines: Array = [];
+ for(const line of formattedDebtorAddress){
+ const messageLines = this._fitTextToWidth(line, utils.mm2px(52), 2, "8pt");
+ receiptDebtorAddressLines = [...receiptDebtorAddressLines, ...messageLines];
+ }
+
+ for(const line of receiptDebtorAddressLines){
+ receiptTextContainer.addTSpan(line)
+ .x(0)
+ .dy("9pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+ }
+
+ } else {
+
+
+ //- Add rectangle
+
+ receiptTextContainer.addTSpan(translations[this._language].payableByName)
+ .x(0)
+ .dy("15pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ const referenceHeight = this._data.reference !== undefined ? "15pt" : "0";
+ this._addRectangle(5, calc(`12mm + 9pt + (${receiptLineCount} * 9pt) + ${referenceHeight} + 15pt + 1mm`, "mm"), 52, 20);
+
+ }
+
+
+ //-- Amount
+
+ const amountContainer = receiptContainer.addText()
+ .y("63mm");
+
+ amountContainer.addTSpan(translations[this._language].currency)
+ .x(0)
+ .dy("6pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ amountContainer.addTSpan(translations[this._language].amount)
+ .x("13mm")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+ amountContainer.addTSpan(this._data.currency)
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+
+ if(this._data.amount !== undefined){
+ amountContainer.addTSpan(utils.formatAmount(this._data.amount))
+ .x("13mm")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("8pt");
+ } else {
+ this._addRectangle(27, 68, 30, 10);
+ }
+
+
+ //-- Acceptance point
+
+ amountContainer.addTSpan(translations[this._language].acceptancePoint)
+ .x("52mm")
+ .y("82mm")
+ .textAlign("right")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("6pt");
+
+
+ //-- Payment part middle column
+
+ const paymentPartContainer = this.instance.addSVG()
+ .x("67mm")
+ .y("5mm");
+
+ paymentPartContainer.addText(translations[this._language].paymentPart)
+ .x(0)
+ .y(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("11pt");
+
+
+ //-- QR Code
+
+ this._renderQRCode();
+
+
+ //-- Amount
+
+ const paymentPartMiddleTextContainer = paymentPartContainer.addText()
+ .y("63mm");
+
+ paymentPartMiddleTextContainer.addTSpan(translations[this._language].currency)
+ .x(0)
+ .dy("8pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ paymentPartMiddleTextContainer.addTSpan(translations[this._language].amount)
+ .x("20mm")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ paymentPartMiddleTextContainer.addTSpan(this._data.currency)
+ .x(0)
+ .dy("13pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+
+ if(this._data.amount !== undefined){
+ paymentPartMiddleTextContainer.addTSpan(utils.formatAmount(this._data.amount))
+ .x("20mm")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ } else {
+ this._addRectangle(78, calc("68mm + 8pt + 5pt", "mm"), 40, 15);
+ }
+
+
+ //-- AV1 and AV2
+
+ const alternativeSchemeContainer = paymentPartContainer.addText()
+ .x(0)
+ .y("90mm");
+
+ if(this._data.av1 !== undefined){
+
+ alternativeSchemeContainer.addTSpan("Name AV1:")
+ .x(0)
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("7pt");
+
+ alternativeSchemeContainer.addTSpan(this._data.av1.length > 87 ? this._data.av1.substr(0, 87) + "..." : this._data.av1)
+ .x(0)
+ .dx("15mm")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("7pt");
+
+ }
+ if(this._data.av2 !== undefined){
+
+ alternativeSchemeContainer.addTSpan("Name AV2:")
+ .x(0)
+ .dy("8pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("7pt");
+
+ alternativeSchemeContainer.addTSpan(this._data.av2.length > 87 ? this._data.av2.substr(0, 87) + "..." : this._data.av2)
+ .x(0)
+ .dx("15mm")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("7pt");
+
+ }
+
+
+ //-- Payment part right column
+
+ const paymentPartDebtorContainer = this.instance.addSVG()
+ .x("118mm")
+ .y("5mm");
+
+ const paymentPartRightTextContainer = paymentPartDebtorContainer.addText();
+
+
+ //-- Creditor
+
+ paymentPartRightTextContainer.addTSpan(translations[this._language].account)
+ .x(0)
+ .y(0)
+ .dy("8pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ paymentPartRightTextContainer.addTSpan(utils.formatIBAN(this._data.creditor.account))
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+
+ let paymentPartCreditorAddressLines: Array = [];
+ for(const line of formattedCreditorAddress){
+ const messageLines = this._fitTextToWidth(line, utils.mm2px(52), 2, "8pt");
+ paymentPartCreditorAddressLines = [...paymentPartCreditorAddressLines, ...messageLines];
+ }
+
+ for(const line of paymentPartCreditorAddressLines){
+ paymentPartRightTextContainer.addTSpan(line)
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+ }
+
+
+ //-- Reference
+
+ if(this._data.reference !== undefined){
+
+ paymentPartRightTextContainer.addTSpan(translations[this._language].reference)
+ .x(0)
+ .dy("19pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ paymentPartRightTextContainer.addTSpan(utils.formatIBAN(this._data.reference))
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+
+ }
+
+
+ //-- Message / Additional information
+
+ if(this._data.message !== undefined || this._data.additionalInformation !== undefined){
+
+ paymentPartRightTextContainer.addTSpan(translations[this._language].additionalInformation)
+ .x(0)
+ .dy("19pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ const referenceType = utils.getReferenceType(this._data.reference);
+ const maxLines = referenceType === "QRR" || referenceType === "SCOR" ? 3 : 4;
+ const lengthInPixel = utils.mm2px(87);
+ const linesOfMessage = this._getLineCountOfText(this._data.message, lengthInPixel, "10pt");
+ const linesOfAdditionalInformation = this._getLineCountOfText(this._data.additionalInformation, lengthInPixel, "10pt");
+
+ if(this._data.additionalInformation !== undefined){
+
+ if(referenceType === "QRR" || referenceType === "SCOR"){
+
+ // QRR and SCOR have 1 line for the message and 2 lines for the additional information
+
+ if(this._data.message !== undefined){
+ paymentPartRightTextContainer.addTSpan(this._elipsis(this._data.message, lengthInPixel, "10pt"))
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+ }
+ } else {
+
+ // Non QRR and SCOR have 4 lines total available and the message should be shortened if necessary
+
+ if(this._data.message !== undefined){
+
+ const maxLinesOfMessage = maxLines - linesOfAdditionalInformation;
+ const messageLines = this._fitTextToWidth(this._data.message, lengthInPixel, maxLinesOfMessage, "10pt");
+
+ for(let i = 0; i < maxLinesOfMessage; i++){
+ paymentPartRightTextContainer.addTSpan(messageLines[i])
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+ }
+
+ }
+
+
+ }
+
+ const additionalInformationLines = this._fitTextToWidth(this._data.additionalInformation, lengthInPixel, linesOfAdditionalInformation, "10pt");
+ for(let i = 0; i < linesOfAdditionalInformation; i++){
+ paymentPartRightTextContainer.addTSpan(additionalInformationLines[i])
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+ }
+
+ } else if(this._data.message !== undefined){
+ const messageLines = this._fitTextToWidth(this._data.message, lengthInPixel, maxLines, "10pt");
+ for(let i = 0; i < maxLines; i++){
+ paymentPartRightTextContainer.addTSpan(messageLines[i])
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ paymentPartLineCount++;
+ }
+ }
+
+ }
+
+
+ //-- Debtor
+
+ if(this._data.debtor !== undefined){
+
+ const formattedDebtorAddress = this._formatAddress(this._data.debtor);
+
+ paymentPartRightTextContainer.addTSpan(translations[this._language].payableBy)
+ .x(0)
+ .dy("19pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ let paymentPartDebtorAddressLines: Array = [];
+ for(const line of formattedDebtorAddress){
+ const messageLines = this._fitTextToWidth(line, utils.mm2px(52), 2, "8pt");
+ paymentPartDebtorAddressLines = [...paymentPartDebtorAddressLines, ...messageLines];
+ }
+
+ for(const line of paymentPartDebtorAddressLines){
+ paymentPartRightTextContainer.addTSpan(line)
+ .x(0)
+ .dy("11pt")
+ .fontFamily("Arial")
+ .fontWeight("normal")
+ .fontSize("10pt");
+ }
+
+ } else {
+
+ paymentPartRightTextContainer.addTSpan(translations[this._language].payableByName)
+ .x(0)
+ .dy("19pt")
+ .fontFamily("Arial")
+ .fontWeight("bold")
+ .fontSize("8pt");
+
+ const referenceHeight = this._data.reference !== undefined ? "19pt" : "0";
+ const additionalInformationHeight = this._data.additionalInformation !== undefined || this._data.message !== undefined ? "19pt" : "0";
+ this._addRectangle(118, calc(`5mm + 8pt + (${paymentPartLineCount} * 11pt) + ${referenceHeight} + ${additionalInformationHeight} + 19pt + 1mm`, "mm"), 65, 25);
+
+ }
+ }
+
+
+ private _renderQRCode() {
+
+ const qrcode = generateQRCode(this._data, utils.mm2px(46));
+
+ const qrcodeSVG = this.instance.addSVG("46mm", "46mm")
+ .y("17mm")
+ .x("67mm");
+
+
+ //-- Add QR Code
+
+ qrcodeSVG.addPath(qrcode)
+ .fill("black");
+
+
+ //-- Add background
+
+ qrcodeSVG.addRect("19mm", "19mm", "8mm", "8mm")
+ .fill("white");
+ qrcodeSVG.addRect("19.5mm", "19.5mm", "7mm", "7mm")
+ .fill("black");
+
+
+ //-- Add swiss cross
+
+ qrcodeSVG.addRect("22.415mm", "21.055mm", "1.17mm", "3.89mm")
+ .fill("white");
+ qrcodeSVG.addRect("21.055mm", "22.415mm", "3.89mm", "1.17mm")
+ .fill("white");
+
+ }
+
+
+ private _formatAddress(data: Debtor | Creditor): Array {
+ if(data.buildingNumber !== undefined){
+ return [data.name, data.address + " " + data.buildingNumber, data.zip + " " + data.city];
+ } else {
+ return [data.name, data.address, data.zip + " " + data.city];
+ }
+ }
+
+
+ private _getLineCountOfText(text: string | undefined, lengthInPixel: number, size: "8pt" | "10pt") {
+ if(text === undefined){
+ return 0;
+ } else {
+ let lines = 0;
+ let remainder = calculateTextWidth(text, size);
+ while(remainder > 1){
+ lines++;
+ remainder -= lengthInPixel;
+ }
+ return lines;
+ }
+ }
+
+
+ private _fitTextToWidth(text: string, lengthInPixel: number, maxLines: number, size: "8pt" | "10pt"): Array {
+
+ const remainder = text.split(/ |-/g);
+ let lines: Array = [];
+ let currentLine = "";
+
+ const checkCurrentLine = (currentLine: string): { lines: Array, leftover: string } => {
+ const lines: Array = [];
+ let leftover: string = "";
+ if(calculateTextWidth(currentLine, size) > lengthInPixel){
+ const currentWordRemainder = currentLine.split("");
+ let currentWord = "";
+ while(currentWordRemainder.length > 0){
+ if(calculateTextWidth(currentWord, size) <= lengthInPixel){
+ currentWord += currentWordRemainder.shift();
+ } else {
+ lines.push(currentWord);
+ currentWord = "";
+ }
+ }
+ if(currentWord !== ""){
+ leftover = currentWord;
+ }
+ } else {
+ lines.push(currentLine);
+ }
+ return { lines, leftover };
+ };
+
+ while(remainder.length > 0){
+ const nextWord = remainder.shift() + " ";
+ if(calculateTextWidth(currentLine + nextWord, size) <= lengthInPixel){
+ currentLine += nextWord;
+ } else {
+ if(currentLine !== ""){
+ const { lines: newLines, leftover } = checkCurrentLine(currentLine);
+ lines.push(...newLines);
+ currentLine = leftover + nextWord;
+ } else {
+ currentLine = nextWord;
+ }
+ }
+ }
+ if(currentLine !== "" && currentLine !== " "){
+ const { lines: newLines, leftover } = checkCurrentLine(currentLine);
+ lines.push(...newLines);
+ if(leftover !== ""){
+ lines.push(leftover);
+ }
+ }
+
+ if(lines.length > maxLines){
+ lines = lines.slice(0, maxLines);
+ lines[lines.length - 1] = this._elipsis(lines[lines.length - 1], lengthInPixel, size);
+ }
+
+ return lines;
+
+ }
+
+
+ private _elipsis(text: string, lengthInPixel: number, size: "8pt" | "10pt"): string {
+
+ let result = "";
+
+ if(calculateTextWidth(text, size) > lengthInPixel){
+ for(let c = 0; c < text.length; c++){
+ if(calculateTextWidth(result + text[c] + "...", size) <= lengthInPixel){
+ result += text[c];
+ } else {
+ break;
+ }
+ }
+ } else {
+ return text;
+ }
+
+ if(result.substr(-1) === " "){
+ result = result.slice(0, -1);
+ }
+
+ return result + "...";
+
+ }
+
+
+ private _addRectangle(x: number, y: number, width: number, height: number) {
+
+ const container = this.instance.addSVG(width + "mm", height + "mm");
+ container.x(x + "mm").y(y + "mm");
+
+ const length = 3;
+
+ container.addLine("0mm", "0mm", length + "mm", "0mm").stroke(".75pt", "solid", "black");
+ container.addLine(width - length + "mm", "0mm", width + "mm", "0mm").stroke(".75pt", "solid", "black");
+ container.addLine(width + "mm", "0mm", width + "mm", length + "mm").stroke(".75pt", "solid", "black");
+ container.addLine(width + "mm", height - length + "mm", width + "mm", height + "mm").stroke(".75pt", "solid", "black");
+ container.addLine(width - length + "mm", height + "mm", width + "mm", height + "mm").stroke(".75pt", "solid", "black");
+ container.addLine("0mm", height + "mm", length + "mm", height + "mm").stroke(".75pt", "solid", "black");
+ container.addLine("0mm", height - length + "mm", "0mm", height + "mm").stroke(".75pt", "solid", "black");
+ container.addLine("0mm", "0mm", "0mm", length + "mm").stroke(".75pt", "solid", "black");
+
+ return container;
+
+ }
+
+}
\ No newline at end of file
diff --git a/src/swissqrbill.ts b/src/swissqrbill.ts
deleted file mode 100644
index b28fd5c..0000000
--- a/src/swissqrbill.ts
+++ /dev/null
@@ -1,1240 +0,0 @@
-import { parse } from "svg-parser";
-import QRCode from "@schoero/qrcode";
-import ExtendedPDF from "./extended-pdf";
-import * as utils from "./utils";
-
-export interface data {
- currency: currency,
- creditor: creditor,
- debtor?: debtor,
- debitor?: debtor,
- amount?: number,
- reference?: string,
- message?: string,
- additionalInformation?: string,
- av1?: string,
- av2?: string
-}
-
-export interface debtor {
- name: string,
- address: string,
- zip: string | number,
- city: string,
- country: string
- houseNumber?: string | number
-}
-
-export interface creditor extends debtor {
- account: string,
-}
-
-export interface options {
- language?: languages,
- size?: size,
- scissors?: boolean,
- separate?: boolean,
- outlines?: boolean
- autoGenerate?: boolean,
-}
-
-export import PDFTable = ExtendedPDF.PDFTable;
-export import PDFRow = ExtendedPDF.PDFRow;
-export import PDFColumn = ExtendedPDF.PDFColumn;
-
-export type currency = "CHF" | "EUR";
-export type size = "A4" | "A6/5";
-export type languages = "DE" | "EN" | "IT" | "FR";
-
-export import utils = utils;
-
-export class PDF extends ExtendedPDF.PDF {
-
- public size: size = "A6/5";
- private _data: data;
- private _scissors: boolean = true;
- private _separate: boolean = false;
- private _outlines: boolean = true;
- private _language: languages = "DE";
- private _marginTop: number = 0;
- private _autoGenerate: boolean = true;
- private _referenceType: "QRR" | "SCOR" | "NON" = "NON";
-
- static translations = {
-
- DE: {
- paymentPart: "Zahlteil",
- account: "Konto / Zahlbar an",
- reference: "Referenz",
- additionalInformation: "Zusätzliche Informationen",
- currency: "Währung",
- amount: "Betrag",
- receipt: "Empfangsschein",
- acceptancePoint: "Annahmestelle",
- separate: "Vor der Einzahlung abzutrennen",
- payableBy: "Zahlbar durch",
- payableByName: "Zahlbar durch (Name/Adresse)",
- inFavourOf: "Zugunsten"
- },
- EN: {
- paymentPart: "Payment part",
- account: "Account / Payable to",
- reference: "Reference",
- additionalInformation: "Additional information",
- currency: "Currency",
- amount: "Amount",
- receipt: "Receipt",
- acceptancePoint: "Acceptance point",
- separate: "Separate before paying in",
- payableBy: "Payable by",
- payableByName: "Payable by (name/address)",
- inFavourOf: "In favour of"
- },
- IT: {
- paymentPart: "Sezione pagamento",
- account: "Conto / Pagabile a",
- reference: "Riferimento",
- additionalInformation: "Informazioni supplementari",
- currency: "Valuta",
- amount: "Importo",
- receipt: "Ricevuta",
- acceptancePoint: "Punto di accettazione",
- separate: "Da staccare prima del versamento",
- payableBy: "Pagabile da",
- payableByName: "Pagabile da (nome/indirizzo)",
- inFavourOf: "A favore di"
- },
- FR: {
- paymentPart: "Section paiement",
- account: "Compte / Payable à ",
- reference: "Référence",
- additionalInformation: "Informations supplémentaires",
- currency: "Monnaie",
- amount: "Montant",
- receipt: "Récépissé",
- acceptancePoint: "Point de dépôt",
- separate: "A détacher avant le versement",
- payableBy: "Payable par",
- payableByName: "Payable par (nom/adresse)",
- inFavourOf: "En faveur de"
- }
- }
-
-
- constructor(data: data, options?: options) {
-
- super({ autoFirstPage: false, bufferPages: true });
-
- this._data = data;
-
- if(this._data.debtor === undefined && this._data.debitor !== undefined){
- this._data.debtor = this._data.debitor;
- }
-
- this._cleanData();
- this._validateData();
-
-
- //-- Validate reference
-
- if(utils.isQRIBAN(this._data.creditor.account)){
- if(this._data.reference !== undefined){
- if(utils.isQRReference(this._data.reference)){
- this._referenceType = "QRR";
- }
- }
- } else {
-
- if(this._data.reference === undefined){
- this._referenceType = "NON";
- } else {
- if(!utils.isQRReference(this._data.reference)){
- this._referenceType = "SCOR";
- }
- }
-
- }
-
-
- //-- Apply options
-
- if(options !== undefined){
- if(options.language !== undefined){
- this._language = options.language;
- }
- if(options.size !== undefined){
- this.size = options.size;
- }
- if(options.scissors !== undefined){
- this._scissors = options.scissors;
- this._separate = !options.scissors;
- }
- if(options.separate !== undefined){
- this._separate = options.separate;
- this._scissors = !options.separate;
- }
- if(options.scissors === false && options.separate === false){
- this._separate = false;
- this._scissors = false;
- }
- if(options.outlines !== undefined){
- this._outlines = options.outlines;
- }
- if(options.autoGenerate !== undefined){
- this._autoGenerate = options.autoGenerate;
- }
- }
-
- this.info.Producer = this.info.Creator = this.info.Author = "SwissQRBill";
-
- this.addPage();
-
- if(this._autoGenerate === true){
- this.addQRBill();
- this.end();
- }
-
- }
-
-
- public addPage(options?: PDFKit.PDFDocumentOptions): PDFKit.PDFDocument {
-
- if(options === undefined){
- options = {
- margin: utils.mmToPoints(5),
- layout: this.size === "A4" ? "portrait" : "landscape",
- size: this.size === "A4" ? this.size : [utils.mmToPoints(105), utils.mmToPoints(210)]
- };
- }
-
- return super.addPage(options);
-
- }
-
-
- public end(): void {
- this.emit("beforeEnd", this);
- return super.end();
- }
-
-
- public addQRBill(size: size = "A6/5"): void {
-
- if(this.page.height - this.y < utils.mmToPoints(105) && this.y !== this.page.margins.top){
- this.addPage({
- margin: 0,
- layout: size === "A4" ? "portrait" : "landscape",
- size: size === "A4" ? size : [utils.mmToPoints(105), utils.mmToPoints(210)]
- });
- }
-
- this._marginTop = this.page.height - utils.mmToPoints(105);
-
- this._drawOutlines();
- this._drawReceipt();
- this._drawPaymentPart();
-
- }
-
-
- private _drawOutlines(): void {
-
-
- //-- Lines
-
- if(this._outlines === true){
-
-
- //-- Horizontal line
-
- if(this.page.height > utils.mmToPoints(105)){
-
- this.moveTo(0, this._marginTop)
- .lineTo(utils.mmToPoints(210), this._marginTop)
- .lineWidth(.75)
- .strokeOpacity(1)
- .dash(1, { size: 1 })
- .strokeColor("black")
- .stroke();
-
- }
-
-
- //-- Vertical line
-
- this.moveTo(utils.mmToPoints(62), this._marginTop)
- .lineTo(utils.mmToPoints(62), this._marginTop + utils.mmToPoints(105))
- .lineWidth(.75)
- .strokeOpacity(1)
- .dash(1, { size: 1 })
- .strokeColor("black")
- .stroke();
-
- }
-
-
- //-- Scissors
-
- if(this._scissors === true){
-
- const scissorsTop = "M4.545 -1.803C4.06 -2.388 3.185 -2.368 2.531 -2.116l-4.106 1.539c-1.194 -0.653 -2.374 -0.466 -2.374 -0.784c0 -0.249 0.228 -0.194 0.194 -0.842c-0.033 -0.622 -0.682 -1.082 -1.295 -1.041c-0.614 -0.004 -1.25 0.467 -1.255 1.115c-0.046 0.653 0.504 1.26 1.153 1.303c0.761 0.113 2.109 -0.348 2.741 0.785c-0.471 0.869 -1.307 0.872 -2.063 0.828c-0.627 -0.036 -1.381 0.144 -1.68 0.76c-0.289 0.591 -0.006 1.432 0.658 1.613c0.67 0.246 1.59 -0.065 1.75 -0.835c0.123 -0.594 -0.298 -0.873 -0.136 -1.089c0.122 -0.163 0.895 -0.068 2.274 -0.687L2.838 2.117C3.4 2.273 4.087 2.268 4.584 1.716L-0.026 -0.027L4.545 -1.803zm-9.154 -0.95c0.647 0.361 0.594 1.342 -0.078 1.532c-0.608 0.212 -1.386 -0.379 -1.192 -1.039c0.114 -0.541 0.827 -0.74 1.27 -0.493zm0.028 4.009c0.675 0.249 0.561 1.392 -0.126 1.546c-0.456 0.158 -1.107 -0.069 -1.153 -0.606c-0.089 -0.653 0.678 -1.242 1.279 -0.94z";
- const scissorsCenter = "M1.803 4.545C2.388 4.06 2.368 3.185 2.116 2.531l-1.539 -4.106c0.653 -1.194 0.466 -2.374 0.784 -2.374c0.249 0 0.194 0.228 0.842 0.194c0.622 -0.033 1.082 -0.682 1.041 -1.295c0.004 -0.614 -0.467 -1.25 -1.115 -1.255c-0.653 -0.046 -1.26 0.504 -1.303 1.153c-0.113 0.761 0.348 2.109 -0.785 2.741c-0.869 -0.471 -0.872 -1.307 -0.828 -2.063c0.036 -0.627 -0.144 -1.381 -0.76 -1.68c-0.591 -0.289 -1.432 -0.006 -1.613 0.658c-0.246 0.67 0.065 1.59 0.835 1.75c0.594 0.123 0.873 -0.298 1.089 -0.136c0.163 0.122 0.068 0.895 0.687 2.274L-2.117 2.838C-2.273 3.4 -2.268 4.087 -1.716 4.584L0.027 -0.026L1.803 4.545zm0.95 -9.154c-0.361 0.647 -1.342 0.594 -1.532 -0.078c-0.212 -0.608 0.379 -1.386 1.039 -1.192c0.541 0.114 0.74 0.827 0.493 1.27zm-4.009 0.028c-0.249 0.675 -1.392 0.561 -1.546 -0.126c-0.158 -0.456 0.069 -1.107 0.606 -1.153c0.653 -0.089 1.242 0.678 0.94 1.279z";
-
- if(this.page.height > utils.mmToPoints(105)){
-
- this.addPath(scissorsTop, utils.mmToPoints(105), this._marginTop)
- .fillColor("black")
- .fill();
-
- }
-
- this.addPath(scissorsCenter, utils.mmToPoints(62), this._marginTop + 30)
- .fillColor("black")
- .fill();
- this.translate(0, 0);
-
- }
-
-
- //-- Separation text
-
- if(this._separate === true){
-
- if(this.page.height > utils.mmToPoints(105)){
-
- this.fontSize(11);
- this.font("Helvetica");
- this.text(PDF.translations[this._language].separate, utils.mmToPoints(0), this._marginTop - 12, {
- width: utils.mmToPoints(210),
- align: "center"
- });
-
- }
-
- }
-
- }
-
-
- private _drawReceipt(): void {
-
- this.fontSize(11);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].receipt, utils.mmToPoints(5), this._marginTop + utils.mmToPoints(5), {
- width: utils.mmToPoints(52),
- align: "left"
- });
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].account, utils.mmToPoints(5), this._marginTop + utils.mmToPoints(12), {
- width: utils.mmToPoints(52)
- });
-
-
- //-- Creditor
-
- this.fontSize(8);
- this.font("Helvetica");
- this.text(`${utils.formatIBAN(this._data.creditor.account)}\n${this._formatAddress(this._data.creditor)}`, {
- width: utils.mmToPoints(52)
- });
-
- this.moveDown();
-
-
- //-- Reference
-
- if(this._data.reference !== undefined){
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].reference, {
- width: utils.mmToPoints(52)
- });
-
- this.fontSize(8);
- this.font("Helvetica");
- this.text(this._formatReference(this._data.reference), {
- width: utils.mmToPoints(52)
- });
-
- }
-
-
- //-- Debtor
-
- if(this._data.debtor !== undefined){
-
- this.fontSize(9);
- this.moveDown();
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].payableBy, {
- width: utils.mmToPoints(52)
- });
-
- this.fontSize(8);
- this.font("Helvetica");
- this.text(this._formatAddress(this._data.debtor), {
- width: utils.mmToPoints(52)
- });
-
- } else {
-
- this.fontSize(9);
- this.moveDown();
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].payableByName, {
- width: utils.mmToPoints(52)
- });
-
-
- //-- Draw rectangle
-
- const posY = this._data.reference === undefined ? 38 : 43;
-
- this._drawRectangle(5, posY, 52, 20);
-
- }
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].currency, utils.mmToPoints(5), this._marginTop + utils.mmToPoints(68), {
- width: utils.mmToPoints(15)
- });
-
- this.text(PDF.translations[this._language].amount, utils.mmToPoints(20), this._marginTop + utils.mmToPoints(68), {
- width: utils.mmToPoints(37)
- });
-
- this.fontSize(8);
- this.font("Helvetica");
- this.text(this._data.currency, utils.mmToPoints(5), this._marginTop + utils.mmToPoints(71), {
- width: utils.mmToPoints(15)
- });
-
- if(this._data.amount !== undefined){
- this.text(utils.formatAmount(this._data.amount), utils.mmToPoints(20), this._marginTop + utils.mmToPoints(71), {
- width: utils.mmToPoints(37)
- });
- } else {
- this._drawRectangle(30, 68, 30, 10);
- }
-
- this.fontSize(6);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].acceptancePoint, utils.mmToPoints(5), this._marginTop + utils.mmToPoints(82), {
- width: utils.mmToPoints(52),
- align: "right"
- });
-
- }
-
-
- private _drawPaymentPart(): void {
-
- this.fontSize(11);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].paymentPart, utils.mmToPoints(67), this._marginTop + utils.mmToPoints(5), {
- width: utils.mmToPoints(51),
- align: "left"
- });
-
- this._generateQRCode();
-
- this.fillColor("black");
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].currency, utils.mmToPoints(67), this._marginTop + utils.mmToPoints(68), {
- width: utils.mmToPoints(15)
- });
-
- this.text(PDF.translations[this._language].amount, utils.mmToPoints(87), this._marginTop + utils.mmToPoints(68), {
- width: utils.mmToPoints(36)
- });
-
- this.fontSize(10);
- this.font("Helvetica");
- this.text(this._data.currency, utils.mmToPoints(67), this._marginTop + utils.mmToPoints(72), {
- width: utils.mmToPoints(15)
- });
-
- if(this._data.amount !== undefined){
- this.text(utils.formatAmount(this._data.amount), utils.mmToPoints(87), this._marginTop + utils.mmToPoints(72), {
- width: utils.mmToPoints(36)
- });
- } else {
- this._drawRectangle(80, 72, 40, 15);
- }
-
-
- //-- AV1 and AV2
-
- if(this._data.av1 !== undefined){
- this.fontSize(7);
- this.font("Helvetica-Bold");
- this.text("Name AV1:", utils.mmToPoints(67), this._marginTop + utils.mmToPoints(90), {
- width: utils.mmToPoints(15)
- });
-
- this.fontSize(7);
- this.font("Helvetica");
- this.text((this._data.av1.length > 87 ? this._data.av1.substr(0, 87) + "..." : this._data.av1), utils.mmToPoints(81), this._marginTop + utils.mmToPoints(90), {
- width: utils.mmToPoints(37)
- });
- }
-
- if(this._data.av2 !== undefined){
- this.fontSize(7);
- this.font("Helvetica-Bold");
- this.text("Name AV2:", utils.mmToPoints(67), this._marginTop + utils.mmToPoints(93), {
- width: utils.mmToPoints(15)
- });
-
- this.fontSize(7);
- this.font("Helvetica");
- this.text((this._data.av2.length > 87 ? this._data.av2.substr(0, 87) + "..." : this._data.av2), utils.mmToPoints(81), this._marginTop + utils.mmToPoints(93), {
- width: utils.mmToPoints(37)
- });
- }
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].account, utils.mmToPoints(118), this._marginTop + utils.mmToPoints(5), {
- width: utils.mmToPoints(87)
- });
-
- this.fontSize(10);
- this.font("Helvetica");
- this.text(`${utils.formatIBAN(this._data.creditor.account)}\n${this._formatAddress(this._data.creditor)}`, utils.mmToPoints(118), this._marginTop + utils.mmToPoints(9.5), {
- width: utils.mmToPoints(87)
- });
-
- this.moveDown();
-
- if(this._data.reference !== undefined){
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].reference, {
- width: utils.mmToPoints(87)
- });
-
- this.fontSize(10);
- this.font("Helvetica");
- this.text(this._formatReference(this._data.reference), {
- width: utils.mmToPoints(87)
- });
-
- this.moveDown();
-
- }
-
-
- //-- Message / Additional information
-
- if(this._data.message !== undefined || this._data.additionalInformation !== undefined){
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].additionalInformation, {
- width: utils.mmToPoints(87)
- });
-
- this.fontSize(10);
- this.font("Helvetica");
-
- const options = {
- width: utils.mmToPoints(87)
- };
-
- const singleLineHeight = this.heightOfString("A", options);
- const maxLines = this._referenceType === "QRR" || this._referenceType === "SCOR" ? 3 : 4;
- const linesOfMessage = this._data.message !== undefined ? this.heightOfString(this._data.message, options) / singleLineHeight : 0;
- const linesOfAdditionalInformation = this._data.additionalInformation !== undefined ? this.heightOfString(this._data.additionalInformation, options) / singleLineHeight : 0;
-
- if(this._data.additionalInformation !== undefined){
-
- if(this._referenceType === "QRR" || this._referenceType === "SCOR"){
-
- // QRR and SCOR have 1 line for the message and 2 lines for the additional information
-
- if(this._data.message !== undefined){
- this.text(this._data.message, { ...options, lineBreak: false, ellipsis: true, height: singleLineHeight });
- }
-
- } else {
-
- // Non QRR and SCOR have 4 lines total available and the message should be shortened if necessary
-
- if(this._data.message !== undefined){
- if(linesOfMessage + linesOfAdditionalInformation > maxLines){
- const maxLinesOfMessage = maxLines - linesOfAdditionalInformation;
- this.text(this._data.message, { ...options, height: singleLineHeight * maxLinesOfMessage, lineBreak: true, ellipsis: true });
- }
- }
-
- }
-
- this.text(this._data.additionalInformation, options);
-
- } else if(this._data.message !== undefined){
- this.text(this._data.message, { ...options, height: singleLineHeight * maxLines, lineBreak: true, ellipsis: true });
- }
-
- this.moveDown();
-
- }
-
- if(this._data.debtor !== undefined){
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].payableBy, {
- width: utils.mmToPoints(87)
- });
-
- this.fontSize(10);
- this.font("Helvetica");
- this.text(this._formatAddress(this._data.debtor), {
- width: utils.mmToPoints(87)
- });
-
- } else {
-
- this.fontSize(8);
- this.font("Helvetica-Bold");
- this.text(PDF.translations[this._language].payableByName, {
- width: utils.mmToPoints(87)
- });
-
- const posY = this._data.reference === undefined ? 34 : 45;
-
- this._drawRectangle(118, posY, 65, 25);
-
- }
- }
-
-
- private _validateData(): void {
-
-
- //-- Creditor
-
- if(this._data.creditor === undefined){ throw new Error("Creditor cannot be undefined."); }
-
-
- //-- Creditor account
-
- if(this._data.creditor.account === undefined){
- throw new Error("You must provide an IBAN or QR-IBAN number.");
- }
-
- if(this._data.creditor.account.length !== 21){
- throw new Error(`The provided IBAN number '${this._data.creditor.account}' is either too long or too short.`);
- }
-
- if(utils.isIBANValid(this._data.creditor.account) === false){
- throw new Error(`The provided IBAN number '${this._data.creditor.account}' is not valid.`);
- }
-
- if(this._data.creditor.account.substr(0, 2) !== "CH" && this._data.creditor.account.substr(0, 2) !== "LI"){
- throw new Error("Only CH and LI IBAN numbers are allowed.");
- }
-
-
- //-- Validate reference
-
- if(utils.isQRIBAN(this._data.creditor.account)){
-
- if(this._data.reference === undefined){
- throw new Error("If there is no reference, a conventional IBAN must be used.");
- }
-
- if(utils.isQRReference(this._data.reference)){
-
- this._referenceType = "QRR";
-
- if(!utils.isQRReferenceValid(this._data.reference)){
- throw new Error("QR-Reference checksum is not valid.");
- }
-
- } else {
- throw new Error("QR-IBAN requires the use of a QR-Reference (and vice versa).");
- }
-
- } else {
-
- if(this._data.reference === undefined){
- this._referenceType = "NON";
- } else {
- if(utils.isQRReference(this._data.reference)){
- throw new Error("QR-Reference requires the use of a QR-IBAN (and vice versa).");
- } else {
- this._referenceType = "SCOR";
- }
- }
-
- }
-
-
- //-- Creditor name
-
- if(this._data.creditor.name === undefined){ throw new Error("Creditor name cannot be undefined."); }
- if(typeof this._data.creditor.name !== "string"){ throw new Error("Creditor name must be a string."); }
- if(this._data.creditor.name.length > 70){ throw new Error("Creditor name must be a maximum of 70 characters."); }
-
-
- //-- Creditor Address
-
- if(this._data.creditor.address === undefined){ throw new Error("Creditor address cannot be undefined."); }
- if(typeof this._data.creditor.address !== "string"){ throw new Error("Creditor address must be a string."); }
- if(this._data.creditor.address.length > 70){ throw new Error("Creditor address must be a maximum of 70 characters."); }
-
-
- //-- Creditor houseNumber
-
- if(this._data.creditor.houseNumber !== undefined){
- if(typeof this._data.creditor.houseNumber !== "string" && typeof this._data.creditor.houseNumber !== "number"){ throw new Error("Debtor houseNumber must be either a string or a number."); }
- if(this._data.creditor.houseNumber.toString().length > 16){ throw new Error("Creditor houseNumber can be a maximum of 16 characters."); }
- }
-
-
- //-- Creditor Zip
-
- if(this._data.creditor.zip === undefined){ throw new Error("Creditor zip cannot be undefined."); }
- if(typeof this._data.creditor.zip !== "string" && typeof this._data.creditor.zip !== "number"){ throw new Error("Creditor zip must be either a string or a number."); }
- if(this._data.creditor.zip.toString().length > 16){ throw new Error("Creditor zip must be a maximum of 16 characters."); }
-
-
- //-- Creditor city
-
- if(this._data.creditor.city === undefined){ throw new Error("Creditor city cannot be undefined."); }
- if(typeof this._data.creditor.city !== "string"){ throw new Error("Creditor city must be a string."); }
- if(this._data.creditor.city.length > 35){ throw new Error("Creditor city must be a maximum of 35 characters."); }
-
-
- //-- Creditor country
-
- if(this._data.creditor.country === undefined){ throw new Error("Creditor country cannot be undefined."); }
- if(typeof this._data.creditor.country !== "string"){ throw new Error("Creditor country must be a string."); }
- if(this._data.creditor.country.length !== 2){ throw new Error("Creditor country must be 2 characters."); }
-
-
- //-- Amount
-
- if(this._data.amount !== undefined){
- if(typeof this._data.amount !== "number"){ throw new Error("Amount must be a number."); }
- if(this._data.amount.toFixed(2).toString().length > 12){ throw new Error("Amount must be a maximum of 12 digits."); }
- }
-
-
- //-- Currency
-
- if(this._data.currency === undefined){ throw new Error("Currency cannot be undefined."); }
- if(typeof this._data.currency !== "string"){ throw new Error("Currency must be a string."); }
- if(this._data.currency.length !== 3){ throw new Error("Currency must be a length of 3 characters."); }
- if(this._data.currency !== "CHF" && this._data.currency !== "EUR"){ throw new Error("Currency must be either 'CHF' or 'EUR'"); }
-
-
- //-- Debtor
-
- if(this._data.debtor !== undefined){
-
-
- //-- Debtor name
-
- if(this._data.debtor.name === undefined){ throw new Error("Debtor name cannot be undefined if the debtor object is available."); }
- if(typeof this._data.debtor.name !== "string"){ throw new Error("Debtor name must be a string."); }
- if(this._data.debtor.name.length > 70){ throw new Error("Debtor name must be a maximum of 70 characters."); }
-
-
- //-- Debtor address
-
- if(this._data.debtor.address === undefined){ throw new Error("Debtor address cannot be undefined if the debtor object is available."); }
- if(typeof this._data.debtor.address !== "string"){ throw new Error("Debtor address must be a string."); }
- if(this._data.debtor.address.length > 70){ throw new Error("Debtor address must be a maximum of 70 characters."); }
-
-
- //-- Debtor houseNumber
-
- if(this._data.debtor.houseNumber !== undefined){
- if(typeof this._data.debtor.houseNumber !== "string" && typeof this._data.debtor.houseNumber !== "number"){ throw new Error("Debtor house number must be either a string or a number."); }
- if(this._data.debtor.houseNumber.toString().length > 16){ throw new Error("Debtor house number can be a maximum of 16 characters."); }
- }
-
-
- //-- Debtor zip
-
- if(this._data.debtor.zip === undefined){ throw new Error("Debtor zip cannot be undefined if the debtor object is available."); }
- if(typeof this._data.debtor.zip !== "string" && typeof this._data.debtor.zip !== "number"){ throw new Error("Debtor zip must be either a string or a number."); }
- if(this._data.debtor.zip.toString().length > 16){ throw new Error("Debtor zip must be a maximum of 16 characters."); }
-
-
- //-- Debtor city
-
- if(this._data.debtor.city === undefined){ throw new Error("Debtor city cannot be undefined if the debtor object is available."); }
- if(typeof this._data.debtor.city !== "string"){ throw new Error("Debtor city must be a string."); }
- if(this._data.debtor.city.length > 35){ throw new Error("Debtor city must be a maximum of 35 characters."); }
-
-
- //-- Debtor country
-
- if(this._data.debtor.country === undefined){ throw new Error("Debtor country cannot be undefined if the debtor object is available."); }
- if(typeof this._data.debtor.country !== "string"){ throw new Error("Debtor country must be a string."); }
- if((this._data.debtor.country).length !== 2){ throw new Error("Debtor country must be 2 characters."); }
-
- }
-
-
- //-- Reference
-
- if(this._data.reference !== undefined){
- if(typeof this._data.reference !== "string"){ throw new Error("Reference name must be a string."); }
- if(this._data.reference.length > 27){ throw new Error("Reference name must be a maximum of 27 characters."); }
- }
-
-
- //-- Message
-
- if(this._data.message !== undefined){
- if(this._data.message.length > 140){ throw new Error("Message must be a maximum of 140 characters."); }
- if(typeof this._data.message !== "string"){ throw new Error("Message must be a string."); }
- }
-
-
- //-- Additional information
-
- if(this._data.additionalInformation !== undefined){
- if(this._data.additionalInformation.length > 140){ throw new Error("AdditionalInformation must be a maximum of 140 characters."); }
- if(typeof this._data.additionalInformation !== "string"){ throw new Error("AdditionalInformation must be a string."); }
- }
-
-
- //-- Message + Additional information
-
- if(this._data.message !== undefined && this._data.additionalInformation !== undefined){
- if(this._data.additionalInformation.length + this._data.message.length > 140){ throw new Error("Message and additionalInformation combined must be a maximum of 140 characters."); }
- }
-
-
- //-- AV1
-
- if(this._data.av1 !== undefined){
- if(this._data.av1.length > 100){ throw new Error("AV1 must be a maximum of 100 characters."); }
- if(typeof this._data.av1 !== "string"){ throw new Error("AV1 must be a string."); }
- if(this._data.av1.substr(0, 5) !== "eBill"){
- throw new Error("AV1 must begin with eBill");
- }
- }
-
-
- //-- AV2
-
- if(this._data.av2 !== undefined){
- if(this._data.av2.length > 100){ throw new Error("AV2 must be a maximum of 100 characters."); }
- if(typeof this._data.av2 !== "string"){ throw new Error("AV2 must be a string."); }
- if(this._data.av2.substr(0, 5) !== "eBill"){
- throw new Error("AV2 must begin with eBill");
- }
- }
-
- }
-
-
- private _generateQRCode(): void {
-
- let qrString = "";
-
-
- //-- Swiss Payments Code
-
- qrString += "SPC";
-
-
- //-- Version
-
- qrString += "\n0200";
-
-
- //-- Coding Type UTF-8
-
- qrString += "\n1";
-
-
- //-- IBAN
-
- qrString += "\n" + this._data.creditor.account ?? "\n";
-
-
- //-- Creditor
-
- if(this._data.creditor.houseNumber !== undefined){
-
- // Address Type
- qrString += "\nS";
-
- // Name
- qrString += "\n" + this._data.creditor.name;
-
- // Address
- qrString += "\n" + this._data.creditor.address;
-
- // House number
- qrString += "\n" + this._data.creditor.houseNumber;
-
- // Zip
- qrString += "\n" + this._data.creditor.zip;
-
- // City
- qrString += "\n" + this._data.creditor.city;
-
- } else {
-
- // Address Type
- qrString += "\nK";
-
- // Name
- qrString += "\n" + this._data.creditor.name;
-
- // Address
- qrString += "\n" + this._data.creditor.address;
-
- // Zip + city
- if((this._data.creditor.zip + " " + this._data.creditor.city).length > 70){ throw new Error("Creditor zip plus city must be a maximum of 70 characters."); }
- qrString += "\n" + this._data.creditor.zip + " " + this._data.creditor.city;
-
- // Empty zip field
- qrString += "\n";
-
- // Empty city field
- qrString += "\n";
-
- }
-
- qrString += "\n" + this._data.creditor.country;
-
-
- //-- 7 x empty
-
- qrString += "\n"; // 1
- qrString += "\n"; // 2
- qrString += "\n"; // 3
- qrString += "\n"; // 4
- qrString += "\n"; // 5
- qrString += "\n"; // 6
- qrString += "\n"; // 7
-
-
- //-- Amount
-
- if(this._data.amount !== undefined){
- qrString += "\n" + this._data.amount.toFixed(2);
- } else {
- qrString += "\n";
- }
-
-
- //-- Currency
-
- qrString += "\n" + this._data.currency;
-
-
- //-- Debtor
-
- if(this._data.debtor !== undefined){
- if(this._data.debtor.houseNumber !== undefined){
-
- // Address type
- qrString += "\nS";
-
- // Name
- qrString += "\n" + this._data.debtor.name;
-
- // Address
- qrString += "\n" + this._data.debtor.address;
-
- // House number
- qrString += "\n" + this._data.debtor.houseNumber;
-
- // Zip
- qrString += "\n" + this._data.debtor.zip;
-
- // City
- qrString += "\n" + this._data.debtor.city;
-
- } else {
-
- // Address type
- qrString += "\nK";
-
- // Name
- qrString += "\n" + this._data.debtor.name;
-
- // Address
- qrString += "\n" + this._data.debtor.address;
-
- // Zip + city
- if((this._data.debtor.zip + " " + this._data.debtor.city).length > 70){ throw new Error("Debtor zip plus city must be a maximum of 70 characters."); }
- qrString += "\n" + this._data.debtor.zip + " " + this._data.debtor.city;
-
- // Empty field zip
- qrString += "\n";
-
- // Empty field city
- qrString += "\n";
-
- }
-
- // Country
- qrString += "\n" + this._data.debtor.country;
-
- } else {
-
-
- // Empty field type
- qrString += "\n";
-
- // Empty field name
- qrString += "\n";
-
- // Empty field address
- qrString += "\n";
-
- // Empty field house number
- qrString += "\n";
-
- // Empty field zip
- qrString += "\n";
-
- // Empty field city
- qrString += "\n";
-
- // Empty field country
- qrString += "\n";
-
- }
-
-
- //-- Reference type
-
- qrString += "\n" + this._referenceType;
-
-
- //-- Reference
-
- if(this._data.reference !== undefined){
- qrString += "\n" + this._data.reference;
- } else {
- qrString += "\n";
- }
-
-
- //-- Unstructured message
-
- if(this._data.message !== undefined){
- qrString += "\n" + this._data.message;
- } else {
- qrString += "\n";
- }
-
-
- //-- End Payment Data
-
- qrString += "\n" + "EPD";
-
-
- //-- Additional information
-
- if(this._data.additionalInformation !== undefined){
- qrString += "\n" + this._data.additionalInformation;
- } else {
- qrString += "\n";
- }
-
-
- //-- AV1
-
- if(this._data.av1 !== undefined){
- qrString += "\n" + this._data.av1;
- }
-
- if(this._data.av2 !== undefined){
- qrString += "\n" + this._data.av2;
- }
-
-
- //-- Create QR Code
-
- const qrcodeString = QRCode.toString(qrString, {
- type: "svg",
- width: utils.mmToPoints(46),
- margin: 0,
- errorCorrectionLevel: "M"
- }, () => { }) as unknown as string;
-
- const svgPath = this._getSVGPathFromQRCodeString(qrcodeString);
-
- if(svgPath === undefined){
- throw new Error("Could not convert svg image to path");
- }
-
- this.moveTo(utils.mmToPoints(67), this._marginTop + utils.mmToPoints(17));
-
- this.addPath(svgPath, utils.mmToPoints(67), this._marginTop + utils.mmToPoints(17))
- .undash()
- .fillColor("black")
- .fill();
-
-
- //-- Black rectangle
-
- const background = "M18.3 0.7L1.6 0.7 0.7 0.7 0.7 1.6 0.7 18.3 0.7 19.1 1.6 19.1 18.3 19.1 19.1 19.1 19.1 18.3 19.1 1.6 19.1 0.7Z";
- const cross = "M8.3 4H11.6V15H8.3V4Z M4.4 7.9H15.4V11.2H4.4V7.9Z";
-
- this.addPath(background, utils.mmToPoints(86), this._marginTop + utils.mmToPoints(36))
- .fillColor("black")
- .lineWidth(1.4357)
- .strokeColor("white")
- .fillAndStroke();
-
- this.addPath(cross, utils.mmToPoints(86), this._marginTop + utils.mmToPoints(36))
- .fillColor("white")
- .fill();
-
- }
-
-
- private _getSVGPathFromQRCodeString(qrcodeString: string): string | undefined {
-
- const svgObject = parse(qrcodeString);
-
- if(svgObject.children === undefined){
- return;
- }
-
- firstChildLoop: for(const firstChild of svgObject.children){
-
- if(firstChild.type !== "element"){
- continue firstChildLoop;
- }
-
- secondChildLoop: for(const secondChild of firstChild.children){
-
- if(typeof secondChild !== "object"){
- continue secondChildLoop;
- }
- if(secondChild.type !== "element"){
- continue secondChildLoop;
- }
- if(secondChild.properties === undefined){
- continue secondChildLoop;
- }
- if(secondChild.properties.fill !== "#000000"){
- continue;
- }
- if(secondChild.properties.d === undefined){
- continue secondChildLoop;
- }
- if(typeof secondChild.properties.d !== "string"){
- continue secondChildLoop;
- }
-
- return secondChild.properties.d;
-
- }
-
- }
-
- }
-
-
- public mmToPoints(mm: number): number {
- return utils.mmToPoints(mm);
- }
-
-
- private _formatAddress(data: debtor | creditor): string {
- if(data.houseNumber !== undefined){
- return `${data.name}\n${data.address} ${data.houseNumber}\n${data.zip} ${data.city}`;
- } else {
- return `${data.name}\n${data.address}\n${data.zip} ${data.city}`;
- }
- }
-
-
- private _cleanData(): void {
-
- const _cleanObject = (object: object): void => {
-
- const keys = Object.keys(object);
-
- for(let k = 0; k < keys.length; k++){
- if(typeof object[keys[k]] === "string"){
-
- object[keys[k]] = this._removeLinebreaks(object[keys[k]]);
-
- if(keys[k] === "account"){
- object[keys[k]] = object[keys[k]].replace(/ /g, "");
- }
- if(keys[k] === "reference"){
- object[keys[k]] = object[keys[k]].replace(/ /g, "");
- }
-
- } else {
- if(typeof object[keys[k]] === "object"){
- _cleanObject(object[keys[k]]);
- }
- }
- }
- };
-
- _cleanObject(this._data);
-
- }
-
-
- private _removeLinebreaks(data: string): string {
- return data.replace(/\n/g, "").replace(/\r/g, "");
- }
-
-
- private _formatReference(reference: string): string {
- if(this._referenceType === "QRR"){
- return utils.formatQRReference(reference);
- } else if(this._referenceType === "SCOR"){
- return utils.formatSCORReference(reference);
- }
- return reference;
- }
-
-
- private _drawRectangle(x: number, y: number, width: number, height: number): void {
-
- const length = 3;
-
- this.moveTo(utils.mmToPoints(x + length), this._marginTop + utils.mmToPoints(y))
- .lineTo(utils.mmToPoints(x), this._marginTop + utils.mmToPoints(y))
- .lineTo(utils.mmToPoints(x), this._marginTop + utils.mmToPoints(y + length))
- .moveTo(utils.mmToPoints(x), this._marginTop + utils.mmToPoints(y + height - length))
- .lineTo(utils.mmToPoints(x), this._marginTop + utils.mmToPoints(y + height))
- .lineTo(utils.mmToPoints(x + length), this._marginTop + utils.mmToPoints(y + height))
- .moveTo(utils.mmToPoints(x + width - length), this._marginTop + utils.mmToPoints(y + height))
- .lineTo(utils.mmToPoints(x + width), this._marginTop + utils.mmToPoints(y + height))
- .lineTo(utils.mmToPoints(x + width), this._marginTop + utils.mmToPoints(y + height - length))
- .moveTo(utils.mmToPoints(x + width), this._marginTop + utils.mmToPoints(y + length))
- .lineTo(utils.mmToPoints(x + width), this._marginTop + utils.mmToPoints(y))
- .lineTo(utils.mmToPoints(x + width - length), this._marginTop + utils.mmToPoints(y))
- .lineWidth(.75)
- .undash()
- .strokeColor("black")
- .stroke();
-
- }
-
-}
diff --git a/tests/a4.js b/tests/a4.js
index 96d3945..1d73e48 100644
--- a/tests/a4.js
+++ b/tests/a4.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/a4.pdf", { "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/a4.pdf", { "size": "A4" });
\ No newline at end of file
diff --git a/tests/a6-5-housenumber.js b/tests/a6-5-buildingnumber.js
similarity index 62%
rename from tests/a6-5-housenumber.js
rename to tests/a6-5-buildingnumber.js
index 9d82bf8..15c7226 100644
--- a/tests/a6-5-housenumber.js
+++ b/tests/a6-5-buildingnumber.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -7,7 +8,7 @@ const data = {
creditor: {
name: "Robert Schneider AG",
address: "Rue du Lac",
- houseNumber: 1268,
+ buildingNumber: 1268,
zip: 2501,
city: "Biel",
account: "CH4431999123000889012",
@@ -16,7 +17,7 @@ const data = {
debtor: {
name: "Pia-Maria Rutschmann-Schnyder",
address: "Grosse Marktgasse",
- houseNumber: 28,
+ buildingNumber: 28,
zip: 9400,
city: "Rorschach",
country: "CH"
@@ -24,4 +25,6 @@ const data = {
};
-const pdf = new SwissQRBill.PDF(data, "./output/a6-5-housenumber.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/a6-5-buildingnumber.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/a6-5-buildingnumber.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/a6-5.mjs b/tests/a6-5.mjs
new file mode 100644
index 0000000..a9b2b39
--- /dev/null
+++ b/tests/a6-5.mjs
@@ -0,0 +1,27 @@
+import { PDF, SVG } from "../lib/node/esm/node/index.js";
+import { writeFileSync } from "fs";
+
+const data = {
+ currency: "CHF",
+ amount: 1199.95,
+ reference: "210000000003139471430009017",
+ creditor: {
+ name: "Robert Schneider AG",
+ address: "Rue du Lac 1268",
+ zip: 2501,
+ city: "Biel",
+ account: "CH4431999123000889012",
+ country: "CH"
+ },
+ debtor: {
+ name: "Pia-Maria Rutschmann-Schnyder",
+ address: "Grosse Marktgasse 28",
+ zip: 9400,
+ city: "Rorschach",
+ country: "CH"
+ }
+};
+
+const pdf = new PDF(data, "./output/pdf/a6-5.pdf", { "size": "A6/5" });
+const svg = new SVG(data);
+writeFileSync("./output/svg/a6-5.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/additional-information.js b/tests/additional-information.js
index 23880e4..69f085c 100644
--- a/tests/additional-information.js
+++ b/tests/additional-information.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -22,4 +23,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/additional-information.pdf", { "size": "A6/5" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/additional-information.pdf", { "size": "A6/5" });
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/additional-information.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/av1av2.js b/tests/av1av2.js
index a1e9e3f..25656c9 100644
--- a/tests/av1av2.js
+++ b/tests/av1av2.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -23,4 +24,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/av1av2.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/av1av2.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/av1av2.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/callback-with-options.js b/tests/callback-with-options.js
index 75e0f37..e281202 100644
--- a/tests/callback-with-options.js
+++ b/tests/callback-with-options.js
@@ -21,6 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/callback-with-options.pdf", { "size": "A6/5" }, () => {
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/callback-with-options.pdf", { "size": "A6/5" }, () => {
console.log("File has been successfully created.");
});
\ No newline at end of file
diff --git a/tests/callback.js b/tests/callback.js
index efd46c2..4d315f5 100644
--- a/tests/callback.js
+++ b/tests/callback.js
@@ -21,6 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/callback.pdf", () => {
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/callback.pdf", () => {
console.log("File has been successfully created.");
});
\ No newline at end of file
diff --git a/tests/english.js b/tests/english.js
index ea9ec63..71e8d92 100644
--- a/tests/english.js
+++ b/tests/english.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/english.pdf", { language: "EN" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/english.pdf", { language: "EN" });
+const svg = new SwissQRBill.SVG(data, { language: "EN" });
+writeFileSync("./output/svg/english.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/euro.js b/tests/euro.js
index 7fb51ec..615a174 100644
--- a/tests/euro.js
+++ b/tests/euro.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "EUR",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/euro.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/euro.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/euro.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/event.js b/tests/event.js
index 0480e9a..67706d3 100644
--- a/tests/event.js
+++ b/tests/event.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,7 +22,7 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/event.pdf");
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/event.pdf");
pdf.on("finish", () => {
console.log("File has been successfully created.");
diff --git a/tests/french.js b/tests/french.js
index 3fe0579..97cd461 100644
--- a/tests/french.js
+++ b/tests/french.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/french.pdf", { language: "FR" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/french.pdf", { language: "FR" });
+const svg = new SwissQRBill.SVG(data, { language: "FR" });
+writeFileSync("./output/svg/french.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/index.html b/tests/index.html
new file mode 100644
index 0000000..6ee121b
--- /dev/null
+++ b/tests/index.html
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+ Browser
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/tests/italian.js b/tests/italian.js
index 1e28c51..9e0fb66 100644
--- a/tests/italian.js
+++ b/tests/italian.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/italian.pdf", { language: "IT" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/italian.pdf", { language: "IT" });
+const svg = new SwissQRBill.SVG(data, { language: "IT" });
+writeFileSync("./output/svg/italian.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/message-additional-information.js b/tests/message-additional-information.js
index eb61d3e..4e4b336 100644
--- a/tests/message-additional-information.js
+++ b/tests/message-additional-information.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -23,4 +24,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/message-additional-information.pdf", { "size": "A6/5" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/message-additional-information.pdf", { "size": "A6/5" });
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/message-additional-information.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/message.js b/tests/message.js
index b9ffd3d..083f59d 100644
--- a/tests/message.js
+++ b/tests/message.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -22,4 +23,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/message.pdf", { "size": "A6/5" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/message.pdf", { "size": "A6/5" });
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/message.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/multipage.js b/tests/multipage.js
index aa14b81..408d127 100644
--- a/tests/multipage.js
+++ b/tests/multipage.js
@@ -21,28 +21,28 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/multipage.pdf", { "autoGenerate": false, "size": "A4" });
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/multipage.pdf", { "autoGenerate": false, "size": "A4" });
pdf.fontSize(11);
pdf.font("Helvetica-Bold");
-pdf.text("PAGE 1", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
+pdf.text("PAGE 1", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
});
pdf.addPage();
-pdf.text("PAGE 2", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
+pdf.text("PAGE 2", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
});
pdf.addPage();
-pdf.text("PAGE 3", SwissQRBill.utils.mmToPoints(5), SwissQRBill.utils.mmToPoints(20), {
- width: SwissQRBill.utils.mmToPoints(210),
- align: "center",
+pdf.text("PAGE 3", SwissQRBill.utils.mm2pt(5), SwissQRBill.utils.mm2pt(20), {
+ width: SwissQRBill.utils.mm2pt(210),
+ align: "center"
});
pdf.addQRBill();
diff --git a/tests/no-amount.js b/tests/no-amount.js
index b243ece..abe9791 100644
--- a/tests/no-amount.js
+++ b/tests/no-amount.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -20,4 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-amount.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-amount.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-amount.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-debtor-no-amount-no-reference.js b/tests/no-debtor-no-amount-no-reference.js
index 12ab444..6116d90 100644
--- a/tests/no-debtor-no-amount-no-reference.js
+++ b/tests/no-debtor-no-amount-no-reference.js
@@ -1,15 +1,20 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
+ av1: "eBillUV;UltraPay005;12345",
+ av2: "eBillXY;XYService;54321",
creditor: {
- name: "Robert Schneider AG",
- address: "Rue du Lac 1268",
+ name: "Robert Schneider ultra long name of the company to use multiple lines",
+ address: "Rue du Lac 1268 Ultra long address nam eto use multiple lines",
zip: 2501,
- city: "Biel",
+ city: "Zug ultra long city name multi line",
account: "CH5800791123000889012",
country: "CH"
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-debtor-no-amount-no-reference.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-debtor-no-amount-no-reference.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-debtor-no-amount-no-reference.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-debtor-no-amount.js b/tests/no-debtor-no-amount.js
index a3e5bfa..2aeca7f 100644
--- a/tests/no-debtor-no-amount.js
+++ b/tests/no-debtor-no-amount.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -13,4 +14,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-debtor-no-amount.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-debtor-no-amount.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-debtor-no-amount.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-debtor-no-reference.js b/tests/no-debtor-no-reference.js
index 74363d4..d6710c6 100644
--- a/tests/no-debtor-no-reference.js
+++ b/tests/no-debtor-no-reference.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -13,4 +14,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-debtor-no-reference.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-debtor-no-reference.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-debtor-no-reference.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-debtor.js b/tests/no-debtor.js
index 5013cf5..ec9e7dd 100644
--- a/tests/no-debtor.js
+++ b/tests/no-debtor.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -14,4 +15,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-debtor.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-debtor.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-debtor.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-reference-message.js b/tests/no-reference-message.js
index 431b355..7358be9 100644
--- a/tests/no-reference-message.js
+++ b/tests/no-reference-message.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-reference-message.pdf", { "size": "A6/5" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-reference-message.pdf", { "size": "A6/5" });
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/no-reference-message.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/no-scissors-no-outlines.js b/tests/no-scissors-no-outlines.js
index d5026be..f47e9ff 100644
--- a/tests/no-scissors-no-outlines.js
+++ b/tests/no-scissors-no-outlines.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-scissors-no-outline.pdf", { "scissors" : false, "outlines": false, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-scissors-no-outline.pdf", { "scissors" : false, "outlines": false, "size": "A4" });
\ No newline at end of file
diff --git a/tests/no-scissors-no-separate-no-outlines.js b/tests/no-scissors-no-separate-no-outlines.js
index 0f310ab..3c753e9 100644
--- a/tests/no-scissors-no-separate-no-outlines.js
+++ b/tests/no-scissors-no-separate-no-outlines.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-scissors-no-separate-no-outline.pdf", { "scissors" : false, "separate": false, "outlines": false, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-scissors-no-separate-no-outline.pdf", { "scissors" : false, "separate": false, "outlines": false, "size": "A4" });
\ No newline at end of file
diff --git a/tests/no-scissors-no-separate.js b/tests/no-scissors-no-separate.js
index 9ab998f..6ffb9a7 100644
--- a/tests/no-scissors-no-separate.js
+++ b/tests/no-scissors-no-separate.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-scissors-no-separate.pdf", { "scissors" : false, "separate": false, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-scissors-no-separate.pdf", { "scissors" : false, "separate": false, "size": "A4" });
\ No newline at end of file
diff --git a/tests/no-scissors.js b/tests/no-scissors.js
index 4707bed..330c91f 100644
--- a/tests/no-scissors.js
+++ b/tests/no-scissors.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-scissors.pdf", { "scissors" : false, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-scissors.pdf", { "scissors" : false, "size": "A4" });
\ No newline at end of file
diff --git a/tests/no-separate-no-outlines.js b/tests/no-separate-no-outlines.js
index 61e56b5..6f6eea3 100644
--- a/tests/no-separate-no-outlines.js
+++ b/tests/no-separate-no-outlines.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/no-separate-no-outline.pdf", { "separate" : false, "outlines": false, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/no-separate-no-outline.pdf", { "separate" : false, "outlines": false, "size": "A4" });
\ No newline at end of file
diff --git a/tests/normal-iban-creditor-reference.js b/tests/normal-iban-creditor-reference.js
index 00c364f..f10ed07 100644
--- a/tests/normal-iban-creditor-reference.js
+++ b/tests/normal-iban-creditor-reference.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -20,4 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/normal-iban.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/normal-iban.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/normal-iban.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/normal-iban-no-reference.js b/tests/normal-iban-no-reference.js
index 4b7e442..d36aae9 100644
--- a/tests/normal-iban-no-reference.js
+++ b/tests/normal-iban-no-reference.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/normal-iban.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/normal-iban-no-reference.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/normal-iban-no-reference.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/not-enough-space-a4.js b/tests/not-enough-space-a4.js
index 5035171..5ddd4bc 100644
--- a/tests/not-enough-space-a4.js
+++ b/tests/not-enough-space-a4.js
@@ -21,13 +21,13 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/not-enough-space-a4.pdf", { "autoGenerate": false, "size": "A4" });
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/not-enough-space-a4.pdf", { "autoGenerate": false, "size": "A4" });
pdf.fontSize(11);
pdf.font("Helvetica-Bold");
-pdf.text("PAGE 1", SwissQRBill.utils.mmToPoints(5), pdf.page.height - 50, {
- width: SwissQRBill.utils.mmToPoints(210),
+pdf.text("PAGE 1", SwissQRBill.utils.mm2pt(5), pdf.page.height - 50, {
+ width: SwissQRBill.utils.mm2pt(210),
align: "center"
});
diff --git a/tests/not-enough-space.js b/tests/not-enough-space.js
index 969378f..a5dd66a 100644
--- a/tests/not-enough-space.js
+++ b/tests/not-enough-space.js
@@ -21,13 +21,13 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/not-enough-space.pdf", { "autoGenerate": false, "size": "A4" });
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/not-enough-space.pdf", { "autoGenerate": false, "size": "A4" });
pdf.fontSize(11);
pdf.font("Helvetica-Bold");
-pdf.text("PAGE 1", SwissQRBill.utils.mmToPoints(5), pdf.page.height - 50, {
- width: SwissQRBill.utils.mmToPoints(210),
+pdf.text("PAGE 1", SwissQRBill.utils.mm2pt(5), pdf.page.height - 50, {
+ width: SwissQRBill.utils.mm2pt(210),
align: "center"
});
diff --git a/tests/qr-iban.js b/tests/qr-iban.js
index ab67d06..84ea7b7 100644
--- a/tests/qr-iban.js
+++ b/tests/qr-iban.js
@@ -1,4 +1,5 @@
const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -21,4 +22,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/qr-iban.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/qr-iban.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/qr-iban.svg", svg.toString());
\ No newline at end of file
diff --git a/tests/run-windows.bat b/tests/run-windows.bat
deleted file mode 100644
index 6f181e6..0000000
--- a/tests/run-windows.bat
+++ /dev/null
@@ -1,73 +0,0 @@
-if not exist output mkdir output
-echo "utils"
- call node utils
-echo "a4"
- call node a4
-echo "a6-5"
- call node a6-5
-echo "a6-5-housenmuber"
- call node a6-5-housenumber
-echo "av1av2"
- call node av1av2
-echo "english"
- call node english
-echo "euro"
- call node euro
-echo "french"
- call node french
-echo "italian"
- call node italian
-echo "message"
- call message
-echo "no-reference-message"
- call no-reference-message
-echo "message-additional-information"
- call message-additional-information
-echo "additional-information"
- call additional-information
-echo "multipage"
- call node multipage
-echo "no-amount"
- call node no-amount
-echo "no-debtor"
- call node no-debtor
-echo "no-debtor-no-amount"
- call node no-debtor-no-amount
-echo "no-debtor-no-amount-no-reference"
- call node no-debtor-no-amount-no-reference
-echo "no-debtor-no-reference"
- call node no-debtor-no-reference
-echo "normal-iban-creditor-reference"
- call node normal-iban-creditor-reference
-echo "normal-iban-no-reference"
- call node normal-iban-no-reference
-echo "not-enough-space"
- call node not-enough-space
-echo "not-enough-space-a4"
- call node not-enough-space-a4
-echo "no-scissors"
- call node no-scissors
-echo "no-scissors-no-outlines"
- call node no-scissors-no-outlines
-echo "no-scissors-no-separate"
- call node no-scissors-no-separate
-echo "no-separate-no-outlines"
- call node no-separate-no-outlines
-echo "no-scissors-no-separate-no-outlines"
- call node no-scissors-no-separate-no-outlines
-echo "qr-iban"
- call node qr-iban
-echo "separate"
- call node separate
-echo "separate-scissors"
- call node separate-scissors
-echo "callback"
- call node callback
-echo "callback-with-options"
- call node callback-with-options
-echo "event"
- call node event
-echo "stream"
- call node stream
-echo "zip-string"
-call node zip-string
\ No newline at end of file
diff --git a/tests/run.sh b/tests/run.sh
index 4d3336b..81194ad 100644
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -1,5 +1,7 @@
#!/bin/sh
mkdir -p output
+mkdir -p output/pdf
+mkdir -p output/svg
set -e
@@ -8,9 +10,9 @@ echo "utils"
echo "a4"
node a4
echo "a6-5"
- node a6-5
+ node a6-5.mjs
echo "a6-5-housenmuber"
- node a6-5-housenumber
+ node a6-5-buildingnumber
echo "av1av2"
node av1av2
echo "english"
diff --git a/tests/separate-scissors.js b/tests/separate-scissors.js
index 3eb7937..4273e16 100644
--- a/tests/separate-scissors.js
+++ b/tests/separate-scissors.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/separate-scissors.pdf", { "separate" : true, "scissors": true, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/separate-scissors.pdf", { "separate" : true, "scissors": true, "size": "A4" });
\ No newline at end of file
diff --git a/tests/separate.js b/tests/separate.js
index 97455fa..e702b82 100644
--- a/tests/separate.js
+++ b/tests/separate.js
@@ -21,4 +21,4 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/separate.pdf", { "separate" : true, "size": "A4" });
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/separate.pdf", { "separate" : true, "size": "A4" });
\ No newline at end of file
diff --git a/tests/stream.js b/tests/stream.js
index 96d347b..b6250c7 100644
--- a/tests/stream.js
+++ b/tests/stream.js
@@ -22,5 +22,5 @@ const data = {
}
};
-const stream = fs.createWriteStream("./output/stream.pdf");
+const stream = fs.createWriteStream("./output/pdf/stream.pdf");
const pdf = new SwissQRBill.PDF(data, stream, { "size": "A6/5" });
\ No newline at end of file
diff --git a/tests/zip-string.js b/tests/zip-string.js
index fc6ac4c..07628c6 100644
--- a/tests/zip-string.js
+++ b/tests/zip-string.js
@@ -1,4 +1,5 @@
-const SwissQRBill = require("../lib/node");
+const SwissQRBill = require("../");
+const { writeFileSync } = require("fs");
const data = {
currency: "CHF",
@@ -20,4 +21,6 @@ const data = {
}
};
-const pdf = new SwissQRBill.PDF(data, "./output/zip-string.pdf");
\ No newline at end of file
+const pdf = new SwissQRBill.PDF(data, "./output/pdf/zip-string.pdf");
+const svg = new SwissQRBill.SVG(data);
+writeFileSync("./output/svg/zip-string.svg", svg.toString());
\ No newline at end of file
diff --git a/tsconfig.browser.esm.json b/tsconfig.browser.esm.json
new file mode 100644
index 0000000..015cabc
--- /dev/null
+++ b/tsconfig.browser.esm.json
@@ -0,0 +1,15 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "declaration": true,
+ "outDir": "./lib/browser/esm",
+ "module": "esnext",
+ "target": "esnext"
+ },
+ "include": ["src/browser/index.ts"],
+ "exclude": [
+ "lib/",
+ "src/browser/bundle.ts",
+ "src/node/"
+ ]
+}
\ No newline at end of file
diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json
new file mode 100644
index 0000000..3b7cbc3
--- /dev/null
+++ b/tsconfig.cjs.json
@@ -0,0 +1,14 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "declaration": true,
+ "outDir": "./lib/node/cjs",
+ "module": "CommonJS",
+ "target": "ES6"
+ },
+ "include": ["src"],
+ "exclude": [
+ "lib/",
+ "src/browser/"
+ ]
+}
\ No newline at end of file
diff --git a/tsconfig.esm.json b/tsconfig.esm.json
new file mode 100644
index 0000000..8d05a98
--- /dev/null
+++ b/tsconfig.esm.json
@@ -0,0 +1,14 @@
+{
+ "extends": "./tsconfig.json",
+ "compilerOptions": {
+ "declaration": true,
+ "outDir": "./lib/node/esm",
+ "module": "esnext",
+ "target": "esnext"
+ },
+ "include": ["src"],
+ "exclude": [
+ "lib/",
+ "src/browser/"
+ ]
+}
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
index eee8c03..d60ce1a 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -1,15 +1,21 @@
{
"compilerOptions": {
"target": "ES6",
- "lib": ["ES6", "DOM"],
- "module": "commonjs",
+ "lib": ["ES2020", "DOM"],
+ "module": "ESNext",
+ "moduleResolution": "Node",
"sourceMap": true,
- "declaration": true,
- "outDir": "./lib",
+ "declaration": false,
"strict": true,
"noImplicitAny": false,
- "esModuleInterop": true
+ "esModuleInterop": true,
},
- "include": ["src"],
- "exclude": ["node_modules", "./src/browser.ts"]
+ "include": [
+ "src"
+ ],
+ "exclude": [
+ "node_modules",
+ "src/browser",
+ "lib"
+ ]
}
\ No newline at end of file
diff --git a/webpack.config.js b/webpack.config.js
index 6a4ec86..07180a2 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -1,33 +1,72 @@
const webpack = require("webpack");
module.exports = {
- entry: "./src/browser.ts",
+ entry: "./src/browser/bundle.ts",
+ target: "web",
module: {
rules: [
{
- test: /\.tsx?$/,
+ test: /\.(js|ts)?$/,
use: "ts-loader",
- exclude: /node_modules/,
+ exclude: /node_modules/
},
- ],
+ // bundle and load afm files verbatim
+ {
+ test: /\.afm$/,
+ type: "asset/source"
+ },
+ // convert to base64 and include inline file system binary files used by fontkit and linebreak
+ {
+ enforce: "post",
+ test: /fontkit[/\\]index.js$/,
+ loader: "transform-loader",
+ options: {
+ brfs: {}
+ }
+ },
+ {
+ enforce: "post",
+ test: /linebreak[/\\]src[/\\]linebreaker.js/,
+ loader: "transform-loader",
+ options: {
+ brfs: {}
+ }
+ }
+ ]
},
devtool: "inline-source-map",
resolve: {
- extensions: [ ".tsx", ".ts", ".js" ],
+ extensions: [".tsx", ".ts", ".js"],
+ alias: {
+ // maps fs to a virtual one allowing to register file content dynamically
+ fs: "pdfkit/js/virtual-fs.js",
+ // iconv-lite is used to load cid less fonts (not spec compliant)
+ "iconv-lite": false
+ },
fallback: {
- "stream": require.resolve("stream-browserify"),
- "util": require.resolve("util"),
- "buffer": require.resolve("buffer")
+ crypto: false,
+ stream: require.resolve("readable-stream"),
+ util: require.resolve("util"),
+ buffer: require.resolve("buffer"),
+ zlib: require.resolve("browserify-zlib"),
+ assert: require.resolve("assert/")
}
},
plugins: [
new webpack.ProvidePlugin({
process: "process/browser",
+ Buffer: ["buffer", "Buffer"]
}),
+ new webpack.NormalModuleReplacementPlugin(new RegExp(/\.js$/), function(resource) {
+ if(resource.context.includes("node_modules") !== true){
+ resource.request = resource.request.replace(".js", "");
+ }
+ })
],
output: {
- filename: "browser.js",
- path: __dirname + "/lib",
- libraryTarget: "umd"
- },
+ filename: "index.js",
+ path: __dirname + "/lib/browser/bundle/",
+ libraryTarget: "umd",
+ library: "SwissQRBill"
+ }
};
\ No newline at end of file