From e8c9bc52010b2e8211b32d5fecf4495302b116a3 Mon Sep 17 00:00:00 2001
From: Yanick Champoux
Date: Tue, 27 Feb 2024 12:46:23 -0500
Subject: [PATCH] move back the documentation in the README
---
README.md | 411 ++++++++++++++++++++++++++++++++++++-
docs/.nojekyll | 0
docs/_navbar.md | 2 -
docs/docsify-namespaced.js | 95 ---------
docs/index.html | 60 ------
docs/latest/README.md | 108 ----------
docs/latest/_navbar.md | 2 -
docs/latest/api.md | 326 -----------------------------
docs/vendor/docsify.js | 1 -
docs/vendor/themes/vue.css | 1 -
10 files changed, 409 insertions(+), 597 deletions(-)
delete mode 100644 docs/.nojekyll
delete mode 100644 docs/_navbar.md
delete mode 100644 docs/docsify-namespaced.js
delete mode 100644 docs/index.html
delete mode 100644 docs/latest/README.md
delete mode 100644 docs/latest/_navbar.md
delete mode 100644 docs/latest/api.md
delete mode 100644 docs/vendor/docsify.js
delete mode 100644 docs/vendor/themes/vue.css
diff --git a/README.md b/README.md
index 6cb1d93..c5b406c 100644
--- a/README.md
+++ b/README.md
@@ -5,11 +5,418 @@
## About
-This is a fork of the main [updeep](https://github.com/substantial/updeep) package.
+> π‘ This is a fork of the main [updeep](https://github.com/substantial/updeep) package. For ease of reading — not to mention ease of shamelessly lifting large pieces of the original documentation — in this documentation all mentions of `updeep` refers to this fork.
updeep makes updating deeply nested objects/arrays painless by allowing you to
declare the updates you would like to make and it will take care of the rest. It
will recursively return the same instance if no changes have been made, making
it ideal for using reference equality checks to detect changes.
-Full documentation can be found at [https://yanick.github.io/updeep-remeda/index.html](https://yanick.github.io/updeep-remeda/index.html).
+Because of this, everything returned by updeep is frozen. Not only that, but
+updeep assumes that every object passed in to update is immutable, so it may
+freeze objects passed in as well. Note that the freezing only happens in
+development.
+
+This fork of updeep requires Remeda, but works very well with any other utility function ([lodash], [Ramda], etc).
+
+## Differences with the original Updeep
+
+- Under the hood, the use of lodash has
+ been replaced by Remeda (for better type support and tree-shaking abilities).
+
+- The codebase has been ported to TypeScript (mostly for the lulz).
+
+- The order of parameters in the non-curryied invocation of functions has been modified. In the original updeep the input object is the last parameter, whereas here it's the first.
+
+```js
+// original updeep
+const dataIn = { a: 1, b: 2 };
+
+let dataOut = u({ c: 3 }, dataIn); // simple call
+dataOut = u({ c: 3 })(dataIn); // curried
+
+// updeep-remeda
+dataOut = u(dataIn, { c: 3 }); // simple call
+dataOut = u({ c: 3 })(dataIn); // curried
+```
+
+- `withDefault` has been removed as the behavior can be implemented using
+ Remeda's `pipe`, or a simple `??`.
+
+- `u.omitted` has been renamed `u.skip`.
+
+## Installation
+
+```bash
+$ npm install @yanick/updeep-remeda
+# or
+$ pnpm install @yanick/updeep-remeda
+```
+
+## Full example
+
+```js
+import u from "@yanick/updeep-remeda";
+
+const person = {
+ name: { first: "Bill", last: "Sagat" },
+ children: [
+ { name: "Mary-Kate", age: 7 },
+ { name: "Ashley", age: 7 },
+ ],
+ todo: ["Be funny", "Manage household"],
+ email: "bill@example.com",
+ version: 1,
+};
+
+const inc = (i) => i + 1;
+
+const eq = (x) => (y) => x === y;
+
+const newPerson = u(person, {
+ // Change first name
+ name: { first: "Bob" },
+ // Increment all children's ages
+ children: u.map({ age: inc }),
+ // Update email
+ email: "bob@example.com",
+ // Remove todo
+ todo: u.reject(eq("Be funny")),
+ // Increment version
+ version: inc,
+});
+// => {
+// name: { first: 'Bob', last: 'Sagat' },
+// children: [
+// { name: 'Mary-Kate', age: 8 },
+// { name: 'Ashley', age: 8 }
+// ],
+// todo: [
+// 'Manage household'
+// ],
+// email: 'bob@example.com',
+// version: 2
+//}
+```
+
+## API
+
+> π‘ All functions are curried, Remeda-style, so if you see `f(dataIn, ...others)`, it can be called with either `f(dataIn, ...others)` or `f(...others)(dataIn)`.
+
+### Importing
+
+`updeep-remeda` exports a default function that is an alias to `u.update` and
+has all the other functions available as props.
+
+```
+import u from '@yanick/updeep-remeda';
+
+const foo = u({a:1}, { a: x => x + 1 });
+
+const bar = u.updateIn({ a: { b: 2 } }, 'a.b', 3 );
+```
+
+Or you can import the functions piecemeal:
+
+```
+import { updateIn, omit } from '@yanick/updeep-remeda';
+```
+
+### `u(dataIn, updates)`
+
+### `u.update(dataIn, updates)`
+
+Update as many values as you want, as deeply as you want. The `updates` parameter can either be an object, a function, or a value. Everything returned from `u` is frozen recursively.
+
+If `updates` is an object, for each key/value, it will apply the updates specified in the value to `object[key]`.
+
+If `updates` is a function, it will call the function with `object` and return the value.
+
+If `updates` is a value, it will return that value.
+
+Sometimes, you may want to set an entire object to a property, or a function. In that case, you'll need to use a function to return that value, otherwise it would be interpreted as an update. Ex. `function() { return { a: 0 }; }`.
+
+Also available at `u.update(...)`.
+
+#### Simple update
+
+Object properties:
+
+```js
+const person = {
+ name: {
+ first: "Jane",
+ last: "West",
+ },
+};
+
+const result = u(person, { name: { first: "Susan" } });
+
+expect(result).to.eql({ name: { first: "Susan", last: "West" } });
+```
+
+Array elements:
+
+```js
+const scoreboard = {
+ scores: [12, 28],
+};
+
+const result = u(scoreboard, { scores: { 1: 36 } });
+
+expect(result).to.eql({ scores: [12, 36] });
+```
+
+#### Multiple updates
+
+```js
+const person = {
+ name: {
+ first: "Mike",
+ last: "Smith",
+ },
+ scores: [12, 28],
+};
+
+const result = u(person, { name: { last: "Jones" }, scores: { 1: 36 } });
+
+expect(result).to.eql({
+ name: { first: "Mike", last: "Jones" },
+ scores: [12, 36],
+});
+```
+
+#### Use a function
+
+```js
+const increment = (i) => i + 1;
+
+var scoreboard = {
+ scores: {
+ team1: 0,
+ team2: 0,
+ },
+};
+
+const result = u(scoreboard, { scores: { team2: increment } });
+
+expect(result).to.eql({ scores: { team1: 0, team2: 1 } });
+```
+
+#### Array Manipulation
+
+Non-trivial array manipulations, such as element removal/insertion/sorting, can be implemented with functions. Because there are so many possible manipulations, we don't provide any helpers and leave this up to you. Simply ensure your function is pure and does not mutate its arguments.
+
+```js
+function addTodo(todos) {
+ return [].concat(todos, [{ done: false }]);
+}
+
+const state = {
+ todos: [{ done: false }, { done: false }],
+};
+
+const result = u({ todos: addTodo }, state);
+
+expect(result).to.eql({
+ todos: [{ done: false }, { done: false }, { done: false }],
+});
+```
+
+Remeda is one of the many libraries providing good utility functions for
+such manipulations.
+
+```js
+import { reject, concat, prop } from "remeda";
+
+let state = {
+ todos: [{ done: true }, { done: false }],
+};
+
+// add a new todo
+state = u(state, { todos: concat({ done: false }) });
+expect(state).to.eql({
+ todos: [{ done: true }, { done: false }, { done: false }],
+});
+
+// remove all done todos
+state = u(state, { todos: reject(prop("done")) });
+expect(state).to.eql({ todos: [{ done: false }, { done: false }] });
+```
+
+#### Default input data
+
+When the input data is null or undefined, updeep uses a empty plain object.
+
+```javascript
+const result = u(null, { foo: "bar" });
+expect(result).to.eql({ foo: "bar" });
+```
+
+#### Partial application
+
+```js
+const inc = (i) => i + 1;
+
+const addOneYear = u({ age: increment });
+const result = addOneYear({ name: "Shannon Barnes", age: 62 });
+
+expect(result).to.eql({ name: "Shannon Barnes", age: 63 });
+```
+
+### `u.freeze(dataIn)`
+
+Freeze your initial state to protect against mutations. Only performs the freezing in development, and returns the original object unchanged in production.
+
+```js
+const state = u.freeze({ someKey: "Some Value" });
+state.someKey = "Mutate"; // ERROR in development
+```
+
+### `u.updateIn(dataIn, path, value)`
+
+Update a single value with a simple string or array path. Can be use to update nested objects, arrays, or a combination. Can also be used to update every element of a nested array with `'*'`.
+
+```js
+const result = u.updateIn(
+ { bunny: { color: "black" } },
+ "bunny.color",
+ "brown"
+);
+
+expect(result).to.eql({ bunny: { color: "brown" } });
+```
+
+```js
+const result = u.updateIn(
+ "0.1.color",
+ "brown"
+)([[{ color: "blue" }, { color: "red" }], []]);
+
+expect(result).to.eql([[{ color: "blue" }, { color: "brown" }], []]);
+```
+
+```js
+const incr = (i) => i + 1;
+
+const result = u.updateIn("bunny.age", incr)({ bunny: { age: 2 } });
+
+expect(result).to.eql({ bunny: { age: 3 } });
+```
+
+```js
+const result = u(
+ { pets: [{ bunny: { age: 2 } }] }
+ { pets: u.updateIn([0, "bunny", "age"], 3) },
+);
+
+expect(result).to.eql({ pets: [{ bunny: { age: 3 } }] });
+```
+
+```js
+const result = u.updateIn(
+ "todos.*.done",
+ true
+)({
+ todos: [{ done: false }, { done: false }],
+});
+
+expect(result).to.eql({
+ todos: [{ done: true }, { done: true }],
+});
+```
+
+### `u.constant(dataIn)`
+
+Sometimes, you want to replace an object outright rather than merging it.
+You'll need to use a function that returns the new object.
+`u.constant` creates that function for you.
+
+```js
+const user = {
+ name: "Mitch",
+ favorites: {
+ band: "Nirvana",
+ movie: "The Matrix",
+ },
+};
+
+const newFavorites = {
+ band: "Coldplay",
+};
+
+const result = u(user, { favorites: u.constant(newFavorites) });
+
+expect(result).to.eql({ name: "Mitch", favorites: { band: "Coldplay" } });
+```
+
+```js
+const alwaysFour = u.constant(4);
+expect(alwaysFour(32)).to.eql(4);
+```
+
+### `u.if(dataIn, predicate, updates)`
+
+Apply `updates` if `predicate` is truthy, or if `predicate` is a function.
+It evaluates to truthy when called with `object`.
+
+```js
+function isEven(x) {
+ return x % 2 === 0;
+}
+function increment(x) {
+ return x + 1;
+}
+
+const result = u({ value: 2 }, { value: u.if(isEven, increment) });
+
+expect(result).to.eql({ value: 3 });
+```
+
+### `u.filter(arrayIn, predicate)`
+
+### `u.reject(arrayIn, predicate)`
+
+### `u.pickBy(objectIn, predicate)`
+
+### `u.omitBy(objectIn, predicate)`
+
+### `u.pick(objectIn, keys)`
+
+### `u.omit(objectIn, keys)`
+
+Essentially the same as their Remeda counterparts. The difference being
+that if the transformation results in no change, the original object/array is
+returned.
+
+### `u.map(objectIn, updates)`
+
+Applies the updates on all entries of `objectIn`.
+
+### `u.mapIf(objectIn, predicate, updates)`
+
+Shorthand for `u.map( objectIn, u.if(predicate,updates) )`.
+
+### `u.mapIfElse(objectIn, predicate, updates, updatesElse)`
+
+Shorthand for `u.map( objectIn, u.ifElse(predicate,updates,updatesElse) )`.
+
+### `u.matches(dataIn, condition)`
+
+Do a deep comparison with `condition`, and returns
+`true` if the `dataIn` object matches.
+
+Scalar values are verified for equality (i.e., `{foo: 12}`
+will verify that the object has the prop `foo` set to `12`), and
+functions are going to be invoked with the object value of the object and
+expected to return `true` upon matching.
+
+```js
+u.matches(
+ { name: "Bob", age: 32, address: "..." },
+ {
+ name: "Bob",
+ age: (age) => age > 30,
+ }
+); // true
+```
diff --git a/docs/.nojekyll b/docs/.nojekyll
deleted file mode 100644
index e69de29..0000000
diff --git a/docs/_navbar.md b/docs/_navbar.md
deleted file mode 100644
index 51f0600..0000000
--- a/docs/_navbar.md
+++ /dev/null
@@ -1,2 +0,0 @@
-- [Getting started](/)
-- [API](/api)
diff --git a/docs/docsify-namespaced.js b/docs/docsify-namespaced.js
deleted file mode 100644
index d1f3392..0000000
--- a/docs/docsify-namespaced.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/*!
- * docsify-namespaced
- * v0.1.1
- * https://github.com/palkan/docsify-namespaced
- * (c) 2020-2021 Vladimir Dementyev
- * MIT license
- */
-!(function () {
- "use strict";
- (window.$docsify = window.$docsify || {}),
- (window.$docsify.plugins = [
- function (n, a) {
- function r(n) {
- w ? (window.location.hash = n) : (window.location.href = n);
- }
- function l(n) {
- return (n =
- n || (w ? window.location.hash : window.location.pathname)).split(
- /\//
- );
- }
- function u(n, e, o, t) {
- e.values.includes(n[o + 1])
- ? t
- ? (n[o + 1] = t)
- : n.splice(o + 1, 1)
- : t && n.splice(o + 1, 0, t);
- }
- var s,
- f,
- d,
- w = !0;
- n.mounted(function () {
- var n = (s = a.config.namespaces).map(function (n) {
- var e = "(?:(".concat(n.values.join("|"), ")/)");
- return n.optional && (e += "?"), e;
- });
- (f = new RegExp("^#?/".concat(n.join("")))),
- (w = "hash" === a.router.mode);
- var o = l(),
- e = o.join("/"),
- t = 2 === o.length && "" === o[1];
- s.forEach(function (n, e) {
- n.selector &&
- ((n.selectElement = Docsify.dom.find(n.selector)),
- n.default &&
- ((n.selectElement.value = n.default),
- n.values.includes(o[e + 1]) || u(o, n, e, n.default)),
- Docsify.dom.on(n.selectElement, "click", function (n) {
- return n.stopPropagation();
- }),
- Docsify.dom.on(n.selectElement, "change", function (n) {
- return (function (n, e) {
- var o = l();
- u(o, s[e], e, n);
- var t = o.join("/");
- r(t);
- })(n.target.value, e);
- }));
- });
- var c = a.compiler.sidebar;
- a.compiler.sidebar = function () {
- return (function (n) {
- if (!d) return n;
- var c = new RegExp("^" + d);
- return (n = n.replace(
- /(href=['"])(#?[^'"]+)(["'])/g,
- function (n, e, o, t) {
- console.log('!!!',o);
- return o.match(c)
- ? n
- : [e, (o = o.replace(/^#?\//, d)), t].join("");
- }
- ));
- })(c.apply(this, arguments));
- };
- var i = o.join("/");
- t && i !== e && r(i);
- }),
- n.afterEach(function (n, e) {
- var o = (w ? window.location.hash : window.location.pathname).match(
- f
- );
- s.forEach(function (n, e) {
- n.selectElement &&
- (n.selectElement.value = (o && o[e + 1]) || "");
- }),
- (d = o ? o[0] : "/"),
- (a.config.currentNamespace = d),
- e(n);
- });
- },
- ].concat(window.$docsify.plugins || []));
-})();
-//# sourceMappingURL=docsify-namespaced.min.js.map
diff --git a/docs/index.html b/docs/index.html
deleted file mode 100644
index 0805b32..0000000
--- a/docs/index.html
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-
-
- Document
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/latest/README.md b/docs/latest/README.md
deleted file mode 100644
index 082beda..0000000
--- a/docs/latest/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# updeep-remeda
-
-> Easily update nested frozen objects and arrays in a declarative and immutable
-> manner.
-
-## About
-
-
-
π‘ Info
-
-This is a fork of the main updeep package. For ease of reading — not to
-mention ease of shamelessly lifting large pieces of the original
-documentation — in this documentation all mentions of `updeep` refers to this
-fork.
-
-
-
-updeep makes updating deeply nested objects/arrays painless by allowing you to
-declare the updates you would like to make and it will take care of the rest. It
-will recursively return the same instance if no changes have been made, making
-it ideal for using reference equality checks to detect changes.
-
-Because of this, everything returned by updeep is frozen. Not only that, but
-updeep assumes that every object passed in to update is immutable, so it may
-freeze objects passed in as well. Note that the freezing only happens in
-development.
-
-This fork of updeep requires Remeda, but works very well with any other utility function ([lodash], [Ramda], etc).
-
-## Differences with the original Updeep
-
-- Under the hood, the use of lodash has
- been replaced by Remeda (for better type support and tree-shaking abilities).
-
-- The codebase has been ported to TypeScript (mostly for the lulz).
-
-- The order of parameters in the non-curryied invocation of functions has been modified. In the original updeep the input object is the last parameter, whereas here it's the first.
-
-```js
-// original updeep
-const dataIn = { a: 1, b: 2 };
-
-let dataOut = u({ c: 3 }, dataIn); // simple call
-dataOut = u({ c: 3 })(dataIn); // curried
-
-// updeep-remeda
-dataOut = u(dataIn, { c: 3 }); // simple call
-dataOut = u({ c: 3 })(dataIn); // curried
-```
-
-- `withDefault` has been removed as the behavior can be implemented using
- Remeda's `pipe`, or a simple `??`.
-
-- `u.omitted` has been renamed `u.skip`.
-
-## Installation
-
-```bash
-$ npm install @yanick/updeep-remeda
-# or
-$ pnpm install @yanick/updeep-remeda
-```
-
-## Full example
-
-```js
-import u from "@yanick/updeep-remeda";
-
-const person = {
- name: { first: "Bill", last: "Sagat" },
- children: [
- { name: "Mary-Kate", age: 7 },
- { name: "Ashley", age: 7 },
- ],
- todo: ["Be funny", "Manage household"],
- email: "bill@example.com",
- version: 1,
-};
-
-const inc = (i) => i + 1;
-
-const eq = (x) => (y) => x === y;
-
-const newPerson = u(person, {
- // Change first name
- name: { first: "Bob" },
- // Increment all children's ages
- children: u.map({ age: inc }),
- // Update email
- email: "bob@example.com",
- // Remove todo
- todo: u.reject(eq("Be funny")),
- // Increment version
- version: inc,
-});
-// => {
-// name: { first: 'Bob', last: 'Sagat' },
-// children: [
-// { name: 'Mary-Kate', age: 8 },
-// { name: 'Ashley', age: 8 }
-// ],
-// todo: [
-// 'Manage household'
-// ],
-// email: 'bob@example.com',
-// version: 2
-//}
-```
diff --git a/docs/latest/_navbar.md b/docs/latest/_navbar.md
deleted file mode 100644
index f794531..0000000
--- a/docs/latest/_navbar.md
+++ /dev/null
@@ -1,2 +0,0 @@
-- [Getting started](/latest/)
-- [API](/latest/api)
diff --git a/docs/latest/api.md b/docs/latest/api.md
deleted file mode 100644
index 21614b5..0000000
--- a/docs/latest/api.md
+++ /dev/null
@@ -1,326 +0,0 @@
-# API
-
-
-
π‘ Info
-
-All functions are curried, Remeda-style, so if you see `f(dataIn, ...others)`, it can be called with either `f(dataIn, ...others)` or `f(...others)(dataIn)`.
-
-
-
-## Importing
-
-`updeep-remeda` exports a default function that is an alias to `u.update` and
-has all the other functions available as props.
-
-```
-import u from '@yanick/updeep-remeda';
-
-const foo = u({a:1}, { a: x => x + 1 });
-
-const bar = u.updateIn({ a: { b: 2 } }, 'a.b', 3 );
-```
-
-Or you can import the functions piecemeal:
-
-```
-import { updateIn, omit } from '@yanick/updeep-remeda';
-```
-
-## `u(dataIn, updates)`
-
-## `u.update(dataIn, updates)`
-
-Update as many values as you want, as deeply as you want. The `updates` parameter can either be an object, a function, or a value. Everything returned from `u` is frozen recursively.
-
-If `updates` is an object, for each key/value, it will apply the updates specified in the value to `object[key]`.
-
-If `updates` is a function, it will call the function with `object` and return the value.
-
-If `updates` is a value, it will return that value.
-
-Sometimes, you may want to set an entire object to a property, or a function. In that case, you'll need to use a function to return that value, otherwise it would be interpreted as an update. Ex. `function() { return { a: 0 }; }`.
-
-Also available at `u.update(...)`.
-
-### Simple update
-
-Object properties:
-
-```js
-const person = {
- name: {
- first: "Jane",
- last: "West",
- },
-};
-
-const result = u(person, { name: { first: "Susan" } });
-
-expect(result).to.eql({ name: { first: "Susan", last: "West" } });
-```
-
-Array elements:
-
-```js
-const scoreboard = {
- scores: [12, 28],
-};
-
-const result = u(scoreboard, { scores: { 1: 36 } });
-
-expect(result).to.eql({ scores: [12, 36] });
-```
-
-### Multiple updates
-
-```js
-const person = {
- name: {
- first: "Mike",
- last: "Smith",
- },
- scores: [12, 28],
-};
-
-const result = u(person, { name: { last: "Jones" }, scores: { 1: 36 } });
-
-expect(result).to.eql({
- name: { first: "Mike", last: "Jones" },
- scores: [12, 36],
-});
-```
-
-### Use a function
-
-```js
-const increment = (i) => i + 1;
-
-var scoreboard = {
- scores: {
- team1: 0,
- team2: 0,
- },
-};
-
-const result = u(scoreboard, { scores: { team2: increment } });
-
-expect(result).to.eql({ scores: { team1: 0, team2: 1 } });
-```
-
-### Array Manipulation
-
-Non-trivial array manipulations, such as element removal/insertion/sorting, can be implemented with functions. Because there are so many possible manipulations, we don't provide any helpers and leave this up to you. Simply ensure your function is pure and does not mutate its arguments.
-
-```js
-function addTodo(todos) {
- return [].concat(todos, [{ done: false }]);
-}
-
-const state = {
- todos: [{ done: false }, { done: false }],
-};
-
-const result = u({ todos: addTodo }, state);
-
-expect(result).to.eql({
- todos: [{ done: false }, { done: false }, { done: false }],
-});
-```
-
-Remeda is one of the many libraries providing good utility functions for
-such manipulations.
-
-```js
-import { reject, concat, prop } from "remeda";
-
-let state = {
- todos: [{ done: true }, { done: false }],
-};
-
-// add a new todo
-state = u(state, { todos: concat({ done: false }) });
-expect(state).to.eql({
- todos: [{ done: true }, { done: false }, { done: false }],
-});
-
-// remove all done todos
-state = u(state, { todos: reject(prop("done")) });
-expect(state).to.eql({ todos: [{ done: false }, { done: false }] });
-```
-
-### Default input data
-
-When the input data is null or undefined, updeep uses a empty plain object.
-
-```javascript
-const result = u(null, { foo: "bar" });
-expect(result).to.eql({ foo: "bar" });
-```
-
-### Partial application
-
-```js
-const inc = (i) => i + 1;
-
-const addOneYear = u({ age: increment });
-const result = addOneYear({ name: "Shannon Barnes", age: 62 });
-
-expect(result).to.eql({ name: "Shannon Barnes", age: 63 });
-```
-
-## `u.freeze(dataIn)`
-
-Freeze your initial state to protect against mutations. Only performs the freezing in development, and returns the original object unchanged in production.
-
-```js
-const state = u.freeze({ someKey: "Some Value" });
-state.someKey = "Mutate"; // ERROR in development
-```
-
-## `u.updateIn(dataIn, path, value)`
-
-Update a single value with a simple string or array path. Can be use to update nested objects, arrays, or a combination. Can also be used to update every element of a nested array with `'*'`.
-
-```js
-const result = u.updateIn(
- { bunny: { color: "black" } },
- "bunny.color",
- "brown"
-);
-
-expect(result).to.eql({ bunny: { color: "brown" } });
-```
-
-```js
-const result = u.updateIn(
- "0.1.color",
- "brown"
-)([[{ color: "blue" }, { color: "red" }], []]);
-
-expect(result).to.eql([[{ color: "blue" }, { color: "brown" }], []]);
-```
-
-```js
-const incr = (i) => i + 1;
-
-const result = u.updateIn("bunny.age", incr)({ bunny: { age: 2 } });
-
-expect(result).to.eql({ bunny: { age: 3 } });
-```
-
-```js
-const result = u(
- { pets: [{ bunny: { age: 2 } }] }
- { pets: u.updateIn([0, "bunny", "age"], 3) },
-);
-
-expect(result).to.eql({ pets: [{ bunny: { age: 3 } }] });
-```
-
-```js
-const result = u.updateIn(
- "todos.*.done",
- true
-)({
- todos: [{ done: false }, { done: false }],
-});
-
-expect(result).to.eql({
- todos: [{ done: true }, { done: true }],
-});
-```
-
-## `u.constant(dataIn)`
-
-Sometimes, you want to replace an object outright rather than merging it.
-You'll need to use a function that returns the new object.
-`u.constant` creates that function for you.
-
-```js
-const user = {
- name: "Mitch",
- favorites: {
- band: "Nirvana",
- movie: "The Matrix",
- },
-};
-
-const newFavorites = {
- band: "Coldplay",
-};
-
-const result = u(user, { favorites: u.constant(newFavorites) });
-
-expect(result).to.eql({ name: "Mitch", favorites: { band: "Coldplay" } });
-```
-
-```js
-const alwaysFour = u.constant(4);
-expect(alwaysFour(32)).to.eql(4);
-```
-
-## `u.if(dataIn, predicate, updates)`
-
-Apply `updates` if `predicate` is truthy, or if `predicate` is a function.
-It evaluates to truthy when called with `object`.
-
-```js
-function isEven(x) {
- return x % 2 === 0;
-}
-function increment(x) {
- return x + 1;
-}
-
-const result = u({ value: 2 }, { value: u.if(isEven, increment) });
-
-expect(result).to.eql({ value: 3 });
-```
-
-## `u.filter(arrayIn, predicate)`
-
-## `u.reject(arrayIn, predicate)`
-
-## `u.pickBy(objectIn, predicate)`
-
-## `u.omitBy(objectIn, predicate)`
-
-## `u.pick(objectIn, keys)`
-
-## `u.omit(objectIn, keys)`
-
-Essentially the same as their Remeda counterparts. The difference being
-that if the transformation results in no change, the original object/array is
-returned.
-
-## `u.map(objectIn, updates)`
-
-Applies the updates on all entries of `objectIn`.
-
-## `u.mapIf(objectIn, predicate, updates)`
-
-Shorthand for `u.map( objectIn, u.if(predicate,updates) )`.
-
-## `u.mapIfElse(objectIn, predicate, updates, updatesElse)`
-
-Shorthand for `u.map( objectIn, u.ifElse(predicate,updates,updatesElse) )`.
-
-## `u.matches(dataIn, condition)`
-
-Do a deep comparison with `condition`, and returns
-`true` if the `dataIn` object matches.
-
-Scalar values are verified for equality (i.e., `{foo: 12}`
-will verify that the object has the prop `foo` set to `12`), and
-functions are going to be invoked with the object value of the object and
-expected to return `true` upon matching.
-
-```js
-u.matches(
- { name: "Bob", age: 32, address: "..." },
- {
- name: "Bob",
- age: (age) => age > 30,
- }
-); // true
-```
diff --git a/docs/vendor/docsify.js b/docs/vendor/docsify.js
deleted file mode 100644
index 76fc755..0000000
--- a/docs/vendor/docsify.js
+++ /dev/null
@@ -1 +0,0 @@
-!function(){function c(i){var o=Object.create(null);return function(e){var n=f(e)?e:JSON.stringify(e);return o[n]||(o[n]=i(e))}}var a=c(function(e){return e.replace(/([A-Z])/g,function(e){return"-"+e.toLowerCase()})}),u=Object.prototype.hasOwnProperty,m=Object.assign||function(e){for(var n=arguments,i=1;i=e||n.classList.contains("hidden")?S(h,"add","sticky"):S(h,"remove","sticky"))}function ee(e,n,o,i){var t=[];null!=(n=l(n))&&(t=k(n,"a"));var a,r=decodeURI(e.toURL(e.getCurrentPath()));return t.sort(function(e,n){return n.href.length-e.href.length}).forEach(function(e){var n=decodeURI(e.getAttribute("href")),i=o?e.parentNode:e;e.title=e.title||e.innerText,0!==r.indexOf(n)||a?S(i,"remove","active"):(a=e,S(i,"add","active"))}),i&&(v.title=a?a.title||a.innerText+" - "+J:J),a}function ne(e,n){for(var i=0;ithis.end&&e>=this.next}[this.direction]}},{key:"_defaultEase",value:function(e,n,i,o){return(e/=o/2)<1?i/2*e*e+n:-i/2*(--e*(e-2)-1)+n}}]),re);function re(){var e=0c){n=n||p;break}n=p}!n||(r=fe[ve(e,n.getAttribute("data-id"))])&&r!==a&&(a&&a.classList.remove("active"),r.classList.add("active"),a=r,!pe&&h.classList.contains("sticky")&&(e=i.clientHeight,r=a.offsetTop+a.clientHeight+40,a=a.offsetTop>=t.scrollTop&&r<=t.scrollTop+e,i.scrollTop=a?t.scrollTop:+r"']/),xe=/[&<>"']/g,Se=/[<>"']|&(?!#?\w+;)/,Ae=/[<>"']|&(?!#?\w+;)/g,$e={"&":"&","<":"<",">":">",'"':""","'":"'"};var ze=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function Fe(e){return e.replace(ze,function(e,n){return"colon"===(n=n.toLowerCase())?":":"#"===n.charAt(0)?"x"===n.charAt(1)?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""})}var Ee=/(^|[^\[])\^/g;var Te=/[^\w:]/g,Ce=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;var Re={},je=/^[^:]+:\/*[^/]*$/,Oe=/^([^:]+:)[\s\S]*$/,Le=/^([^:]+:\/*[^/]*)[\s\S]*$/;function qe(e,n){Re[" "+e]||(je.test(e)?Re[" "+e]=e+"/":Re[" "+e]=Pe(e,"/",!0));var i=-1===(e=Re[" "+e]).indexOf(":");return"//"===n.substring(0,2)?i?n:e.replace(Oe,"$1")+n:"/"===n.charAt(0)?i?n:e.replace(Le,"$1")+n:e+n}function Pe(e,n,i){var o=e.length;if(0===o)return"";for(var t=0;tn)i.splice(n);else for(;i.length>=1,e+=e;return i+e},We=we.defaults,Xe=Be,Qe=Ze,Je=Me,Ke=Ve;function en(e,n,i){var o=n.href,t=n.title?Je(n.title):null,n=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:i,href:o,title:t,text:n}:{type:"image",raw:i,href:o,title:t,text:Je(n)}}var nn=function(){function e(e){this.options=e||We}return e.prototype.space=function(e){e=this.rules.block.newline.exec(e);if(e)return 1=i.length?e.slice(i.length):e}).join("\n")}(i,n[3]||"");return{type:"code",raw:i,lang:n[2]&&n[2].trim(),text:e}}},e.prototype.heading=function(e){var n=this.rules.block.heading.exec(e);if(n){var i=n[2].trim();return/#$/.test(i)&&(e=Xe(i,"#"),!this.options.pedantic&&e&&!/ $/.test(e)||(i=e.trim())),{type:"heading",raw:n[0],depth:n[1].length,text:i}}},e.prototype.nptable=function(e){e=this.rules.block.nptable.exec(e);if(e){var n={type:"table",header:Qe(e[1].replace(/^ *| *\| *$/g,"")),align:e[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:e[3]?e[3].replace(/\n$/,"").split("\n"):[],raw:e[0]};if(n.header.length===n.align.length){for(var i=n.align.length,o=0;o ?/gm,"");return{type:"blockquote",raw:n[0],text:e}}},e.prototype.list=function(e){e=this.rules.block.list.exec(e);if(e){for(var n,i,o,t,a,r=e[0],c=e[2],u=1s[1].length:o[1].length>s[0].length||3/i.test(e[0])&&(n=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:e[0],inLink:n,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):Je(e[0]):e[0]}},e.prototype.link=function(e){var n=this.rules.inline.link.exec(e);if(n){e=n[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;var i=Xe(e.slice(0,-1),"\\");if((e.length-i.length)%2==0)return}else{var o=Ke(n[2],"()");-1$/.test(e)?i.slice(1):i.slice(1,-1):i)&&i.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},n[0])}},e.prototype.reflink=function(e,n){if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var e=(i[2]||i[1]).replace(/\s+/g," ");if((e=n[e.toLowerCase()])&&e.href)return en(i,e,i[0]);var i=i[0].charAt(0);return{type:"text",raw:i,text:i}}},e.prototype.strong=function(e,n,i){void 0===i&&(i="");var o=this.rules.inline.strong.start.exec(e);if(o&&(!o[1]||o[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){n=n.slice(-1*e.length);var t,a="**"===o[0]?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;for(a.lastIndex=0;null!=(o=a.exec(n));)if(t=this.rules.inline.strong.middle.exec(n.slice(0,o.index+3)))return{type:"strong",raw:e.slice(0,t[0].length),text:e.slice(2,t[0].length-2)}}},e.prototype.em=function(e,n,i){void 0===i&&(i="");var o=this.rules.inline.em.start.exec(e);if(o&&(!o[1]||o[1]&&(""===i||this.rules.inline.punctuation.exec(i)))){n=n.slice(-1*e.length);var t,a="*"===o[0]?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;for(a.lastIndex=0;null!=(o=a.exec(n));)if(t=this.rules.inline.em.middle.exec(n.slice(0,o.index+2)))return{type:"em",raw:e.slice(0,t[0].length),text:e.slice(1,t[0].length-1)}}},e.prototype.codespan=function(e){var n=this.rules.inline.code.exec(e);if(n){var i=n[2].replace(/\n/g," "),o=/[^ ]/.test(i),e=/^ /.test(i)&&/ $/.test(i);return o&&e&&(i=i.substring(1,i.length-1)),i=Je(i,!0),{type:"codespan",raw:n[0],text:i}}},e.prototype.br=function(e){e=this.rules.inline.br.exec(e);if(e)return{type:"br",raw:e[0]}},e.prototype.del=function(e){e=this.rules.inline.del.exec(e);if(e)return{type:"del",raw:e[0],text:e[2]}},e.prototype.autolink=function(e,n){e=this.rules.inline.autolink.exec(e);if(e){var i,n="@"===e[2]?"mailto:"+(i=Je(this.options.mangle?n(e[1]):e[1])):i=Je(e[1]);return{type:"link",raw:e[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}}},e.prototype.url=function(e,n){var i,o,t,a;if(i=this.rules.inline.url.exec(e)){if("@"===i[2])t="mailto:"+(o=Je(this.options.mangle?n(i[0]):i[0]));else{for(;a=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0],a!==i[0];);o=Je(i[0]),t="www."===i[1]?"http://"+o:o}return{type:"link",raw:i[0],text:o,href:t,tokens:[{type:"text",raw:o,text:o}]}}},e.prototype.inlineText=function(e,n,i){e=this.rules.inline.text.exec(e);if(e){i=n?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):Je(e[0]):e[0]:Je(this.options.smartypants?i(e[0]):e[0]);return{type:"text",raw:e[0],text:i}}},e}(),Ze=De,Ve=Ne,De=Ue,Ne={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Ze,table:Ze,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Ne.def=Ve(Ne.def).replace("label",Ne._label).replace("title",Ne._title).getRegex(),Ne.bullet=/(?:[*+-]|\d{1,9}[.)])/,Ne.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Ne.item=Ve(Ne.item,"gm").replace(/bull/g,Ne.bullet).getRegex(),Ne.listItemStart=Ve(/^( *)(bull)/).replace("bull",Ne.bullet).getRegex(),Ne.list=Ve(Ne.list).replace(/bull/g,Ne.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Ne.def.source+")").getRegex(),Ne._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ne._comment=/|$)/,Ne.html=Ve(Ne.html,"i").replace("comment",Ne._comment).replace("tag",Ne._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ne.paragraph=Ve(Ne._paragraph).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.blockquote=Ve(Ne.blockquote).replace("paragraph",Ne.paragraph).getRegex(),Ne.normal=De({},Ne),Ne.gfm=De({},Ne.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Ne.gfm.nptable=Ve(Ne.gfm.nptable).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.gfm.table=Ve(Ne.gfm.table).replace("hr",Ne.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",Ne._tag).getRegex(),Ne.pedantic=De({},Ne.normal,{html:Ve("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?\\1> *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Ne._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ze,paragraph:Ve(Ne.normal._paragraph).replace("hr",Ne.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ne.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});Ze={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Ze,tag:"^comment|^[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Ze,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};Ze.punctuation=Ve(Ze.punctuation).replace(/punctuation/g,Ze._punctuation).getRegex(),Ze._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",Ze._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",Ze._comment=Ve(Ne._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),Ze.em.start=Ve(Ze.em.start).replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.em.middle=Ve(Ze.em.middle).replace(/punctuation/g,Ze._punctuation).replace(/overlapSkip/g,Ze._overlapSkip).getRegex(),Ze.em.endAst=Ve(Ze.em.endAst,"g").replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.em.endUnd=Ve(Ze.em.endUnd,"g").replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.strong.start=Ve(Ze.strong.start).replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.strong.middle=Ve(Ze.strong.middle).replace(/punctuation/g,Ze._punctuation).replace(/overlapSkip/g,Ze._overlapSkip).getRegex(),Ze.strong.endAst=Ve(Ze.strong.endAst,"g").replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.strong.endUnd=Ve(Ze.strong.endUnd,"g").replace(/punctuation/g,Ze._punctuation).getRegex(),Ze.blockSkip=Ve(Ze._blockSkip,"g").getRegex(),Ze.overlapSkip=Ve(Ze._overlapSkip,"g").getRegex(),Ze._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Ze._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Ze._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,Ze.autolink=Ve(Ze.autolink).replace("scheme",Ze._scheme).replace("email",Ze._email).getRegex(),Ze._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Ze.tag=Ve(Ze.tag).replace("comment",Ze._comment).replace("attribute",Ze._attribute).getRegex(),Ze._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ze._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Ze._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Ze.link=Ve(Ze.link).replace("label",Ze._label).replace("href",Ze._href).replace("title",Ze._title).getRegex(),Ze.reflink=Ve(Ze.reflink).replace("label",Ze._label).getRegex(),Ze.reflinkSearch=Ve(Ze.reflinkSearch,"g").replace("reflink",Ze.reflink).replace("nolink",Ze.nolink).getRegex(),Ze.normal=De({},Ze),Ze.pedantic=De({},Ze.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ve(/^!?\[(label)\]\((.*?)\)/).replace("label",Ze._label).getRegex(),reflink:Ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ze._label).getRegex()}),Ze.gfm=De({},Ze.normal,{escape:Ve(Ze.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\'+(i?e:gn(e,!0))+"\n":"