summaryrefslogtreecommitdiff
path: root/includes/external/school/node_modules/string-collapse-leading-whitespace
diff options
context:
space:
mode:
Diffstat (limited to 'includes/external/school/node_modules/string-collapse-leading-whitespace')
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/CHANGELOG.md97
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/LICENSE22
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/README.md70
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.cjs.js88
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.dev.umd.js125
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.esm.js82
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.umd.js10
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/examples/_quickTake.js20
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/examples/api.json1
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/package.json121
-rw-r--r--includes/external/school/node_modules/string-collapse-leading-whitespace/types/index.d.ts4
11 files changed, 640 insertions, 0 deletions
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/CHANGELOG.md b/includes/external/school/node_modules/string-collapse-leading-whitespace/CHANGELOG.md
new file mode 100644
index 0000000..fb58cc7
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/CHANGELOG.md
@@ -0,0 +1,97 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+## 5.1.0 (2021-05-24)
+
+### Features
+
+- config file based major bump blacklisting ([e15f9bb](https://github.com/codsen/codsen/commit/e15f9bba1c4fd5f847ac28b3f38fa6ee633f5dca))
+
+## 5.0.15 (2021-04-11)
+
+### Reverts
+
+- Revert "chore: setup refresh" ([23cf206](https://github.com/codsen/codsen/commit/23cf206970a087ff0fa04e61f94d919f59ab3881))
+
+## 5.0.1 (2021-01-28)
+
+### Bug Fixes
+
+- add testStats to npmignore ([f3c84e9](https://github.com/codsen/codsen/commit/f3c84e95afc5514214312f913692d85b2e12eb29))
+
+## 5.0.0 (2021-01-23)
+
+### Features
+
+- rewrite in TS, start using named exports ([a92b9e8](https://github.com/codsen/codsen/commit/a92b9e8f55554eb440e8adac31c34dbdb904d747))
+
+### BREAKING CHANGES
+
+- previously you'd consume like: `import collWhitespace from ...` - now consume like `import { collWhitespace } from ...`
+
+## 4.0.0 (2020-11-28)
+
+Accidental version bump during migration to sourcehut. Sorry about that.
+
+## 3.0.0 (2020-09-24)
+
+### Features
+
+- properly treat all kinds of line endings ([aa197c2](https://gitlab.com/codsen/codsen/commit/aa197c22315f748ee3a4719d9a815af0963f72fd))
+
+### BREAKING CHANGES
+
+- it's a fix to support Windows line endings, CRLF, but no changes API-wise
+
+## 2.0.0 (2019-09-14)
+
+### Features
+
+- keep raw non-breaking spaces, gather line breaks and non-breaking spaces ([fae52f8](https://gitlab.com/codsen/codsen/commit/fae52f8))
+
+### BREAKING CHANGES
+
+- Nonbreaking spaces are not removed any more
+
+## 1.12.0 (2019-01-20)
+
+- ✨ Various documentation and setup tweaks after we migrated to monorepo
+- ✨ Setup refresh: updated dependencies and all config files using automated tools
+
+## 1.6.0 (2018-12-26)
+
+- ✨ Add the second argument - originalLimitLinebreaksCount - max ceiling count of consecutive line breaks ([74e2458](https://gitlab.com/codsen/codsen/tree/master/packages/string-collapse-leading-whitespace/commits/74e2458))
+
+## 1.5.0 (2018-10-25)
+
+- ✨ Updated all dependencies
+- ✨ Restored coveralls.io reporting
+- ✨ Restored unit test linting
+
+## 1.4.0 (2018-07-03)
+
+- ✨ Second argument - `originalLimitLinebreaksCount` - let's you override previous default of `1` max line break. Whatever natural number is set here, that many, maximum, linebreaks will be put instead of a whitespace (if that whitespace contains that many at the first place). Practically, we need this to allow empty lines in ranges- class libraries' output. Previously all leading/trailing whitespace was capped to single linebreak and to produce a single empty line we need to consecutive line breaks. This release allows that.
+
+## 1.3.0 (2018-06-29)
+
+- ✨ Set up Rollup to remove comments from the code
+
+## 1.2.0 (2018-06-16)
+
+GitHub sold us out. In the meantime, we:
+
+- ✨ Migrated to BitBucket (to host repo + perform CI) and Codacy (for code quality audit)
+- ✨ Dropped BitHound (RIP) and Travis
+
+## 1.1.0 (2018-05-26)
+
+- ✨ Set up [Prettier](https://prettier.io) on a custom ESLint rule set.
+- ✨ Removed `package.lock` and `.editorconfig`
+- ✨ Wired Rollup to remove comments from non-dev builds. This means we can now leave the `console.log`s in the source code — there's no need to comment-out `console.log` statements or care about them not spilling into production. Now it's done automatically.
+- ✨ Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed. This is important because now code coverage is real again and now there are no excuses not to perfect it.
+
+## 1.0.0 (2018-01-18)
+
+- ✨ First public release
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/LICENSE b/includes/external/school/node_modules/string-collapse-leading-whitespace/LICENSE
new file mode 100644
index 0000000..9ea205b
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/LICENSE
@@ -0,0 +1,22 @@
+MIT License
+
+Copyright (c) 2010-%YEAR% Roy Revelt and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/README.md b/includes/external/school/node_modules/string-collapse-leading-whitespace/README.md
new file mode 100644
index 0000000..98cb999
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/README.md
@@ -0,0 +1,70 @@
+# string-collapse-leading-whitespace
+
+> Collapse the leading and trailing whitespace of a string
+
+<div class="package-badges">
+ <a href="https://www.npmjs.com/package/string-collapse-leading-whitespace" rel="nofollow noreferrer noopener">
+ <img src="https://img.shields.io/badge/-npm-blue?style=flat-square" alt="page on npm">
+ </a>
+ <a href="https://codsen.com/os/string-collapse-leading-whitespace" rel="nofollow noreferrer noopener">
+ <img src="https://img.shields.io/badge/-codsen-blue?style=flat-square" alt="page on codsen.com">
+ </a>
+ <a href="https://github.com/codsen/codsen/tree/main/packages/string-collapse-leading-whitespace" rel="nofollow noreferrer noopener">
+ <img src="https://img.shields.io/badge/-github-blue?style=flat-square" alt="page on github">
+ </a>
+ <a href="https://npmcharts.com/compare/string-collapse-leading-whitespace?interval=30" rel="nofollow noreferrer noopener" target="_blank">
+ <img src="https://img.shields.io/npm/dm/string-collapse-leading-whitespace.svg?style=flat-square" alt="Downloads per month">
+ </a>
+ <a href="https://prettier.io" rel="nofollow noreferrer noopener" target="_blank">
+ <img src="https://img.shields.io/badge/code_style-prettier-brightgreen.svg?style=flat-square" alt="Code style: prettier">
+ </a>
+ <img src="https://img.shields.io/badge/licence-MIT-brightgreen.svg?style=flat-square" alt="MIT License">
+ <a href="https://liberamanifesto.com" rel="nofollow noreferrer noopener" target="_blank">
+ <img src="https://img.shields.io/badge/libera-manifesto-lightgrey.svg?style=flat-square" alt="libera manifesto">
+ </a>
+</div>
+
+## Install
+
+```bash
+npm i string-collapse-leading-whitespace
+```
+
+## Quick Take
+
+```js
+import { strict as assert } from "assert";
+import { collWhitespace } from "string-collapse-leading-whitespace";
+
+// if leading/trailing whitespace doesn't contain \n, collapse to a single space
+assert.equal(collWhitespace(" aaa "), " aaa ");
+
+// otherwise, collapse to a single \n (default setting)
+assert.equal(collWhitespace(" \n\n aaa \n\n\n "), "\naaa\n");
+
+// does nothing to trimmed strings:
+assert.equal(collWhitespace("aaa"), "aaa");
+
+// if there are multiple lines string is still processed in trim-fashion -
+// only beginning and ending whitespace is changed:
+assert.equal(
+ collWhitespace(" abc \n def \n ghi "),
+ " abc \n def \n ghi "
+);
+```
+
+## Documentation
+
+Please [visit codsen.com](https://codsen.com/os/string-collapse-leading-whitespace/) for a full description of the API and examples.
+
+## Contributing
+
+To report bugs or request features or assistance, [raise an issue](https://github.com/codsen/codsen/issues/new/choose) on GitHub.
+
+## Licence
+
+MIT License
+
+Copyright (c) 2010-2021 Roy Revelt and other contributors
+
+<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.cjs.js b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.cjs.js
new file mode 100644
index 0000000..bc61686
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.cjs.js
@@ -0,0 +1,88 @@
+/**
+ * @name string-collapse-leading-whitespace
+ * @fileoverview Collapse the leading and trailing whitespace of a string
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
+ */
+
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var version$1 = "5.1.0";
+
+var version = version$1;
+function collWhitespace(str) {
+ var originallineBreakLimit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
+ var rawNbsp = "\xA0";
+ function reverse(s) {
+ return Array.from(s).reverse().join("");
+ }
+ function prep(whitespaceChunk, limit, trailing) {
+ var firstBreakChar = trailing ? "\n" : "\r";
+ var secondBreakChar = trailing ? "\r" : "\n";
+ if (!whitespaceChunk) {
+ return whitespaceChunk;
+ }
+ var crlfCount = 0;
+ var res = "";
+ for (var i = 0, len = whitespaceChunk.length; i < len; i++) {
+ if (whitespaceChunk[i] === firstBreakChar || whitespaceChunk[i] === secondBreakChar && whitespaceChunk[i - 1] !== firstBreakChar) {
+ crlfCount++;
+ }
+ if ("\r\n".includes(whitespaceChunk[i]) || whitespaceChunk[i] === rawNbsp) {
+ if (whitespaceChunk[i] === rawNbsp) {
+ res += whitespaceChunk[i];
+ } else if (whitespaceChunk[i] === firstBreakChar) {
+ if (crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ if (whitespaceChunk[i + 1] === secondBreakChar) {
+ res += whitespaceChunk[i + 1];
+ i++;
+ }
+ }
+ } else if (whitespaceChunk[i] === secondBreakChar && (!whitespaceChunk[i - 1] || whitespaceChunk[i - 1] !== firstBreakChar) && crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ }
+ } else {
+ if (!whitespaceChunk[i + 1] && !crlfCount) {
+ res += " ";
+ }
+ }
+ }
+ return res;
+ }
+ if (typeof str === "string" && str.length) {
+ var lineBreakLimit = 1;
+ if (typeof +originallineBreakLimit === "number" && Number.isInteger(+originallineBreakLimit) && +originallineBreakLimit >= 0) {
+ lineBreakLimit = +originallineBreakLimit;
+ }
+ var frontPart = "";
+ var endPart = "";
+ if (!str.trim()) {
+ frontPart = str;
+ } else if (!str[0].trim()) {
+ for (var i = 0, len = str.length; i < len; i++) {
+ if (str[i].trim()) {
+ frontPart = str.slice(0, i);
+ break;
+ }
+ }
+ }
+ if (str.trim() && (str.slice(-1).trim() === "" || str.slice(-1) === rawNbsp)) {
+ for (var _i = str.length; _i--;) {
+ if (str[_i].trim()) {
+ endPart = str.slice(_i + 1);
+ break;
+ }
+ }
+ }
+ return "".concat(prep(frontPart, lineBreakLimit, false)).concat(str.trim()).concat(reverse(prep(reverse(endPart), lineBreakLimit, true)));
+ }
+ return str;
+}
+
+exports.collWhitespace = collWhitespace;
+exports.version = version;
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.dev.umd.js b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.dev.umd.js
new file mode 100644
index 0000000..5774a31
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.dev.umd.js
@@ -0,0 +1,125 @@
+/**
+ * @name string-collapse-leading-whitespace
+ * @fileoverview Collapse the leading and trailing whitespace of a string
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
+ */
+
+(function (global, factory) {
+typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
+typeof define === 'function' && define.amd ? define(['exports'], factory) :
+(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.stringCollapseLeadingWhitespace = {}));
+}(this, (function (exports) { 'use strict';
+
+var version$1 = "5.1.0";
+
+const version = version$1;
+function collWhitespace(str, originallineBreakLimit = 1) {
+ const rawNbsp = "\u00A0";
+ // helpers
+ function reverse(s) {
+ return Array.from(s).reverse().join("");
+ }
+ // replaces the leading/trailing whitespace chunks with final strings
+ function prep(whitespaceChunk, limit, trailing) {
+ // when processing the leading whitespace, it's \n\r --- CR - LF
+ // when processing the trailing whitespace, we're processing inverted order,
+ // so it's \n\r --- LF - CR
+ // for this reason, we set first and second linebreak according to direction,
+ // the "trailing" boolean:
+ const firstBreakChar = trailing ? "\n" : "\r";
+ const secondBreakChar = trailing ? "\r" : "\n";
+ if (!whitespaceChunk) {
+ return whitespaceChunk;
+ }
+ let crlfCount = 0;
+ let res = "";
+ // let beginning = true;
+ for (let i = 0, len = whitespaceChunk.length; i < len; i++) {
+ if (whitespaceChunk[i] === firstBreakChar ||
+ (whitespaceChunk[i] === secondBreakChar &&
+ whitespaceChunk[i - 1] !== firstBreakChar)) {
+ crlfCount++;
+ }
+ if (`\r\n`.includes(whitespaceChunk[i]) ||
+ whitespaceChunk[i] === rawNbsp) {
+ if (whitespaceChunk[i] === rawNbsp) {
+ res += whitespaceChunk[i];
+ }
+ else if (whitespaceChunk[i] === firstBreakChar) {
+ if (crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ if (whitespaceChunk[i + 1] === secondBreakChar) {
+ res += whitespaceChunk[i + 1];
+ i++;
+ }
+ }
+ }
+ else if (whitespaceChunk[i] === secondBreakChar &&
+ (!whitespaceChunk[i - 1] ||
+ whitespaceChunk[i - 1] !== firstBreakChar) &&
+ crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ }
+ }
+ else {
+ if (!whitespaceChunk[i + 1] && !crlfCount) {
+ res += " ";
+ }
+ }
+ }
+ return res;
+ }
+ if (typeof str === "string" && str.length) {
+ // without a fuss, set the max allowed line breaks as a leading/trailing whitespace:
+ let lineBreakLimit = 1;
+ if (typeof +originallineBreakLimit === "number" &&
+ Number.isInteger(+originallineBreakLimit) &&
+ +originallineBreakLimit >= 0) {
+ lineBreakLimit = +originallineBreakLimit;
+ }
+ // plan: extract what would String.prototype() would remove, front and back parts
+ let frontPart = "";
+ let endPart = "";
+ if (!str.trim()) {
+ frontPart = str;
+ }
+ else if (!str[0].trim()) {
+ for (let i = 0, len = str.length; i < len; i++) {
+ if (str[i].trim()) {
+ frontPart = str.slice(0, i);
+ break;
+ }
+ }
+ }
+ // if whole string is whitespace, endPart is empty string
+ if (str.trim() &&
+ (str.slice(-1).trim() === "" || str.slice(-1) === rawNbsp)) {
+ for (let i = str.length; i--;) {
+ // console.log(
+ // `${`\u001b[${36}m${`----------------------------------------------\niterating through: ${JSON.stringify(
+ // str[i],
+ // null,
+ // 4
+ // )}`}\u001b[${39}m`}`
+ // );
+ if (str[i].trim()) {
+ endPart = str.slice(i + 1);
+ break;
+ }
+ }
+ }
+ // -------------------------------------------------------------------------
+ return `${prep(frontPart, lineBreakLimit, false)}${str.trim()}${reverse(prep(reverse(endPart), lineBreakLimit, true))}`;
+ }
+ return str;
+}
+
+exports.collWhitespace = collWhitespace;
+exports.version = version;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.esm.js b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.esm.js
new file mode 100644
index 0000000..e1dd34f
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.esm.js
@@ -0,0 +1,82 @@
+/**
+ * @name string-collapse-leading-whitespace
+ * @fileoverview Collapse the leading and trailing whitespace of a string
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
+ */
+
+var version$1 = "5.1.0";
+
+const version = version$1;
+function collWhitespace(str, originallineBreakLimit = 1) {
+ const rawNbsp = "\u00A0";
+ function reverse(s) {
+ return Array.from(s).reverse().join("");
+ }
+ function prep(whitespaceChunk, limit, trailing) {
+ const firstBreakChar = trailing ? "\n" : "\r";
+ const secondBreakChar = trailing ? "\r" : "\n";
+ if (!whitespaceChunk) {
+ return whitespaceChunk;
+ }
+ let crlfCount = 0;
+ let res = "";
+ for (let i = 0, len = whitespaceChunk.length; i < len; i++) {
+ if (whitespaceChunk[i] === firstBreakChar || whitespaceChunk[i] === secondBreakChar && whitespaceChunk[i - 1] !== firstBreakChar) {
+ crlfCount++;
+ }
+ if (`\r\n`.includes(whitespaceChunk[i]) || whitespaceChunk[i] === rawNbsp) {
+ if (whitespaceChunk[i] === rawNbsp) {
+ res += whitespaceChunk[i];
+ } else if (whitespaceChunk[i] === firstBreakChar) {
+ if (crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ if (whitespaceChunk[i + 1] === secondBreakChar) {
+ res += whitespaceChunk[i + 1];
+ i++;
+ }
+ }
+ } else if (whitespaceChunk[i] === secondBreakChar && (!whitespaceChunk[i - 1] || whitespaceChunk[i - 1] !== firstBreakChar) && crlfCount <= limit) {
+ res += whitespaceChunk[i];
+ }
+ } else {
+ if (!whitespaceChunk[i + 1] && !crlfCount) {
+ res += " ";
+ }
+ }
+ }
+ return res;
+ }
+ if (typeof str === "string" && str.length) {
+ let lineBreakLimit = 1;
+ if (typeof +originallineBreakLimit === "number" && Number.isInteger(+originallineBreakLimit) && +originallineBreakLimit >= 0) {
+ lineBreakLimit = +originallineBreakLimit;
+ }
+ let frontPart = "";
+ let endPart = "";
+ if (!str.trim()) {
+ frontPart = str;
+ } else if (!str[0].trim()) {
+ for (let i = 0, len = str.length; i < len; i++) {
+ if (str[i].trim()) {
+ frontPart = str.slice(0, i);
+ break;
+ }
+ }
+ }
+ if (str.trim() && (str.slice(-1).trim() === "" || str.slice(-1) === rawNbsp)) {
+ for (let i = str.length; i--;) {
+ if (str[i].trim()) {
+ endPart = str.slice(i + 1);
+ break;
+ }
+ }
+ }
+ return `${prep(frontPart, lineBreakLimit, false)}${str.trim()}${reverse(prep(reverse(endPart), lineBreakLimit, true))}`;
+ }
+ return str;
+}
+
+export { collWhitespace, version };
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.umd.js b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.umd.js
new file mode 100644
index 0000000..b2be96c
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/dist/string-collapse-leading-whitespace.umd.js
@@ -0,0 +1,10 @@
+/**
+ * @name string-collapse-leading-whitespace
+ * @fileoverview Collapse the leading and trailing whitespace of a string
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
+ */
+
+!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).stringCollapseLeadingWhitespace={})}(this,(function(e){"use strict";e.collWhitespace=function(e,t=1){function i(e){return Array.from(e).reverse().join("")}function r(e,t,i){const r=i?"\n":"\r",n=i?"\r":"\n";if(!e)return e;let f=0,o="";for(let i=0,l=e.length;i<l;i++)(e[i]===r||e[i]===n&&e[i-1]!==r)&&f++,"\r\n".includes(e[i])||" "===e[i]?" "===e[i]?o+=e[i]:e[i]===r?f<=t&&(o+=e[i],e[i+1]===n&&(o+=e[i+1],i++)):e[i]===n&&(!e[i-1]||e[i-1]!==r)&&f<=t&&(o+=e[i]):e[i+1]||f||(o+=" ");return o}if("string"==typeof e&&e.length){let n=1;"number"==typeof+t&&Number.isInteger(+t)&&+t>=0&&(n=+t);let f="",o="";if(e.trim()){if(!e[0].trim())for(let t=0,i=e.length;t<i;t++)if(e[t].trim()){f=e.slice(0,t);break}}else f=e;if(e.trim()&&(""===e.slice(-1).trim()||" "===e.slice(-1)))for(let t=e.length;t--;)if(e[t].trim()){o=e.slice(t+1);break}return`${r(f,n,!1)}${e.trim()}${i(r(i(o),n,!0))}`}return e},e.version="5.1.0",Object.defineProperty(e,"__esModule",{value:!0})}));
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/_quickTake.js b/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/_quickTake.js
new file mode 100644
index 0000000..6995670
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/_quickTake.js
@@ -0,0 +1,20 @@
+// Quick Take
+
+import { strict as assert } from "assert";
+import { collWhitespace } from "../dist/string-collapse-leading-whitespace.esm.js";
+
+// if leading/trailing whitespace doesn't contain \n, collapse to a single space
+assert.equal(collWhitespace(" aaa "), " aaa ");
+
+// otherwise, collapse to a single \n (default setting)
+assert.equal(collWhitespace(" \n\n aaa \n\n\n "), "\naaa\n");
+
+// does nothing to trimmed strings:
+assert.equal(collWhitespace("aaa"), "aaa");
+
+// if there are multiple lines string is still processed in trim-fashion -
+// only beginning and ending whitespace is changed:
+assert.equal(
+ collWhitespace(" abc \n def \n ghi "),
+ " abc \n def \n ghi "
+);
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/api.json b/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/api.json
new file mode 100644
index 0000000..2824c11
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/examples/api.json
@@ -0,0 +1 @@
+{"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; collWhitespace &#x7D; from \"string-collapse-leading-whitespace\";\n\n// if leading/trailing whitespace doesn't contain \\n, collapse to a single space\nassert.equal(collWhitespace(\" aaa \"), \" aaa \");\n\n// otherwise, collapse to a single \\n (default setting)\nassert.equal(collWhitespace(\" \\n\\n aaa \\n\\n\\n \"), \"\\naaa\\n\");\n\n// does nothing to trimmed strings:\nassert.equal(collWhitespace(\"aaa\"), \"aaa\");\n\n// if there are multiple lines string is still processed in trim-fashion -\n// only beginning and ending whitespace is changed:\nassert.equal(\n collWhitespace(\" abc \\n def \\n ghi \"),\n \" abc \\n def \\n ghi \"\n);"}} \ No newline at end of file
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/package.json b/includes/external/school/node_modules/string-collapse-leading-whitespace/package.json
new file mode 100644
index 0000000..a03fd73
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/package.json
@@ -0,0 +1,121 @@
+{
+ "name": "string-collapse-leading-whitespace",
+ "version": "5.1.0",
+ "description": "Collapse the leading and trailing whitespace of a string",
+ "keywords": [
+ "alt",
+ "attributes",
+ "characters",
+ "dash",
+ "email",
+ "encoding",
+ "fancy",
+ "quote",
+ "remove",
+ "replace",
+ "simple",
+ "string",
+ "tags",
+ "templates"
+ ],
+ "homepage": "https://codsen.com/os/string-collapse-leading-whitespace/",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/codsen/codsen.git",
+ "directory": "packages/string-collapse-leading-whitespace"
+ },
+ "license": "MIT",
+ "author": {
+ "name": "Roy Revelt",
+ "email": "roy@codsen.com",
+ "url": "https://codsen.com"
+ },
+ "main": "dist/string-collapse-leading-whitespace.cjs.js",
+ "module": "dist/string-collapse-leading-whitespace.esm.js",
+ "browser": "dist/string-collapse-leading-whitespace.umd.js",
+ "types": "types/index.d.ts",
+ "scripts": {
+ "build": "rollup -c",
+ "esbuild": "node '../../scripts/esbuild.js'",
+ "esbuild_dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
+ "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent --output-file=testStats.md && npm run clean_cov",
+ "dev": "rollup -c --dev",
+ "devunittest": "npm run dev && tap --only -R 'base'",
+ "format": "npm run lect && npm run prettier && npm run lint",
+ "lect": "lect",
+ "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
+ "perf": "node perf/check",
+ "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
+ "republish": "npm publish || :",
+ "tap": "tap",
+ "tsc": "tsc",
+ "pretest": "npm run build",
+ "test": "npm run lint && npm run unittest && npm run test:examples && npm run clean_cov && npm run format",
+ "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
+ "unittest": "./node_modules/.bin/tap --no-only --output-file=testStats.md --reporter=terse && tsc -p tsconfig.json --noEmit && npm run clean_cov && npm run perf",
+ "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
+ "clean_types": "../../scripts/cleanTypes.js"
+ },
+ "tap": {
+ "coverage-report": [
+ "json-summary",
+ "text"
+ ],
+ "nyc-arg": [
+ "--exclude=**/*.cjs.js",
+ "--exclude=**/*.umd.js"
+ ],
+ "timeout": 0
+ },
+ "lect": {
+ "licence": {
+ "extras": [
+ ""
+ ]
+ },
+ "req": "{ collWhitespace }",
+ "various": {
+ "devDependencies": []
+ }
+ },
+ "dependencies": {
+ "@babel/runtime": "^7.14.0"
+ },
+ "devDependencies": {
+ "@babel/cli": "^7.14.3",
+ "@babel/core": "^7.14.3",
+ "@babel/node": "^7.14.2",
+ "@babel/plugin-external-helpers": "^7.12.13",
+ "@babel/plugin-proposal-class-properties": "^7.13.0",
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.2",
+ "@babel/plugin-proposal-object-rest-spread": "^7.14.2",
+ "@babel/plugin-proposal-optional-chaining": "^7.14.2",
+ "@babel/plugin-transform-runtime": "^7.14.3",
+ "@babel/preset-env": "^7.14.2",
+ "@babel/preset-typescript": "^7.13.0",
+ "@babel/register": "^7.13.16",
+ "@rollup/plugin-babel": "^5.3.0",
+ "@rollup/plugin-commonjs": "^19.0.0",
+ "@rollup/plugin-json": "^4.1.0",
+ "@rollup/plugin-node-resolve": "^13.0.0",
+ "@rollup/plugin-strip": "^2.0.1",
+ "@rollup/plugin-typescript": "^8.2.1",
+ "@types/node": "^15.6.0",
+ "@types/tap": "^15.0.1",
+ "@typescript-eslint/eslint-plugin": "^4.24.0",
+ "@typescript-eslint/parser": "^4.24.0",
+ "core-js": "^3.12.1",
+ "cross-env": "^7.0.3",
+ "eslint": "^7.27.0",
+ "lect": "^0.17.0",
+ "rollup": "^2.49.0",
+ "rollup-plugin-ascii": "^0.0.3",
+ "rollup-plugin-banner": "^0.2.1",
+ "rollup-plugin-cleanup": "^3.2.1",
+ "rollup-plugin-dts": "^3.0.1",
+ "rollup-plugin-terser": "^7.0.2",
+ "tap": "^14.11.0",
+ "tslib": "^2.2.0",
+ "typescript": "^4.2.4"
+ }
+}
diff --git a/includes/external/school/node_modules/string-collapse-leading-whitespace/types/index.d.ts b/includes/external/school/node_modules/string-collapse-leading-whitespace/types/index.d.ts
new file mode 100644
index 0000000..140b16f
--- /dev/null
+++ b/includes/external/school/node_modules/string-collapse-leading-whitespace/types/index.d.ts
@@ -0,0 +1,4 @@
+declare const version: string;
+declare function collWhitespace(str: string, originallineBreakLimit?: number): string;
+
+export { collWhitespace, version };