summaryrefslogtreecommitdiff
path: root/school/node_modules/ranges-push
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
committerMinteck <contact@minteck.org>2023-02-23 19:34:56 +0100
commit3d1cd02f27518f1a04374c7c8320cd5d82ede6e9 (patch)
tree75be5fba4368472fb11c8015aee026b2b9a71888 /school/node_modules/ranges-push
parent8cc1f13c17fa2fb5a4410542d39e650e02945634 (diff)
downloadpluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.gz
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.tar.bz2
pluralconnect-3d1cd02f27518f1a04374c7c8320cd5d82ede6e9.zip
Updated 40 files, added 37 files, deleted 1103 files and renamed 3905 files (automated)
Diffstat (limited to 'school/node_modules/ranges-push')
-rw-r--r--school/node_modules/ranges-push/CHANGELOG.md211
-rw-r--r--school/node_modules/ranges-push/LICENSE22
-rw-r--r--school/node_modules/ranges-push/README.md78
-rw-r--r--school/node_modules/ranges-push/dist/ranges-push.cjs.js186
-rw-r--r--school/node_modules/ranges-push/dist/ranges-push.dev.umd.js461
-rw-r--r--school/node_modules/ranges-push/dist/ranges-push.esm.js150
-rw-r--r--school/node_modules/ranges-push/dist/ranges-push.umd.js34
-rw-r--r--school/node_modules/ranges-push/examples/_quickTake.js28
-rw-r--r--school/node_modules/ranges-push/examples/api.json1
-rw-r--r--school/node_modules/ranges-push/package.json120
-rw-r--r--school/node_modules/ranges-push/types/index.d.ts27
11 files changed, 0 insertions, 1318 deletions
diff --git a/school/node_modules/ranges-push/CHANGELOG.md b/school/node_modules/ranges-push/CHANGELOG.md
deleted file mode 100644
index 2990b40..0000000
--- a/school/node_modules/ranges-push/CHANGELOG.md
+++ /dev/null
@@ -1,211 +0,0 @@
-# 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 ([8e75edf](https://github.com/codsen/codsen/commit/8e75edfac935f4f27604bb0b9731bd0ea4f2e7ec))
-
-### BREAKING CHANGES
-
-- previously you'd consume like: `import Ranges from ...` - now `import { Ranges } from ...`
-
-## 4.0.0 (2020-11-28)
-
-Accidental version bump during migration to sourcehut. Sorry about that.
-
-## 3.7.0 (2020-02-01)
-
-### Features
-
-- remove couple dependencies and rebase a little bit ([616b47d](https://gitlab.com/codsen/codsen/commit/616b47df0ef6a5a72f766d690b0169608e39a4d9))
-
-## 3.6.0 (2019-09-14)
-
-### Features
-
-- non-breaking spaces are now retained when pushing with whitespace limiter option on ([2de001d](https://gitlab.com/codsen/codsen/commit/2de001d))
-
-## 3.5.0 (2019-09-11)
-
-### Features
-
-- improved whitespace insertion algorithm ([b8c4463](https://gitlab.com/codsen/codsen/commit/b8c4463))
-
-### Reverts
-
-- restores back as it was before, no changes to opts.limitToBeAddedWhitespace ([f0b36f3](https://gitlab.com/codsen/codsen/commit/f0b36f3))
-
-## 3.4.0 (2019-09-04)
-
-### Features
-
-- accept nulls among pushed values, do not throw, just do nothing ([4badda3](https://gitlab.com/codsen/codsen/commit/4badda3))
-
-## 3.3.0 (2019-08-08)
-
-### Features
-
-- opts.mergeType ([7efa4db](https://gitlab.com/codsen/codsen/commit/7efa4db))
-
-## 3.2.0 (2019-06-18)
-
-### Features
-
-- Remove check-types-mini for perf reasons and also to reduce Lerna ECYCLE warnings ([50be5d8](https://gitlab.com/codsen/codsen/commit/50be5d8))
-
-## 3.1.0 (2019-06-01)
-
-### Features
-
-- ranges.replace() ([f0a2de0](https://gitlab.com/codsen/codsen/commit/f0a2de0))
-
-## 2.16.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
-
-## 2.13.0 (2018-12-26)
-
-- ✨ Harden the type checks just in case ([106ae7a](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-push/commits/106ae7a))
-- ✨ Implement throw pinning in unit tests ([6b8c789](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-push/commits/6b8c789))
-- ✨ Omit the 3rd argument when it's equal to an empty string ([343c153](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-push/commits/343c153))
-- ✨ Add `opts.limitLinebreaksCount` ([55eedfa](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-push/commits/55eedfa))
-
-## 2.12.0 (2018-10-25)
-
-- ✨ Updated all dependencies
-- ✨ Restored coveralls.io reporting
-- ✨ Restored unit test linting
-
-## 2.11.0 (2018-07-26)
-
-- ✨ If third argument is an empty string, now it's being completely omited. This is necessary for unit tests' sanity. Otherwise, it's impossible to `deepEqual`-match.
-
-## 2.10.0 (2018-07-03)
-
-- ✨ Added `opts.limitLinebreaksCount` - this will allow double linebreaks resulting in an empty row between the content lines.
-
-## 2.9.0 (2018-06-18)
-
-- ✨ Rename to `ranges-push` and migrate to Bitbucket
-
-## 2.8.0 (2018-05-19)
-
-- ✨ Fixed second input argument throw error message reporting. Previously, when second argument was of a wrong type, the first argument's details were reported which caused confusion. Fixed now.
-- ✨ Throw error pinning in unit tests. Otherwise we would not be able to prove this feature above is correctly implemented. Both before and after were throwing an error. The correctness is distinguished by _which_ error exactly, (first arg's wrong type) `THROW_ID_09` or (newly added second arg's wrong type) `THROW_ID_10`. I'd go as far as to say, if _throw pinning_ was implemented at the beginning, this bug would not have happened.
-
-## 2.7.0 (2018-05-11)
-
-Setup refresh.
-
-- ✨ Set up [Prettier](https://prettier.io)
-- ✨ 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 — Rollup will remove them from production code.
-- ✨ Unit tests are pointing at ES modules build, which means that code coverage is correct now, without Babel functions being missed
-
-## 2.6.0 (2018-02-24)
-
-- ✨ Chillax™ feature. If `null` is being `.push`ed, nothing happens. It won't `throw` from now on.
-
-## 2.5.0 (2018-02-10)
-
-- ✨ Now accepts output of another slices class (its `.current()` output) as the first input argument. Now, it won't throw an error that second argument is missing, provided the validation of the array from the 1st argument passes.
-
- In practice, I'm going to use it in [string-remove-duplicate-heads-tails](https://www.npmjs.com/package/string-remove-duplicate-heads-tails) for example, where I there will be two-step process. Range comes in as a plausible range, then we traverse further and if further ranges are found, that plausible-one is merged into the real ranges slices array class. This merging up until now was a problem - it could only be done iterating one array and `.push`ing each range one-by-one into another slices array.
-
-- 🔧 Because of the above I had to rewrite the whole validation and error throwing part. All unit tests are the same and more were added, so there shoud not be any breaking changes.
-
-## 2.4.0 (2018-01-18)
-
-- ✨ `opts.limitToBeAddedWhitespace` now also collapses the leading and trailing whitespace. If any chunk of leading whitespace (anything that would get `trim()`'med) contain line break `\n`, it's turned into `\n`. Otherwise, it's turned into single space.
-
-```js
-// does nothing to trimmed strings:
-'aaa' => 'aaa'
-// if leading or trailing whitespace doesn't contain \n, collapse to a single space
-' aaa ' => ' aaa '
-// otherwise, collapse to a single \n
-' \n\n aaa \n\n\n ' => '\naaa\n'
-```
-
-## 2.3.0 (2018-01-16)
-
-- ✨ `.push` as an alias for `.add`. Both do the same thing. I thought the name of this package has "push" so why there is no such method? Until now, that is.
-
-## 2.2.0 (2017-12-29)
-
-- ✨ When third argument is `null`, any merged range results will have there `null`.
-
-## 2.1.0 (2017-12-20)
-
-- ✨ `opts.limitToBeAddedWhitespace` - makes life easier when cleaning HTML. Now, chunk ranges can contain any amount of whitespace - the `current()` will run `string-collapse` on the to-be-inserted, third argument. Now, if there are any line breaks among the whitespace characters, the result will be a single line break instead. Basically, when this setting is active, only space or linebreak will be inserted in place of deleted range.
-
-What this feature gives you is you can activate it and freely push chunks of string in, extracting whitespace along it and pushing it too. You don't need to care about excessive amount of it - this library will truncate it automatically. It's very handy when stripping strings from [HTML tags](https://www.npmjs.com/package/string-strip-html) for example.
-
-## 2.0.0 (2017-12-05)
-
-- ✨ Rewrite in ES modules
-- ✨ Now serving three builds: CommonJS, UMD and ES modules, all wired up to appropriate end-points on `package.json`
-- ✨ If you have two ranges where second-one completely overlaps the first-one and the first has third argument, something to insert in its place, that third argument will be discarded upon merge.
-
- Let's say you got these two ranges:
-
- ```js
- [
- [5, 6, " "],
- [1, 10],
- ];
- ```
-
- Previously, result would be `[1, 10, ' ']`. Now result will be `[1, 10]`. This is logical, because each range should take care to consider its vicinity. If `[1, 10]` came in without instructions to add something in its place, we assume this was intentional.
-
-## 1.6.0 (2017-09-25)
-
-- ✨ Actually serving the transpiled version as default. Sorry about that. Now the transpiled source is wired to `package.json` `main`. The proper Rollup setup (UMD, ESJ and ESM builds) is in coming next.
-
-## 1.5.0 (2017-09-18)
-
-- ✨ Separated the merging function into a separate library, [ranges-merge](https://www.npmjs.com/package/ranges-merge).
-
-## 1.4.0 (2017-09-12)
-
-- ✨ Separated ranges sorting function into a [separate library](https://www.npmjs.com/package/ranges-sort) because it will be needed in [Detergent](https://www.npmjs.com/package/detergent).
-- ✨ Replaced JS Standard with ESLint on `airbnb-base` config with two exceptions: 1. no semicolons and 2. allow plus-plus in `for`-loops. For posterity JS Standard has been neglected by its maintainers, currently it's using half-year old version of ESLint, and doesn't tap to majority of its rules. After activating ESLint, it found some style issues that needed fixing. I like that.
-
-## 1.3.0 (2017-08-30)
-
-- ✨ Transpiled version is available from the folder `/es5/`.
-
-## 1.2.0 (2017-08-16)
-
-- 🔧 The input validation was not passing through the zero indexes for `.add()` because natural number checks were not including zero. Sorted now.
-
-## 1.1.0 (2017-07-31)
-
-- ✨ An improvement to the algorithm which doesn't change API: sorting and merging is now done upon querying `.current()`, not during `.add()`. This guarantees maximum data precision, especially if you don't do any `.add()` after calling `.current()` and processing the slices array using [string-replace-slices-array](https://www.npmjs.com/package/ranges-apply).
-
-## 1.0.0 (2017-07-28)
-
-- ✨ First public release
diff --git a/school/node_modules/ranges-push/LICENSE b/school/node_modules/ranges-push/LICENSE
deleted file mode 100644
index 9ea205b..0000000
--- a/school/node_modules/ranges-push/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-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/school/node_modules/ranges-push/README.md b/school/node_modules/ranges-push/README.md
deleted file mode 100644
index e8c3a47..0000000
--- a/school/node_modules/ranges-push/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-# ranges-push
-
-> Gather string index ranges
-
-<div class="package-badges">
- <a href="https://www.npmjs.com/package/ranges-push" 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/ranges-push" 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/ranges-push" 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/ranges-push?interval=30" rel="nofollow noreferrer noopener" target="_blank">
- <img src="https://img.shields.io/npm/dm/ranges-push.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 ranges-push
-```
-
-## Quick Take
-
-```js
-import { strict as assert } from "assert";
-import { Ranges } from "ranges-push";
-import { rApply } from "ranges-apply";
-
-const gatheredRanges = new Ranges();
-
-const oldString = `The quick brown fox jumps over the lazy dog.`;
-
-// push the ranges
-gatheredRanges.push(35, 43, "little Red Riding Hood");
-gatheredRanges.push(4, 19, "bad grey wolf");
-
-// retrieve the merged and sorted ranges by calling .current()
-assert.deepEqual(gatheredRanges.current(), [
- [4, 19, "bad grey wolf"],
- [35, 43, "little Red Riding Hood"],
-]);
-
-assert.equal(
- rApply(oldString, gatheredRanges.current()),
- "The bad grey wolf jumps over the little Red Riding Hood."
-);
-
-// wipe all gathered ranges
-gatheredRanges.wipe();
-assert.equal(gatheredRanges.current(), null);
-```
-
-## Documentation
-
-Please [visit codsen.com](https://codsen.com/os/ranges-push/) 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/school/node_modules/ranges-push/dist/ranges-push.cjs.js b/school/node_modules/ranges-push/dist/ranges-push.cjs.js
deleted file mode 100644
index d323cdf..0000000
--- a/school/node_modules/ranges-push/dist/ranges-push.cjs.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/**
- * @name ranges-push
- * @fileoverview Gather string index ranges
- * @version 5.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-push/}
- */
-
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
-var _typeof = require('@babel/runtime/helpers/typeof');
-var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
-var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
-var _createClass = require('@babel/runtime/helpers/createClass');
-var stringCollapseLeadingWhitespace = require('string-collapse-leading-whitespace');
-var rangesMerge = require('ranges-merge');
-
-function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
-
-var _toConsumableArray__default = /*#__PURE__*/_interopDefaultLegacy(_toConsumableArray);
-var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
-var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
-var _classCallCheck__default = /*#__PURE__*/_interopDefaultLegacy(_classCallCheck);
-var _createClass__default = /*#__PURE__*/_interopDefaultLegacy(_createClass);
-
-var version$1 = "5.1.0";
-
-var version = version$1;
-function existy(x) {
- return x != null;
-}
-function isNum(something) {
- return Number.isInteger(something) && something >= 0;
-}
-function isStr(something) {
- return typeof something === "string";
-}
-var defaults = {
- limitToBeAddedWhitespace: false,
- limitLinebreaksCount: 1,
- mergeType: 1
-};
-var Ranges = function () {
- function Ranges(originalOpts) {
- _classCallCheck__default['default'](this, Ranges);
- var opts = _objectSpread__default['default'](_objectSpread__default['default']({}, defaults), originalOpts);
- if (opts.mergeType && opts.mergeType !== 1 && opts.mergeType !== 2) {
- if (isStr(opts.mergeType) && opts.mergeType.trim() === "1") {
- opts.mergeType = 1;
- } else if (isStr(opts.mergeType) && opts.mergeType.trim() === "2") {
- opts.mergeType = 2;
- } else {
- throw new Error("ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: \"".concat(_typeof__default['default'](opts.mergeType), "\", equal to ").concat(JSON.stringify(opts.mergeType, null, 4)));
- }
- }
- this.opts = opts;
- this.ranges = [];
- }
- _createClass__default['default'](Ranges, [{
- key: "add",
- value: function add(originalFrom, originalTo, addVal) {
- var _this = this;
- if (originalFrom == null && originalTo == null) {
- return;
- }
- if (existy(originalFrom) && !existy(originalTo)) {
- if (Array.isArray(originalFrom)) {
- if (originalFrom.length) {
- if (originalFrom.some(function (el) {
- return Array.isArray(el);
- })) {
- originalFrom.forEach(function (thing) {
- if (Array.isArray(thing)) {
- _this.add.apply(_this, _toConsumableArray__default['default'](thing));
- }
- });
- return;
- }
- if (originalFrom.length && isNum(+originalFrom[0]) && isNum(+originalFrom[1])) {
- this.add.apply(this, _toConsumableArray__default['default'](originalFrom));
- }
- }
- return;
- }
- throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, \"from\" is set (".concat(JSON.stringify(originalFrom, null, 0), ") but second-one, \"to\" is not (").concat(JSON.stringify(originalTo, null, 0), ")"));
- } else if (!existy(originalFrom) && existy(originalTo)) {
- throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, \"to\" is set (".concat(JSON.stringify(originalTo, null, 0), ") but first-one, \"from\" is not (").concat(JSON.stringify(originalFrom, null, 0), ")"));
- }
- var from = +originalFrom;
- var to = +originalTo;
- if (isNum(addVal)) {
- addVal = String(addVal);
- }
- if (isNum(from) && isNum(to)) {
- if (existy(addVal) && !isStr(addVal) && !isNum(addVal)) {
- throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(_typeof__default['default'](addVal), ", equal to:\n").concat(JSON.stringify(addVal, null, 4)));
- }
- if (existy(this.ranges) && Array.isArray(this.last()) && from === this.last()[1]) {
- this.last()[1] = to;
- if (this.last()[2] === null || addVal === null) ;
- if (this.last()[2] !== null && existy(addVal)) {
- var calculatedVal = this.last()[2] && this.last()[2].length > 0 && (!this.opts || !this.opts.mergeType || this.opts.mergeType === 1) ? this.last()[2] + addVal : addVal;
- if (this.opts.limitToBeAddedWhitespace) {
- calculatedVal = stringCollapseLeadingWhitespace.collWhitespace(calculatedVal, this.opts.limitLinebreaksCount);
- }
- if (!(isStr(calculatedVal) && !calculatedVal.length)) {
- this.last()[2] = calculatedVal;
- }
- }
- } else {
- if (!this.ranges) {
- this.ranges = [];
- }
- var whatToPush = addVal !== undefined && !(isStr(addVal) && !addVal.length) ? [from, to, addVal && this.opts.limitToBeAddedWhitespace ? stringCollapseLeadingWhitespace.collWhitespace(addVal, this.opts.limitLinebreaksCount) : addVal] : [from, to];
- this.ranges.push(whatToPush);
- }
- } else {
- if (!(isNum(from) && from >= 0)) {
- throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_09] \"from\" value, the first input argument, must be a natural number or zero! Currently it's of a type \"".concat(_typeof__default['default'](from), "\" equal to: ").concat(JSON.stringify(from, null, 4)));
- } else {
- throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_10] \"to\" value, the second input argument, must be a natural number or zero! Currently it's of a type \"".concat(_typeof__default['default'](to), "\" equal to: ").concat(JSON.stringify(to, null, 4)));
- }
- }
- }
- }, {
- key: "push",
- value: function push(originalFrom, originalTo, addVal) {
- this.add(originalFrom, originalTo, addVal);
- }
- }, {
- key: "current",
- value: function current() {
- var _this2 = this;
- if (Array.isArray(this.ranges) && this.ranges.length) {
- this.ranges = rangesMerge.rMerge(this.ranges, {
- mergeType: this.opts.mergeType
- });
- if (this.ranges && this.opts.limitToBeAddedWhitespace) {
- return this.ranges.map(function (val) {
- if (existy(val[2])) {
- return [val[0], val[1], stringCollapseLeadingWhitespace.collWhitespace(val[2], _this2.opts.limitLinebreaksCount)];
- }
- return val;
- });
- }
- return this.ranges;
- }
- return null;
- }
- }, {
- key: "wipe",
- value: function wipe() {
- this.ranges = [];
- }
- }, {
- key: "replace",
- value: function replace(givenRanges) {
- if (Array.isArray(givenRanges) && givenRanges.length) {
- if (!(Array.isArray(givenRanges[0]) && isNum(givenRanges[0][0]))) {
- throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(givenRanges[0], null, 4), " should be an array and its first element should be an integer, a string index."));
- } else {
- this.ranges = Array.from(givenRanges);
- }
- } else {
- this.ranges = [];
- }
- }
- }, {
- key: "last",
- value: function last() {
- if (Array.isArray(this.ranges) && this.ranges.length) {
- return this.ranges[this.ranges.length - 1];
- }
- return null;
- }
- }]);
- return Ranges;
-}();
-
-exports.Ranges = Ranges;
-exports.defaults = defaults;
-exports.version = version;
diff --git a/school/node_modules/ranges-push/dist/ranges-push.dev.umd.js b/school/node_modules/ranges-push/dist/ranges-push.dev.umd.js
deleted file mode 100644
index 2f7ef01..0000000
--- a/school/node_modules/ranges-push/dist/ranges-push.dev.umd.js
+++ /dev/null
@@ -1,461 +0,0 @@
-/**
- * @name ranges-push
- * @fileoverview Gather string index ranges
- * @version 5.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-push/}
- */
-
-(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.rangesPush = {}));
-}(this, (function (exports) { 'use strict';
-
-/**
- * @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 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;
-}
-
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */
-const defaults$2 = {
- strictlyTwoElementsInRangeArrays: false,
- progressFn: null
-};
-function rSort(arrOfRanges, originalOptions) {
- if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
- return arrOfRanges;
- }
- const opts = { ...defaults$2,
- ...originalOptions
- };
- let culpritsIndex;
- let culpritsLen;
- if (opts.strictlyTwoElementsInRangeArrays && !arrOfRanges.filter(range => range).every((rangeArr, indx) => {
- if (rangeArr.length !== 2) {
- culpritsIndex = indx;
- culpritsLen = rangeArr.length;
- return false;
- }
- return true;
- })) {
- throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) has not two but ${culpritsLen} elements!`);
- }
- if (!arrOfRanges.filter(range => range).every((rangeArr, indx) => {
- if (!Number.isInteger(rangeArr[0]) || rangeArr[0] < 0 || !Number.isInteger(rangeArr[1]) || rangeArr[1] < 0) {
- culpritsIndex = indx;
- return false;
- }
- return true;
- })) {
- throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${culpritsIndex}th range (${JSON.stringify(arrOfRanges[culpritsIndex], null, 4)}) does not consist of only natural numbers!`);
- }
- const maxPossibleIterations = arrOfRanges.filter(range => range).length ** 2;
- let counter = 0;
- return Array.from(arrOfRanges).filter(range => range).sort((range1, range2) => {
- if (opts.progressFn) {
- counter += 1;
- opts.progressFn(Math.floor(counter * 100 / maxPossibleIterations));
- }
- if (range1[0] === range2[0]) {
- if (range1[1] < range2[1]) {
- return -1;
- }
- if (range1[1] > range2[1]) {
- return 1;
- }
- return 0;
- }
- if (range1[0] < range2[0]) {
- return -1;
- }
- return 1;
- });
-}
-
-/**
- * @name ranges-merge
- * @fileoverview Merge and sort string index ranges
- * @version 7.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-merge/}
- */
-const defaults$1 = {
- mergeType: 1,
- progressFn: null,
- joinRangesThatTouchEdges: true
-};
-function rMerge(arrOfRanges, originalOpts) {
- function isObj(something) {
- return something && typeof something === "object" && !Array.isArray(something);
- }
- if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
- return null;
- }
- let opts;
- if (originalOpts) {
- if (isObj(originalOpts)) {
- opts = { ...defaults$1,
- ...originalOpts
- };
- if (opts.progressFn && isObj(opts.progressFn) && !Object.keys(opts.progressFn).length) {
- opts.progressFn = null;
- } else if (opts.progressFn && typeof opts.progressFn !== "function") {
- throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof opts.progressFn}", equal to ${JSON.stringify(opts.progressFn, null, 4)}`);
- }
- if (opts.mergeType && +opts.mergeType !== 1 && +opts.mergeType !== 2) {
- throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof opts.mergeType}", equal to ${JSON.stringify(opts.mergeType, null, 4)}`);
- }
- if (typeof opts.joinRangesThatTouchEdges !== "boolean") {
- throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof opts.joinRangesThatTouchEdges}", equal to ${JSON.stringify(opts.joinRangesThatTouchEdges, null, 4)}`);
- }
- } else {
- throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n${JSON.stringify(originalOpts, null, 4)} (type ${typeof originalOpts})`);
- }
- } else {
- opts = { ...defaults$1
- };
- }
- const filtered = arrOfRanges
- .filter(range => range).map(subarr => [...subarr]).filter(
- rangeArr => rangeArr[2] !== undefined || rangeArr[0] !== rangeArr[1]);
- let sortedRanges;
- let lastPercentageDone;
- let percentageDone;
- if (opts.progressFn) {
- sortedRanges = rSort(filtered, {
- progressFn: percentage => {
- percentageDone = Math.floor(percentage / 5);
- if (percentageDone !== lastPercentageDone) {
- lastPercentageDone = percentageDone;
- opts.progressFn(percentageDone);
- }
- }
- });
- } else {
- sortedRanges = rSort(filtered);
- }
- if (!sortedRanges) {
- return null;
- }
- const len = sortedRanges.length - 1;
- for (let i = len; i > 0; i--) {
- if (opts.progressFn) {
- percentageDone = Math.floor((1 - i / len) * 78) + 21;
- if (percentageDone !== lastPercentageDone && percentageDone > lastPercentageDone) {
- lastPercentageDone = percentageDone;
- opts.progressFn(percentageDone);
- }
- }
- if (sortedRanges[i][0] <= sortedRanges[i - 1][0] || !opts.joinRangesThatTouchEdges && sortedRanges[i][0] < sortedRanges[i - 1][1] || opts.joinRangesThatTouchEdges && sortedRanges[i][0] <= sortedRanges[i - 1][1]) {
- sortedRanges[i - 1][0] = Math.min(sortedRanges[i][0], sortedRanges[i - 1][0]);
- sortedRanges[i - 1][1] = Math.max(sortedRanges[i][1], sortedRanges[i - 1][1]);
- if (sortedRanges[i][2] !== undefined && (sortedRanges[i - 1][0] >= sortedRanges[i][0] || sortedRanges[i - 1][1] <= sortedRanges[i][1])) {
- if (sortedRanges[i - 1][2] !== null) {
- if (sortedRanges[i][2] === null && sortedRanges[i - 1][2] !== null) {
- sortedRanges[i - 1][2] = null;
- } else if (sortedRanges[i - 1][2] != null) {
- if (+opts.mergeType === 2 && sortedRanges[i - 1][0] === sortedRanges[i][0]) {
- sortedRanges[i - 1][2] = sortedRanges[i][2];
- } else {
- sortedRanges[i - 1][2] += sortedRanges[i][2];
- }
- } else {
- sortedRanges[i - 1][2] = sortedRanges[i][2];
- }
- }
- }
- sortedRanges.splice(i, 1);
- i = sortedRanges.length;
- }
- }
- return sortedRanges.length ? sortedRanges : null;
-}
-
-var version$1 = "5.1.0";
-
-/* eslint @typescript-eslint/explicit-module-boundary-types: 0 */
-const version = version$1;
-function existy(x) {
- return x != null;
-}
-function isNum(something) {
- return Number.isInteger(something) && something >= 0;
-}
-function isStr(something) {
- return typeof something === "string";
-}
-const defaults = {
- limitToBeAddedWhitespace: false,
- limitLinebreaksCount: 1,
- mergeType: 1,
-};
-// -----------------------------------------------------------------------------
-class Ranges {
- //
- // O P T I O N S
- // =============
- constructor(originalOpts) {
- const opts = { ...defaults, ...originalOpts };
- if (opts.mergeType && opts.mergeType !== 1 && opts.mergeType !== 2) {
- if (isStr(opts.mergeType) && opts.mergeType.trim() === "1") {
- opts.mergeType = 1;
- }
- else if (isStr(opts.mergeType) &&
- opts.mergeType.trim() === "2") {
- opts.mergeType = 2;
- }
- else {
- throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof opts.mergeType}", equal to ${JSON.stringify(opts.mergeType, null, 4)}`);
- }
- }
- // so it's correct, let's get it in:
- this.opts = opts;
- this.ranges = [];
- }
- add(originalFrom, originalTo, addVal) {
- if (originalFrom == null && originalTo == null) {
- // absent ranges are marked as null - instead of array of arrays we can receive a null
- return;
- }
- if (existy(originalFrom) && !existy(originalTo)) {
- if (Array.isArray(originalFrom)) {
- if (originalFrom.length) {
- if (originalFrom.some((el) => Array.isArray(el))) {
- originalFrom.forEach((thing) => {
- if (Array.isArray(thing)) {
- // recursively feed this subarray, hopefully it's an array
- this.add(...thing);
- }
- // just skip other cases
- });
- return;
- }
- if (originalFrom.length &&
- isNum(+originalFrom[0]) &&
- isNum(+originalFrom[1])) {
- // recursively pass in those values
- this.add(...originalFrom);
- }
- }
- // else,
- return;
- }
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(originalFrom, null, 0)}) but second-one, "to" is not (${JSON.stringify(originalTo, null, 0)})`);
- }
- else if (!existy(originalFrom) && existy(originalTo)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(originalTo, null, 0)}) but first-one, "from" is not (${JSON.stringify(originalFrom, null, 0)})`);
- }
- const from = +originalFrom;
- const to = +originalTo;
- if (isNum(addVal)) {
- // eslint-disable-next-line no-param-reassign
- addVal = String(addVal);
- }
- // validation
- if (isNum(from) && isNum(to)) {
- // This means two indexes were given as arguments. Business as usual.
- if (existy(addVal) && !isStr(addVal) && !isNum(addVal)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof addVal}, equal to:\n${JSON.stringify(addVal, null, 4)}`);
- }
- // Does the incoming "from" value match the existing last element's "to" value?
- if (existy(this.ranges) &&
- Array.isArray(this.last()) &&
- from === this.last()[1]) {
- // The incoming range is an exact extension of the last range, like
- // [1, 100] gets added [100, 200] => you can merge into: [1, 200].
- this.last()[1] = to;
- // console.log(`addVal = ${JSON.stringify(addVal, null, 4)}`)
- if (this.last()[2] === null || addVal === null) ;
- if (this.last()[2] !== null && existy(addVal)) {
- let calculatedVal = this.last()[2] &&
- this.last()[2].length > 0 &&
- (!this.opts || !this.opts.mergeType || this.opts.mergeType === 1)
- ? this.last()[2] + addVal
- : addVal;
- if (this.opts.limitToBeAddedWhitespace) {
- calculatedVal = collWhitespace(calculatedVal, this.opts.limitLinebreaksCount);
- }
- if (!(isStr(calculatedVal) && !calculatedVal.length)) {
- // don't let the zero-length strings past
- this.last()[2] = calculatedVal;
- }
- }
- }
- else {
- if (!this.ranges) {
- this.ranges = [];
- }
- const whatToPush = addVal !== undefined && !(isStr(addVal) && !addVal.length)
- ? [
- from,
- to,
- addVal && this.opts.limitToBeAddedWhitespace
- ? collWhitespace(addVal, this.opts.limitLinebreaksCount)
- : addVal,
- ]
- : [from, to];
- this.ranges.push(whatToPush);
- }
- }
- else {
- // Error somewhere!
- // Let's find out where.
- // is it first arg?
- if (!(isNum(from) && from >= 0)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof from}" equal to: ${JSON.stringify(from, null, 4)}`);
- }
- else {
- // then it's second...
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof to}" equal to: ${JSON.stringify(to, null, 4)}`);
- }
- }
- }
- push(originalFrom, originalTo, addVal) {
- this.add(originalFrom, originalTo, addVal);
- }
- // C U R R E N T () - kindof a getter
- // ==================================
- current() {
- if (Array.isArray(this.ranges) && this.ranges.length) {
- // beware, merging can return null
- this.ranges = rMerge(this.ranges, {
- mergeType: this.opts.mergeType,
- });
- if (this.ranges && this.opts.limitToBeAddedWhitespace) {
- return this.ranges.map((val) => {
- if (existy(val[2])) {
- return [
- val[0],
- val[1],
- collWhitespace(val[2], this.opts.limitLinebreaksCount),
- ];
- }
- return val;
- });
- }
- return this.ranges;
- }
- return null;
- }
- // W I P E ()
- // ==========
- wipe() {
- this.ranges = [];
- }
- // R E P L A C E ()
- // ==========
- replace(givenRanges) {
- if (Array.isArray(givenRanges) && givenRanges.length) {
- // Now, ranges can be array of arrays, correct format but also single
- // range, an array of two natural numbers might be given.
- // Let's put safety latch against such cases
- if (!(Array.isArray(givenRanges[0]) && isNum(givenRanges[0][0]))) {
- throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(givenRanges[0], null, 4)} should be an array and its first element should be an integer, a string index.`);
- }
- else {
- this.ranges = Array.from(givenRanges);
- }
- }
- else {
- this.ranges = [];
- }
- }
- // L A S T ()
- // ==========
- last() {
- if (Array.isArray(this.ranges) && this.ranges.length) {
- return this.ranges[this.ranges.length - 1];
- }
- return null;
- }
-}
-
-exports.Ranges = Ranges;
-exports.defaults = defaults;
-exports.version = version;
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-})));
diff --git a/school/node_modules/ranges-push/dist/ranges-push.esm.js b/school/node_modules/ranges-push/dist/ranges-push.esm.js
deleted file mode 100644
index bafb297..0000000
--- a/school/node_modules/ranges-push/dist/ranges-push.esm.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * @name ranges-push
- * @fileoverview Gather string index ranges
- * @version 5.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-push/}
- */
-
-import { collWhitespace } from 'string-collapse-leading-whitespace';
-import { rMerge } from 'ranges-merge';
-
-var version$1 = "5.1.0";
-
-const version = version$1;
-function existy(x) {
- return x != null;
-}
-function isNum(something) {
- return Number.isInteger(something) && something >= 0;
-}
-function isStr(something) {
- return typeof something === "string";
-}
-const defaults = {
- limitToBeAddedWhitespace: false,
- limitLinebreaksCount: 1,
- mergeType: 1
-};
-class Ranges {
- constructor(originalOpts) {
- const opts = { ...defaults,
- ...originalOpts
- };
- if (opts.mergeType && opts.mergeType !== 1 && opts.mergeType !== 2) {
- if (isStr(opts.mergeType) && opts.mergeType.trim() === "1") {
- opts.mergeType = 1;
- } else if (isStr(opts.mergeType) && opts.mergeType.trim() === "2") {
- opts.mergeType = 2;
- } else {
- throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof opts.mergeType}", equal to ${JSON.stringify(opts.mergeType, null, 4)}`);
- }
- }
- this.opts = opts;
- this.ranges = [];
- }
- add(originalFrom, originalTo, addVal) {
- if (originalFrom == null && originalTo == null) {
- return;
- }
- if (existy(originalFrom) && !existy(originalTo)) {
- if (Array.isArray(originalFrom)) {
- if (originalFrom.length) {
- if (originalFrom.some(el => Array.isArray(el))) {
- originalFrom.forEach(thing => {
- if (Array.isArray(thing)) {
- this.add(...thing);
- }
- });
- return;
- }
- if (originalFrom.length && isNum(+originalFrom[0]) && isNum(+originalFrom[1])) {
- this.add(...originalFrom);
- }
- }
- return;
- }
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(originalFrom, null, 0)}) but second-one, "to" is not (${JSON.stringify(originalTo, null, 0)})`);
- } else if (!existy(originalFrom) && existy(originalTo)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(originalTo, null, 0)}) but first-one, "from" is not (${JSON.stringify(originalFrom, null, 0)})`);
- }
- const from = +originalFrom;
- const to = +originalTo;
- if (isNum(addVal)) {
- addVal = String(addVal);
- }
- if (isNum(from) && isNum(to)) {
- if (existy(addVal) && !isStr(addVal) && !isNum(addVal)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof addVal}, equal to:\n${JSON.stringify(addVal, null, 4)}`);
- }
- if (existy(this.ranges) && Array.isArray(this.last()) && from === this.last()[1]) {
- this.last()[1] = to;
- if (this.last()[2] === null || addVal === null) ;
- if (this.last()[2] !== null && existy(addVal)) {
- let calculatedVal = this.last()[2] && this.last()[2].length > 0 && (!this.opts || !this.opts.mergeType || this.opts.mergeType === 1) ? this.last()[2] + addVal : addVal;
- if (this.opts.limitToBeAddedWhitespace) {
- calculatedVal = collWhitespace(calculatedVal, this.opts.limitLinebreaksCount);
- }
- if (!(isStr(calculatedVal) && !calculatedVal.length)) {
- this.last()[2] = calculatedVal;
- }
- }
- } else {
- if (!this.ranges) {
- this.ranges = [];
- }
- const whatToPush = addVal !== undefined && !(isStr(addVal) && !addVal.length) ? [from, to, addVal && this.opts.limitToBeAddedWhitespace ? collWhitespace(addVal, this.opts.limitLinebreaksCount) : addVal] : [from, to];
- this.ranges.push(whatToPush);
- }
- } else {
- if (!(isNum(from) && from >= 0)) {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof from}" equal to: ${JSON.stringify(from, null, 4)}`);
- } else {
- throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof to}" equal to: ${JSON.stringify(to, null, 4)}`);
- }
- }
- }
- push(originalFrom, originalTo, addVal) {
- this.add(originalFrom, originalTo, addVal);
- }
- current() {
- if (Array.isArray(this.ranges) && this.ranges.length) {
- this.ranges = rMerge(this.ranges, {
- mergeType: this.opts.mergeType
- });
- if (this.ranges && this.opts.limitToBeAddedWhitespace) {
- return this.ranges.map(val => {
- if (existy(val[2])) {
- return [val[0], val[1], collWhitespace(val[2], this.opts.limitLinebreaksCount)];
- }
- return val;
- });
- }
- return this.ranges;
- }
- return null;
- }
- wipe() {
- this.ranges = [];
- }
- replace(givenRanges) {
- if (Array.isArray(givenRanges) && givenRanges.length) {
- if (!(Array.isArray(givenRanges[0]) && isNum(givenRanges[0][0]))) {
- throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(givenRanges[0], null, 4)} should be an array and its first element should be an integer, a string index.`);
- } else {
- this.ranges = Array.from(givenRanges);
- }
- } else {
- this.ranges = [];
- }
- }
- last() {
- if (Array.isArray(this.ranges) && this.ranges.length) {
- return this.ranges[this.ranges.length - 1];
- }
- return null;
- }
-}
-
-export { Ranges, defaults, version };
diff --git a/school/node_modules/ranges-push/dist/ranges-push.umd.js b/school/node_modules/ranges-push/dist/ranges-push.umd.js
deleted file mode 100644
index 91c329a..0000000
--- a/school/node_modules/ranges-push/dist/ranges-push.umd.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * @name ranges-push
- * @fileoverview Gather string index ranges
- * @version 5.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-push/}
- */
-
-!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).rangesPush={})}(this,(function(e){"use strict";
-/**
- * @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 r(e,r=1){function t(e){return Array.from(e).reverse().join("")}function n(e,r,t){const n=t?"\n":"\r",s=t?"\r":"\n";if(!e)return e;let i=0,o="";for(let t=0,a=e.length;t<a;t++)(e[t]===n||e[t]===s&&e[t-1]!==n)&&i++,"\r\n".includes(e[t])||" "===e[t]?" "===e[t]?o+=e[t]:e[t]===n?i<=r&&(o+=e[t],e[t+1]===s&&(o+=e[t+1],t++)):e[t]===s&&(!e[t-1]||e[t-1]!==n)&&i<=r&&(o+=e[t]):e[t+1]||i||(o+=" ");return o}if("string"==typeof e&&e.length){let s=1;"number"==typeof+r&&Number.isInteger(+r)&&+r>=0&&(s=+r);let i="",o="";if(e.trim()){if(!e[0].trim())for(let r=0,t=e.length;r<t;r++)if(e[r].trim()){i=e.slice(0,r);break}}else i=e;if(e.trim()&&(""===e.slice(-1).trim()||" "===e.slice(-1)))for(let r=e.length;r--;)if(e[r].trim()){o=e.slice(r+1);break}return`${n(i,s,!1)}${e.trim()}${t(n(t(o),s,!0))}`}return e}
-/**
- * @name ranges-sort
- * @fileoverview Sort string index ranges
- * @version 4.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-sort/}
- */const t={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function n(e,r){if(!Array.isArray(e)||!e.length)return e;const n={...t,...r};let s,i;if(n.strictlyTwoElementsInRangeArrays&&!e.filter((e=>e)).every(((e,r)=>2===e.length||(s=r,i=e.length,!1))))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${s}th range (${JSON.stringify(e[s],null,4)}) has not two but ${i} elements!`);if(!e.filter((e=>e)).every(((e,r)=>!(!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0)||(s=r,!1))))throw new TypeError(`ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ${s}th range (${JSON.stringify(e[s],null,4)}) does not consist of only natural numbers!`);const o=e.filter((e=>e)).length**2;let a=0;return Array.from(e).filter((e=>e)).sort(((e,r)=>(n.progressFn&&(a+=1,n.progressFn(Math.floor(100*a/o))),e[0]===r[0]?e[1]<r[1]?-1:e[1]>r[1]?1:0:e[0]<r[0]?-1:1)))}
-/**
- * @name ranges-merge
- * @fileoverview Merge and sort string index ranges
- * @version 7.1.0
- * @author Roy Revelt, Codsen Ltd
- * @license MIT
- * {@link https://codsen.com/os/ranges-merge/}
- */const s={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function i(e){return null!=e}function o(e){return Number.isInteger(e)&&e>=0}function a(e){return"string"==typeof e}const l={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};e.Ranges=class{constructor(e){const r={...l,...e};if(r.mergeType&&1!==r.mergeType&&2!==r.mergeType)if(a(r.mergeType)&&"1"===r.mergeType.trim())r.mergeType=1;else{if(!a(r.mergeType)||"2"!==r.mergeType.trim())throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof r.mergeType}", equal to ${JSON.stringify(r.mergeType,null,4)}`);r.mergeType=2}this.opts=r,this.ranges=[]}add(e,t,n){if(null==e&&null==t)return;if(i(e)&&!i(t)){if(Array.isArray(e)){if(e.length){if(e.some((e=>Array.isArray(e))))return void e.forEach((e=>{Array.isArray(e)&&this.add(...e)}));e.length&&o(+e[0])&&o(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}if(!i(e)&&i(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);const s=+e,l=+t;if(o(n)&&(n=String(n)),!o(s)||!o(l))throw o(s)&&s>=0?new TypeError(`ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it's of a type "${typeof l}" equal to: ${JSON.stringify(l,null,4)}`):new TypeError(`ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it's of a type "${typeof s}" equal to: ${JSON.stringify(s,null,4)}`);if(i(n)&&!a(n)&&!o(n))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof n}, equal to:\n${JSON.stringify(n,null,4)}`);if(i(this.ranges)&&Array.isArray(this.last())&&s===this.last()[1]){if(this.last()[1]=l,this.last(),null!==this.last()[2]&&i(n)){let e=!(this.last()[2]&&this.last()[2].length>0)||this.opts&&this.opts.mergeType&&1!==this.opts.mergeType?n:this.last()[2]+n;this.opts.limitToBeAddedWhitespace&&(e=r(e,this.opts.limitLinebreaksCount)),a(e)&&!e.length||(this.last()[2]=e)}}else{this.ranges||(this.ranges=[]);const e=void 0===n||a(n)&&!n.length?[s,l]:[s,l,n&&this.opts.limitToBeAddedWhitespace?r(n,this.opts.limitLinebreaksCount):n];this.ranges.push(e)}}push(e,r,t){this.add(e,r,t)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=function(e,r){function t(e){return e&&"object"==typeof e&&!Array.isArray(e)}if(!Array.isArray(e)||!e.length)return null;let i;if(r){if(!t(r))throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n${JSON.stringify(r,null,4)} (type ${typeof r})`);if(i={...s,...r},i.progressFn&&t(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&"function"!=typeof i.progressFn)throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof i.progressFn}", equal to ${JSON.stringify(i.progressFn,null,4)}`);if(i.mergeType&&1!=+i.mergeType&&2!=+i.mergeType)throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof i.mergeType}", equal to ${JSON.stringify(i.mergeType,null,4)}`);if("boolean"!=typeof i.joinRangesThatTouchEdges)throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof i.joinRangesThatTouchEdges}", equal to ${JSON.stringify(i.joinRangesThatTouchEdges,null,4)}`)}else i={...s};const o=e.filter((e=>e)).map((e=>[...e])).filter((e=>void 0!==e[2]||e[0]!==e[1]));let a,l,g;if(a=i.progressFn?n(o,{progressFn:e=>{g=Math.floor(e/5),g!==l&&(l=g,i.progressFn(g))}}):n(o),!a)return null;const u=a.length-1;for(let e=u;e>0;e--)i.progressFn&&(g=Math.floor(78*(1-e/u))+21,g!==l&&g>l&&(l=g,i.progressFn(g))),(a[e][0]<=a[e-1][0]||!i.joinRangesThatTouchEdges&&a[e][0]<a[e-1][1]||i.joinRangesThatTouchEdges&&a[e][0]<=a[e-1][1])&&(a[e-1][0]=Math.min(a[e][0],a[e-1][0]),a[e-1][1]=Math.max(a[e][1],a[e-1][1]),void 0!==a[e][2]&&(a[e-1][0]>=a[e][0]||a[e-1][1]<=a[e][1])&&null!==a[e-1][2]&&(null===a[e][2]&&null!==a[e-1][2]?a[e-1][2]=null:null!=a[e-1][2]?2==+i.mergeType&&a[e-1][0]===a[e][0]?a[e-1][2]=a[e][2]:a[e-1][2]+=a[e][2]:a[e-1][2]=a[e][2]),a.splice(e,1),e=a.length);return a.length?a:null}(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map((e=>i(e[2])?[e[0],e[1],r(e[2],this.opts.limitLinebreaksCount)]:e)):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length){if(!Array.isArray(e[0])||!o(e[0][0]))throw new Error(`ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ${JSON.stringify(e[0],null,4)} should be an array and its first element should be an integer, a string index.`);this.ranges=Array.from(e)}else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}},e.defaults=l,e.version="5.1.0",Object.defineProperty(e,"__esModule",{value:!0})}));
diff --git a/school/node_modules/ranges-push/examples/_quickTake.js b/school/node_modules/ranges-push/examples/_quickTake.js
deleted file mode 100644
index c1e6429..0000000
--- a/school/node_modules/ranges-push/examples/_quickTake.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Quick Take
-
-import { strict as assert } from "assert";
-import { Ranges } from "../dist/ranges-push.esm.js";
-import { rApply } from "../../ranges-apply";
-
-const gatheredRanges = new Ranges();
-
-const oldString = `The quick brown fox jumps over the lazy dog.`;
-
-// push the ranges
-gatheredRanges.push(35, 43, "little Red Riding Hood");
-gatheredRanges.push(4, 19, "bad grey wolf");
-
-// retrieve the merged and sorted ranges by calling .current()
-assert.deepEqual(gatheredRanges.current(), [
- [4, 19, "bad grey wolf"],
- [35, 43, "little Red Riding Hood"],
-]);
-
-assert.equal(
- rApply(oldString, gatheredRanges.current()),
- "The bad grey wolf jumps over the little Red Riding Hood."
-);
-
-// wipe all gathered ranges
-gatheredRanges.wipe();
-assert.equal(gatheredRanges.current(), null);
diff --git a/school/node_modules/ranges-push/examples/api.json b/school/node_modules/ranges-push/examples/api.json
deleted file mode 100644
index c06ba17..0000000
--- a/school/node_modules/ranges-push/examples/api.json
+++ /dev/null
@@ -1 +0,0 @@
-{"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; Ranges &#x7D; from \"ranges-push\";\nimport &#x7B; rApply &#x7D; from \"ranges-apply\";\n\nconst gatheredRanges = new Ranges();\n\nconst oldString = `The quick brown fox jumps over the lazy dog.`;\n\n// push the ranges\ngatheredRanges.push(35, 43, \"little Red Riding Hood\");\ngatheredRanges.push(4, 19, \"bad grey wolf\");\n\n// retrieve the merged and sorted ranges by calling .current()\nassert.deepEqual(gatheredRanges.current(), [\n [4, 19, \"bad grey wolf\"],\n [35, 43, \"little Red Riding Hood\"],\n]);\n\nassert.equal(\n rApply(oldString, gatheredRanges.current()),\n \"The bad grey wolf jumps over the little Red Riding Hood.\"\n);\n\n// wipe all gathered ranges\ngatheredRanges.wipe();\nassert.equal(gatheredRanges.current(), null);"}} \ No newline at end of file
diff --git a/school/node_modules/ranges-push/package.json b/school/node_modules/ranges-push/package.json
deleted file mode 100644
index b681f7e..0000000
--- a/school/node_modules/ranges-push/package.json
+++ /dev/null
@@ -1,120 +0,0 @@
-{
- "name": "ranges-push",
- "version": "5.1.0",
- "description": "Gather string index ranges",
- "keywords": [
- "delete",
- "from",
- "many",
- "multiple",
- "ranges",
- "replace",
- "slice",
- "slices",
- "splice",
- "string"
- ],
- "homepage": "https://codsen.com/os/ranges-push/",
- "repository": {
- "type": "git",
- "url": "https://github.com/codsen/codsen.git",
- "directory": "packages/ranges-push"
- },
- "license": "MIT",
- "author": {
- "name": "Roy Revelt",
- "email": "roy@codsen.com",
- "url": "https://codsen.com"
- },
- "main": "dist/ranges-push.cjs.js",
- "module": "dist/ranges-push.esm.js",
- "browser": "dist/ranges-push.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": "{ Ranges }",
- "various": {
- "devDependencies": []
- }
- },
- "dependencies": {
- "@babel/runtime": "^7.14.0",
- "ranges-merge": "^7.1.0",
- "string-collapse-leading-whitespace": "^5.1.0",
- "string-trim-spaces-only": "^3.1.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/school/node_modules/ranges-push/types/index.d.ts b/school/node_modules/ranges-push/types/index.d.ts
deleted file mode 100644
index d116ae9..0000000
--- a/school/node_modules/ranges-push/types/index.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-declare type Range = [from: number, to: number] | [from: number, to: number, whatToInsert: string | null | undefined];
-
-declare const version: string;
-
-interface Opts {
- limitToBeAddedWhitespace: boolean;
- limitLinebreaksCount: number;
- mergeType: 1 | 2 | "1" | "2" | undefined;
-}
-declare const defaults: Opts;
-declare class Ranges {
- constructor(originalOpts?: Partial<Opts>);
- ranges: Range[];
- opts: Opts;
- add(originalFrom: number, originalTo?: number, addVal?: undefined | null | string): void;
- add(originalFrom: Range[] | null): void;
- add(originalFrom: Range | null): void;
- push(originalFrom: number, originalTo?: number, addVal?: undefined | null | string): void;
- push(originalFrom: Range[] | null): void;
- push(originalFrom: Range | null): void;
- current(): null | Range[];
- wipe(): void;
- replace(givenRanges: Range[]): void;
- last(): Range | null;
-}
-
-export { Range, Ranges, defaults, version };