summaryrefslogtreecommitdiff
path: root/school/node_modules/ranges-apply
diff options
context:
space:
mode:
Diffstat (limited to 'school/node_modules/ranges-apply')
-rw-r--r--school/node_modules/ranges-apply/CHANGELOG.md155
-rw-r--r--school/node_modules/ranges-apply/LICENSE22
-rw-r--r--school/node_modules/ranges-apply/README.md64
-rw-r--r--school/node_modules/ranges-apply/dist/ranges-apply.cjs.js117
-rw-r--r--school/node_modules/ranges-apply/dist/ranges-apply.dev.umd.js294
-rw-r--r--school/node_modules/ranges-apply/dist/ranges-apply.esm.js103
-rw-r--r--school/node_modules/ranges-apply/dist/ranges-apply.umd.js26
-rw-r--r--school/node_modules/ranges-apply/examples/_quickTake.js14
-rw-r--r--school/node_modules/ranges-apply/examples/api.json1
-rw-r--r--school/node_modules/ranges-apply/package.json118
-rw-r--r--school/node_modules/ranges-apply/types/index.d.ts8
11 files changed, 922 insertions, 0 deletions
diff --git a/school/node_modules/ranges-apply/CHANGELOG.md b/school/node_modules/ranges-apply/CHANGELOG.md
new file mode 100644
index 0000000..9282295
--- /dev/null
+++ b/school/node_modules/ranges-apply/CHANGELOG.md
@@ -0,0 +1,155 @@
+# 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.3 (2021-02-07)
+
+### Bug Fixes
+
+- passed ranges can be null ([ed082b8](https://github.com/codsen/codsen/commit/ed082b8b87aec7e909e1b523ab70e9debeabb00b))
+
+## 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 and start using named exports ([202b763](https://github.com/codsen/codsen/commit/202b763cd2219d6beae0d346237b538789f4d67f))
+
+### BREAKING CHANGES
+
+- previously: `import rApply from ...` - now `import { rApply } from ...`
+
+## 4.0.0 (2020-11-28)
+
+Accidental version bump during migration to sourcehut. Sorry about that.
+
+## 3.2.0 (2020-09-07)
+
+### Bug Fixes
+
+- make all tests pass ([d86cf1b](https://gitlab.com/codsen/codsen/commit/d86cf1bca9b0ac38e5bf141ed4ffd44c935ef51c))
+
+### Features
+
+- discard any nulls among ranges ([2a09e88](https://gitlab.com/codsen/codsen/commit/2a09e88fb3a7b50be255b4cfb265bf0b8542e4ee))
+
+## 3.1.5 (2020-04-26)
+
+### Bug Fixes
+
+- harden the eslint rules set and make all tests pass ([3b593b4](https://gitlab.com/codsen/codsen/commit/3b593b495f645005780a26ab8d719aa7d1846dd0))
+
+## 3.1.0 (2020-01-26)
+
+### Features
+
+- remove a dependency, speed up the program by 130% ([b787194](https://gitlab.com/codsen/codsen/commit/b787194c39e2e688fc50d63795412ba5339692fd))
+
+## 2.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
+
+## 2.9.0 (2018-12-26)
+
+- ✨ Add 3rd input arg - progressFn ([f6735e2](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-apply/commits/f6735e2))
+- ✨ Accept `null` as second input argument, instead of ranges ([0c59484](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-apply/commits/0c59484))
+- ✨ [`ranges-merge`](https://www.npmjs.com/package/ranges-merge) (sort + merge) is applied by default now to prevent errors on unsorted ranges ([35e3c4b](https://gitlab.com/codsen/codsen/tree/master/packages/ranges-apply/commits/35e3c4b))
+
+## 2.8.0 (2018-11-29)
+
+- ✨ Added third argument, `progressFn` — it reports progress, feeding natural numbers meaning percentage done to any function that is in the third input argument.
+- ✨ Pinned all the throws on all unit tests. "Pinning unit test throws" means we not just assert the fact that function threw, but match the throw's error message too. This gives more assurance:
+
+ 1. When there are many cases when an algorithm can throw and generic "function threw" assertion is used, a unit test can anticipate one throw to be thrown but another was thrown. Generic "function threw" assertions would still pass, throw is throw after all. But not pinned throws:
+ 2. It's easier to sort unit tests this way (order by throw ID) in a test file
+ 3. It's easier to perfect the unit test coverage when throws can be easier identified.
+ 4. It's faster to comprehend a number compared to a sentence. "THROW_ID_01" is faster to comprehend than a full title (which can differ from other title by a single word). At the end of the day, being less tired means achieving more.
+
+ ```js
+ const error1 = t.throws(() => {
+ repl();
+ });
+ t.match(error1.message, /THROW_ID_01/);
+ ```
+
+## 2.7.0 (2018-10-25)
+
+- ✨ Updated all dependencies
+- ✨ Restored coveralls.io reporting
+- ✨ Restored unit test linting
+
+## 2.6.0 (2018-08-29)
+
+- ✨ Now second argument, ranges array, can be `null`. This means, output of [ranges-push](https://www.npmjs.com/package/ranges-push) classes method`.current()` can be fed directly into this library without even checking. If it's null, original string will be returned.
+
+## 2.5.0 (2018-08-16)
+
+- ✨ Now we merge all input ranges using [ranges-merge](https://www.npmjs.com/package/ranges-merge) because it's necessary for algorithm and we can't rely on user to always provide merged ranges only.
+
+## 2.4.0 (2018-08-11)
+
+- ✨ Updated error labels
+- ✨ Updated all dependencies
+- ✨ Removed AVA ES linting rules and `nyc` code coverage build steps because we migrated to Babel v.7 and `nyc` breaks
+
+## 2.3.0 (2018-06-18)
+
+- ✨ Renamed to `ranges-apply` and migrated to Bitbucket.
+
+## 2.2.0 (2018-05-11)
+
+- ✨ 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 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.1.0 (2018-02-13)
+
+- ✨ Now accepts a single range as well, not only array of ranges.
+
+## 2.0.0 (2017-11-02)
+
+- ✨ The main source now is in ES2015 modules with `import`/`export`.
+- ✨ Implemented Rollup to generate 3 flavours of this package: CommonJS, UMD and ESM `module` with `import`/`export`.
+
+## 1.4.0 (2017-09-19)
+
+- 🔧 Switching to ESLint on `airbnb-base` preset with semicolons-off override. JS Standard is rubbish because it's too relaxed and it's been using half-year-old ESLint. Actually it's even flagged as insecure by BitHound at the moment because of shell.js dependency two levels deep. ESLint itself is fine however.
+- 💥 Removed _options_, the third input argument. It did nothing and I was expecting to add options, but now I don't want any. I removed the unused code related to options.
+
+## 1.3.0 (2017-08-30)
+
+- 🔧 OK, so after replacing ES6 template strings, the `let`s stopped minification of [emailcomb](https://emailcomb.com). I came up with idea to transpile the source to `/es5/index.js`, after publishing it should be available for consumption via `require('string-replace-slices-array/es5')`. Let's see how it goes.
+- 🔧 I restored all template strings as they were in `v1.1.0`.
+- 🔧 Tweaked the npm scripts, so ES5 version is generated as a pre-commit step.
+
+## 1.2.0 (2017-08-29)
+
+- 🔧 Guys, strange stuff. I was generating a production build of [emailcomb](https://emailcomb.com) and it refused to minify this library because of the first backtick in the ES6 template strings. So, I replaced them with ES5 code. Let's see how it will go.
+
+## 1.1.0 (2017-08-16)
+
+- 🔧 Now allowing zeros as values in ranges too. Sorry about that, the integer-checking library was not accepting zeros. Fixed now.
+
+## 1.0.0 (2017-07-25)
+
+- ✨ First public release
diff --git a/school/node_modules/ranges-apply/LICENSE b/school/node_modules/ranges-apply/LICENSE
new file mode 100644
index 0000000..9ea205b
--- /dev/null
+++ b/school/node_modules/ranges-apply/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/school/node_modules/ranges-apply/README.md b/school/node_modules/ranges-apply/README.md
new file mode 100644
index 0000000..6e21a8a
--- /dev/null
+++ b/school/node_modules/ranges-apply/README.md
@@ -0,0 +1,64 @@
+# ranges-apply
+
+> Take an array of string index ranges, delete/replace the string according to them
+
+<div class="package-badges">
+ <a href="https://www.npmjs.com/package/ranges-apply" 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-apply" 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-apply" 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-apply?interval=30" rel="nofollow noreferrer noopener" target="_blank">
+ <img src="https://img.shields.io/npm/dm/ranges-apply.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-apply
+```
+
+## Quick Take
+
+```js
+import { strict as assert } from "assert";
+import { rApply } from "ranges-apply";
+
+const oldString = `The quick brown fox jumps over the lazy dog.`;
+const ranges = [
+ [4, 19, "bad grey wolf"],
+ [35, 43, "little Red Riding Hood"],
+];
+assert.equal(
+ rApply(oldString, ranges),
+ "The bad grey wolf jumps over the little Red Riding Hood."
+);
+```
+
+## Documentation
+
+Please [visit codsen.com](https://codsen.com/os/ranges-apply/) 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-apply/dist/ranges-apply.cjs.js b/school/node_modules/ranges-apply/dist/ranges-apply.cjs.js
new file mode 100644
index 0000000..e0e1278
--- /dev/null
+++ b/school/node_modules/ranges-apply/dist/ranges-apply.cjs.js
@@ -0,0 +1,117 @@
+/**
+ * @name ranges-apply
+ * @fileoverview Take an array of string index ranges, delete/replace the string according to them
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/ranges-apply/}
+ */
+
+'use strict';
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+var _typeof = require('@babel/runtime/helpers/typeof');
+var rangesMerge = require('ranges-merge');
+
+function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
+
+var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
+
+var version$1 = "5.1.0";
+
+var version = version$1;
+function rApply(str, originalRangesArr, _progressFn) {
+ var percentageDone = 0;
+ var lastPercentageDone = 0;
+ if (arguments.length === 0) {
+ throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
+ }
+ if (typeof str !== "string") {
+ throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(_typeof__default['default'](str), ", equal to: ").concat(JSON.stringify(str, null, 4)));
+ }
+ if (originalRangesArr && !Array.isArray(originalRangesArr)) {
+ throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(_typeof__default['default'](originalRangesArr), ", equal to: ").concat(JSON.stringify(originalRangesArr, null, 4)));
+ }
+ if (_progressFn && typeof _progressFn !== "function") {
+ throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(_typeof__default['default'](_progressFn), ", equal to: ").concat(JSON.stringify(_progressFn, null, 4)));
+ }
+ if (!originalRangesArr || !originalRangesArr.filter(function (range) {
+ return range;
+ }).length) {
+ return str;
+ }
+ var rangesArr;
+ if (Array.isArray(originalRangesArr) && Number.isInteger(originalRangesArr[0]) && Number.isInteger(originalRangesArr[1])) {
+ rangesArr = [Array.from(originalRangesArr)];
+ } else {
+ rangesArr = Array.from(originalRangesArr);
+ }
+ var len = rangesArr.length;
+ var counter = 0;
+ rangesArr.filter(function (range) {
+ return range;
+ }).forEach(function (el, i) {
+ if (_progressFn) {
+ percentageDone = Math.floor(counter / len * 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ _progressFn(percentageDone);
+ }
+ }
+ if (!Array.isArray(el)) {
+ throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(i, "th element not an array: ").concat(JSON.stringify(el, null, 4), ", which is ").concat(_typeof__default['default'](el)));
+ }
+ if (!Number.isInteger(el[0])) {
+ if (!Number.isInteger(+el[0]) || +el[0] < 0) {
+ throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(i, "th element, array ").concat(JSON.stringify(el, null, 0), ". Its first element is not an integer, string index, but ").concat(_typeof__default['default'](el[0]), ", equal to: ").concat(JSON.stringify(el[0], null, 4), "."));
+ } else {
+ rangesArr[i][0] = +rangesArr[i][0];
+ }
+ }
+ if (!Number.isInteger(el[1])) {
+ if (!Number.isInteger(+el[1]) || +el[1] < 0) {
+ throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(i, "th element, array ").concat(JSON.stringify(el, null, 0), ". Its second element is not an integer, string index, but ").concat(_typeof__default['default'](el[1]), ", equal to: ").concat(JSON.stringify(el[1], null, 4), "."));
+ } else {
+ rangesArr[i][1] = +rangesArr[i][1];
+ }
+ }
+ counter += 1;
+ });
+ var workingRanges = rangesMerge.rMerge(rangesArr, {
+ progressFn: function progressFn(perc) {
+ if (_progressFn) {
+ percentageDone = 10 + Math.floor(perc / 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ _progressFn(percentageDone);
+ }
+ }
+ }
+ });
+ var len2 = Array.isArray(workingRanges) ? workingRanges.length : 0;
+ /* istanbul ignore else */
+ if (len2 > 0) {
+ var tails = str.slice(workingRanges[len2 - 1][1]);
+ str = workingRanges.reduce(function (acc, _val, i, arr) {
+ if (_progressFn) {
+ percentageDone = 20 + Math.floor(i / len2 * 80);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ _progressFn(percentageDone);
+ }
+ }
+ var beginning = i === 0 ? 0 : arr[i - 1][1];
+ var ending = arr[i][0];
+ return acc + str.slice(beginning, ending) + (arr[i][2] || "");
+ }, "");
+ str += tails;
+ }
+ return str;
+}
+
+exports.rApply = rApply;
+exports.version = version;
diff --git a/school/node_modules/ranges-apply/dist/ranges-apply.dev.umd.js b/school/node_modules/ranges-apply/dist/ranges-apply.dev.umd.js
new file mode 100644
index 0000000..03cc17b
--- /dev/null
+++ b/school/node_modules/ranges-apply/dist/ranges-apply.dev.umd.js
@@ -0,0 +1,294 @@
+/**
+ * @name ranges-apply
+ * @fileoverview Take an array of string index ranges, delete/replace the string according to them
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/ranges-apply/}
+ */
+
+(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.rangesApply = {}));
+}(this, (function (exports) { 'use strict';
+
+/**
+ * @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$1 = {
+ strictlyTwoElementsInRangeArrays: false,
+ progressFn: null
+};
+function rSort(arrOfRanges, originalOptions) {
+ if (!Array.isArray(arrOfRanges) || !arrOfRanges.length) {
+ return arrOfRanges;
+ }
+ const opts = { ...defaults$1,
+ ...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 = {
+ 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,
+ ...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
+ };
+ }
+ 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";
+
+const version = version$1;
+function rApply(str, originalRangesArr, progressFn) {
+ let percentageDone = 0;
+ let lastPercentageDone = 0;
+ if (arguments.length === 0) {
+ throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
+ }
+ if (typeof str !== "string") {
+ throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof str}, equal to: ${JSON.stringify(str, null, 4)}`);
+ }
+ if (originalRangesArr && !Array.isArray(originalRangesArr)) {
+ throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof originalRangesArr}, equal to: ${JSON.stringify(originalRangesArr, null, 4)}`);
+ }
+ if (progressFn && typeof progressFn !== "function") {
+ throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof progressFn}, equal to: ${JSON.stringify(progressFn, null, 4)}`);
+ }
+ if (!originalRangesArr ||
+ !originalRangesArr.filter((range) => range).length) {
+ // quick ending - no ranges passed
+ return str;
+ }
+ let rangesArr;
+ if (Array.isArray(originalRangesArr) &&
+ Number.isInteger(originalRangesArr[0]) &&
+ Number.isInteger(originalRangesArr[1])) {
+ // if single array was passed, wrap it into an array
+ rangesArr = [Array.from(originalRangesArr)];
+ }
+ else {
+ rangesArr = Array.from(originalRangesArr);
+ }
+ // allocate first 10% of progress to this stage
+ const len = rangesArr.length;
+ let counter = 0;
+ rangesArr
+ .filter((range) => range)
+ .forEach((el, i) => {
+ if (progressFn) {
+ percentageDone = Math.floor((counter / len) * 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ if (!Array.isArray(el)) {
+ throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${i}th element not an array: ${JSON.stringify(el, null, 4)}, which is ${typeof el}`);
+ }
+ if (!Number.isInteger(el[0])) {
+ if (!Number.isInteger(+el[0]) || +el[0] < 0) {
+ throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${i}th element, array ${JSON.stringify(el, null, 0)}. Its first element is not an integer, string index, but ${typeof el[0]}, equal to: ${JSON.stringify(el[0], null, 4)}.`);
+ }
+ else {
+ rangesArr[i][0] = +rangesArr[i][0];
+ }
+ }
+ if (!Number.isInteger(el[1])) {
+ if (!Number.isInteger(+el[1]) || +el[1] < 0) {
+ throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${i}th element, array ${JSON.stringify(el, null, 0)}. Its second element is not an integer, string index, but ${typeof el[1]}, equal to: ${JSON.stringify(el[1], null, 4)}.`);
+ }
+ else {
+ rangesArr[i][1] = +rangesArr[i][1];
+ }
+ }
+ counter += 1;
+ });
+ // allocate another 10% of the progress indicator length to the rangesMerge step:
+ const workingRanges = rMerge(rangesArr, {
+ progressFn: (perc) => {
+ if (progressFn) {
+ // since "perc" is already from zero to hundred, we just divide by 10 and
+ // get the range from zero to ten:
+ percentageDone = 10 + Math.floor(perc / 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ },
+ });
+ // allocate the rest 80% to the actual string assembly:
+ const len2 = Array.isArray(workingRanges) ? workingRanges.length : 0;
+ /* istanbul ignore else */
+ if (len2 > 0) {
+ const tails = str.slice(workingRanges[len2 - 1][1]);
+ // eslint-disable-next-line no-param-reassign
+ str = workingRanges.reduce((acc, _val, i, arr) => {
+ if (progressFn) {
+ // since "perc" is already from zero to hundred, we just divide by 10 and
+ // get the range from zero to ten:
+ percentageDone = 20 + Math.floor((i / len2) * 80);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ const beginning = i === 0 ? 0 : arr[i - 1][1];
+ const ending = arr[i][0];
+ return acc + str.slice(beginning, ending) + (arr[i][2] || "");
+ }, "");
+ // eslint-disable-next-line no-param-reassign
+ str += tails;
+ }
+ return str;
+}
+
+exports.rApply = rApply;
+exports.version = version;
+
+Object.defineProperty(exports, '__esModule', { value: true });
+
+})));
diff --git a/school/node_modules/ranges-apply/dist/ranges-apply.esm.js b/school/node_modules/ranges-apply/dist/ranges-apply.esm.js
new file mode 100644
index 0000000..16073b1
--- /dev/null
+++ b/school/node_modules/ranges-apply/dist/ranges-apply.esm.js
@@ -0,0 +1,103 @@
+/**
+ * @name ranges-apply
+ * @fileoverview Take an array of string index ranges, delete/replace the string according to them
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/ranges-apply/}
+ */
+
+import { rMerge } from 'ranges-merge';
+
+var version$1 = "5.1.0";
+
+const version = version$1;
+function rApply(str, originalRangesArr, progressFn) {
+ let percentageDone = 0;
+ let lastPercentageDone = 0;
+ if (arguments.length === 0) {
+ throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");
+ }
+ if (typeof str !== "string") {
+ throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof str}, equal to: ${JSON.stringify(str, null, 4)}`);
+ }
+ if (originalRangesArr && !Array.isArray(originalRangesArr)) {
+ throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof originalRangesArr}, equal to: ${JSON.stringify(originalRangesArr, null, 4)}`);
+ }
+ if (progressFn && typeof progressFn !== "function") {
+ throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof progressFn}, equal to: ${JSON.stringify(progressFn, null, 4)}`);
+ }
+ if (!originalRangesArr || !originalRangesArr.filter(range => range).length) {
+ return str;
+ }
+ let rangesArr;
+ if (Array.isArray(originalRangesArr) && Number.isInteger(originalRangesArr[0]) && Number.isInteger(originalRangesArr[1])) {
+ rangesArr = [Array.from(originalRangesArr)];
+ } else {
+ rangesArr = Array.from(originalRangesArr);
+ }
+ const len = rangesArr.length;
+ let counter = 0;
+ rangesArr.filter(range => range).forEach((el, i) => {
+ if (progressFn) {
+ percentageDone = Math.floor(counter / len * 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ if (!Array.isArray(el)) {
+ throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${i}th element not an array: ${JSON.stringify(el, null, 4)}, which is ${typeof el}`);
+ }
+ if (!Number.isInteger(el[0])) {
+ if (!Number.isInteger(+el[0]) || +el[0] < 0) {
+ throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${i}th element, array ${JSON.stringify(el, null, 0)}. Its first element is not an integer, string index, but ${typeof el[0]}, equal to: ${JSON.stringify(el[0], null, 4)}.`);
+ } else {
+ rangesArr[i][0] = +rangesArr[i][0];
+ }
+ }
+ if (!Number.isInteger(el[1])) {
+ if (!Number.isInteger(+el[1]) || +el[1] < 0) {
+ throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${i}th element, array ${JSON.stringify(el, null, 0)}. Its second element is not an integer, string index, but ${typeof el[1]}, equal to: ${JSON.stringify(el[1], null, 4)}.`);
+ } else {
+ rangesArr[i][1] = +rangesArr[i][1];
+ }
+ }
+ counter += 1;
+ });
+ const workingRanges = rMerge(rangesArr, {
+ progressFn: perc => {
+ if (progressFn) {
+ percentageDone = 10 + Math.floor(perc / 10);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ }
+ });
+ const len2 = Array.isArray(workingRanges) ? workingRanges.length : 0;
+ /* istanbul ignore else */
+ if (len2 > 0) {
+ const tails = str.slice(workingRanges[len2 - 1][1]);
+ str = workingRanges.reduce((acc, _val, i, arr) => {
+ if (progressFn) {
+ percentageDone = 20 + Math.floor(i / len2 * 80);
+ /* istanbul ignore else */
+ if (percentageDone !== lastPercentageDone) {
+ lastPercentageDone = percentageDone;
+ progressFn(percentageDone);
+ }
+ }
+ const beginning = i === 0 ? 0 : arr[i - 1][1];
+ const ending = arr[i][0];
+ return acc + str.slice(beginning, ending) + (arr[i][2] || "");
+ }, "");
+ str += tails;
+ }
+ return str;
+}
+
+export { rApply, version };
diff --git a/school/node_modules/ranges-apply/dist/ranges-apply.umd.js b/school/node_modules/ranges-apply/dist/ranges-apply.umd.js
new file mode 100644
index 0000000..33ef9fc
--- /dev/null
+++ b/school/node_modules/ranges-apply/dist/ranges-apply.umd.js
@@ -0,0 +1,26 @@
+/**
+ * @name ranges-apply
+ * @fileoverview Take an array of string index ranges, delete/replace the string according to them
+ * @version 5.1.0
+ * @author Roy Revelt, Codsen Ltd
+ * @license MIT
+ * {@link https://codsen.com/os/ranges-apply/}
+ */
+
+!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).rangesApply={})}(this,(function(e){"use strict";
+/**
+ * @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 r={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function n(e,n){if(!Array.isArray(e)||!e.length)return e;const t={...r,...n};let s,o;if(t.strictlyTwoElementsInRangeArrays&&!e.filter((e=>e)).every(((e,r)=>2===e.length||(s=r,o=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 ${o} 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 i=e.filter((e=>e)).length**2;let a=0;return Array.from(e).filter((e=>e)).sort(((e,r)=>(t.progressFn&&(a+=1,t.progressFn(Math.floor(100*a/i))),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 t={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function s(e,r){function s(e){return e&&"object"==typeof e&&!Array.isArray(e)}if(!Array.isArray(e)||!e.length)return null;let o;if(r){if(!s(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(o={...t,...r},o.progressFn&&s(o.progressFn)&&!Object.keys(o.progressFn).length)o.progressFn=null;else if(o.progressFn&&"function"!=typeof o.progressFn)throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof o.progressFn}", equal to ${JSON.stringify(o.progressFn,null,4)}`);if(o.mergeType&&1!=+o.mergeType&&2!=+o.mergeType)throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof o.mergeType}", equal to ${JSON.stringify(o.mergeType,null,4)}`);if("boolean"!=typeof o.joinRangesThatTouchEdges)throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof o.joinRangesThatTouchEdges}", equal to ${JSON.stringify(o.joinRangesThatTouchEdges,null,4)}`)}else o={...t};const i=e.filter((e=>e)).map((e=>[...e])).filter((e=>void 0!==e[2]||e[0]!==e[1]));let a,l,g;if(a=o.progressFn?n(i,{progressFn:e=>{g=Math.floor(e/5),g!==l&&(l=g,o.progressFn(g))}}):n(i),!a)return null;const u=a.length-1;for(let e=u;e>0;e--)o.progressFn&&(g=Math.floor(78*(1-e/u))+21,g!==l&&g>l&&(l=g,o.progressFn(g))),(a[e][0]<=a[e-1][0]||!o.joinRangesThatTouchEdges&&a[e][0]<a[e-1][1]||o.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==+o.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}e.rApply=function(e,r,n){let t,o=0,i=0;if(0===arguments.length)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if("string"!=typeof e)throw new TypeError(`ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(r&&!Array.isArray(r))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(n&&"function"!=typeof n)throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof n}, equal to: ${JSON.stringify(n,null,4)}`);if(!r||!r.filter((e=>e)).length)return e;t=Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?[Array.from(r)]:Array.from(r);const a=t.length;let l=0;t.filter((e=>e)).forEach(((e,r)=>{if(n&&(o=Math.floor(l/a*10),o!==i&&(i=o,n(o))),!Array.isArray(e))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${r}th element not an array: ${JSON.stringify(e,null,4)}, which is ${typeof e}`);if(!Number.isInteger(e[0])){if(!Number.isInteger(+e[0])||+e[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${r}th element, array ${JSON.stringify(e,null,0)}. Its first element is not an integer, string index, but ${typeof e[0]}, equal to: ${JSON.stringify(e[0],null,4)}.`);t[r][0]=+t[r][0]}if(!Number.isInteger(e[1])){if(!Number.isInteger(+e[1])||+e[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${r}th element, array ${JSON.stringify(e,null,0)}. Its second element is not an integer, string index, but ${typeof e[1]}, equal to: ${JSON.stringify(e[1],null,4)}.`);t[r][1]=+t[r][1]}l+=1}));const g=s(t,{progressFn:e=>{n&&(o=10+Math.floor(e/10),o!==i&&(i=o,n(o)))}}),u=Array.isArray(g)?g.length:0;if(u>0){const r=e.slice(g[u-1][1]);e=g.reduce(((r,t,s,a)=>{n&&(o=20+Math.floor(s/u*80),o!==i&&(i=o,n(o)));return r+e.slice(0===s?0:a[s-1][1],a[s][0])+(a[s][2]||"")}),""),e+=r}return e},e.version="5.1.0",Object.defineProperty(e,"__esModule",{value:!0})}));
diff --git a/school/node_modules/ranges-apply/examples/_quickTake.js b/school/node_modules/ranges-apply/examples/_quickTake.js
new file mode 100644
index 0000000..d32aa59
--- /dev/null
+++ b/school/node_modules/ranges-apply/examples/_quickTake.js
@@ -0,0 +1,14 @@
+// Quick Take
+
+import { strict as assert } from "assert";
+import { rApply } from "../dist/ranges-apply.esm.js";
+
+const oldString = `The quick brown fox jumps over the lazy dog.`;
+const ranges = [
+ [4, 19, "bad grey wolf"],
+ [35, 43, "little Red Riding Hood"],
+];
+assert.equal(
+ rApply(oldString, ranges),
+ "The bad grey wolf jumps over the little Red Riding Hood."
+);
diff --git a/school/node_modules/ranges-apply/examples/api.json b/school/node_modules/ranges-apply/examples/api.json
new file mode 100644
index 0000000..6e3e3f1
--- /dev/null
+++ b/school/node_modules/ranges-apply/examples/api.json
@@ -0,0 +1 @@
+{"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; rApply &#x7D; from \"ranges-apply\";\n\nconst oldString = `The quick brown fox jumps over the lazy dog.`;\nconst ranges = [\n [4, 19, \"bad grey wolf\"],\n [35, 43, \"little Red Riding Hood\"],\n];\nassert.equal(\n rApply(oldString, ranges),\n \"The bad grey wolf jumps over the little Red Riding Hood.\"\n);"}} \ No newline at end of file
diff --git a/school/node_modules/ranges-apply/package.json b/school/node_modules/ranges-apply/package.json
new file mode 100644
index 0000000..889e8d0
--- /dev/null
+++ b/school/node_modules/ranges-apply/package.json
@@ -0,0 +1,118 @@
+{
+ "name": "ranges-apply",
+ "version": "5.1.0",
+ "description": "Take an array of string index ranges, delete/replace the string according to them",
+ "keywords": [
+ "delete",
+ "from",
+ "many",
+ "multiple",
+ "ranges",
+ "replace",
+ "slice",
+ "slices",
+ "splice",
+ "string"
+ ],
+ "homepage": "https://codsen.com/os/ranges-apply/",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/codsen/codsen.git",
+ "directory": "packages/ranges-apply"
+ },
+ "license": "MIT",
+ "author": {
+ "name": "Roy Revelt",
+ "email": "roy@codsen.com",
+ "url": "https://codsen.com"
+ },
+ "main": "dist/ranges-apply.cjs.js",
+ "module": "dist/ranges-apply.esm.js",
+ "browser": "dist/ranges-apply.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": "{ rApply }",
+ "various": {
+ "devDependencies": []
+ }
+ },
+ "dependencies": {
+ "@babel/runtime": "^7.14.0",
+ "ranges-merge": "^7.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-apply/types/index.d.ts b/school/node_modules/ranges-apply/types/index.d.ts
new file mode 100644
index 0000000..22e6bc2
--- /dev/null
+++ b/school/node_modules/ranges-apply/types/index.d.ts
@@ -0,0 +1,8 @@
+declare type Range = [from: number, to: number] | [from: number, to: number, whatToInsert: string | null | undefined];
+declare type Ranges = Range[] | null;
+
+declare const version: string;
+
+declare function rApply(str: string, originalRangesArr: Ranges, progressFn?: (percentageDone: number) => void): string;
+
+export { rApply, version };