diff --git a/404.html b/404.html index 24e97d6..72113ae 100644 --- a/404.html +++ b/404.html @@ -7,13 +7,13 @@ - +

404

Looks like we've got some broken links.
Take me home.
- + diff --git a/assets/js/10.ddc43828.js b/assets/js/10.0e3b10ff.js similarity index 96% rename from assets/js/10.ddc43828.js rename to assets/js/10.0e3b10ff.js index 502fe10..76bc873 100644 --- a/assets/js/10.ddc43828.js +++ b/assets/js/10.0e3b10ff.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{371:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-flip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-flip"}},[t._v("#")]),t._v(" Module: flip")]),t._v(" "),s("p",[t._v("Returns a new object identical to the "),s("code",[t._v("source")]),t._v(" object, but with the key and the value swapped on each of its own enumerable properties.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" flip "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flip")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" left"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'right'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { value: 'key', right: 'left' }")]),t._v("\n")])])]),s("p",[s("strong",[s("code",[t._v("remark")])]),t._v(" Does not mutate the original object.")]),t._v(" "),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"flip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#flip"}},[t._v("#")]),t._v(" flip")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("flip")]),t._v("‹"),s("strong",[t._v("T")]),t._v("›("),s("code",[t._v("source")]),t._v(": T): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/flip.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/flip.ts:20"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")]),t._v(": "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("The object of which the keys and the values should be swapped.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: string")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{372:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-flip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-flip"}},[t._v("#")]),t._v(" Module: flip")]),t._v(" "),s("p",[t._v("Returns a new object identical to the "),s("code",[t._v("source")]),t._v(" object, but with the key and the value swapped on each of its own enumerable properties.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" flip "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("flip")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" left"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'right'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { value: 'key', right: 'left' }")]),t._v("\n")])])]),s("p",[s("strong",[s("code",[t._v("remark")])]),t._v(" Does not mutate the original object.")]),t._v(" "),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"flip"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#flip"}},[t._v("#")]),t._v(" flip")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("flip")]),t._v("‹"),s("strong",[t._v("T")]),t._v("›("),s("code",[t._v("source")]),t._v(": T): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/flip.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/flip.ts:20"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")]),t._v(": "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("T")]),t._v(" "),s("td",[t._v("The object of which the keys and the values should be swapped.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: string")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/11.9fdbbe4b.js b/assets/js/11.c57ab8d2.js similarity index 96% rename from assets/js/11.9fdbbe4b.js rename to assets/js/11.c57ab8d2.js index e0f89ad..3ad22d6 100644 --- a/assets/js/11.9fdbbe4b.js +++ b/assets/js/11.c57ab8d2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{372:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-isdate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-isdate"}},[t._v("#")]),t._v(" Module: isDate")]),t._v(" "),a("p",[t._v("Assesses if the input is of the type Date.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" isDate "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isDate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Date")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2020-01-01'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns true")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isDate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2020-01-01'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns false")]),t._v("\n")])])]),a("p",[a("strong",[a("code",[t._v("remarks")])]),t._v("\nDate entities are remarkably hard to identify safely in JavaScript.")]),t._v(" "),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"isdate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#isdate"}},[t._v("#")]),t._v(" isDate")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("isDate")]),t._v("("),a("code",[t._v("input")]),t._v(": unknown): "),a("em",[t._v("boolean")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/is-date.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/is-date.ts:22"),a("OutboundLink")],1)])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("input")])]),t._v(" "),a("td",[t._v("unknown")]),t._v(" "),a("td",[t._v("Any type of input is accepted.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("boolean")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{373:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-isdate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-isdate"}},[t._v("#")]),t._v(" Module: isDate")]),t._v(" "),a("p",[t._v("Assesses if the input is of the type Date.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" isDate "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isDate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Date")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2020-01-01'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns true")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isDate")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2020-01-01'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns false")]),t._v("\n")])])]),a("p",[a("strong",[a("code",[t._v("remarks")])]),t._v("\nDate entities are remarkably hard to identify safely in JavaScript.")]),t._v(" "),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"isdate"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#isdate"}},[t._v("#")]),t._v(" isDate")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("isDate")]),t._v("("),a("code",[t._v("input")]),t._v(": unknown): "),a("em",[t._v("boolean")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/is-date.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/is-date.ts:22"),a("OutboundLink")],1)])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("input")])]),t._v(" "),a("td",[t._v("unknown")]),t._v(" "),a("td",[t._v("Any type of input is accepted.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("boolean")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/12.b9225965.js b/assets/js/12.92d62918.js similarity index 97% rename from assets/js/12.b9225965.js rename to assets/js/12.92d62918.js index 8a296cb..1dcd41a 100644 --- a/assets/js/12.b9225965.js +++ b/assets/js/12.92d62918.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{373:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-isequal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-isequal"}},[t._v("#")]),t._v(" Module: isEqual")]),t._v(" "),a("p",[t._v("Compares two objects and returns whether their values are equivalent")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" isEqual "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isEqual")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns true")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isEqual")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" anotherKey"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'another value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns false")]),t._v("\n")])])]),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"isequal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#isequal"}},[t._v("#")]),t._v(" isEqual")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("isEqual")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("first")]),t._v(": T, "),a("code",[t._v("second")]),t._v(": T): "),a("em",[t._v("boolean")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/is-equal.ts#L21",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/is-equal.ts:21"),a("OutboundLink")],1)])]),t._v(" "),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")]),t._v(": "),a("em",[t._v("object")])]),t._v(" "),a("p",[t._v("Type of objects to compare. Both of them have to be of the same type. Type has to extend the standard, generic JavaScript object (with strings as keys).")]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("first")])]),t._v(" "),a("td",[t._v("T")]),t._v(" "),a("td",[t._v("The first object to compare")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("second")])]),t._v(" "),a("td",[t._v("T")]),t._v(" "),a("td",[t._v("The second object to compare")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("boolean")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{374:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-isequal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-isequal"}},[t._v("#")]),t._v(" Module: isEqual")]),t._v(" "),a("p",[t._v("Compares two objects and returns whether their values are equivalent")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" isEqual "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isEqual")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns true")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("isEqual")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" key"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" anotherKey"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'another value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns false")]),t._v("\n")])])]),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"isequal"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#isequal"}},[t._v("#")]),t._v(" isEqual")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("isEqual")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("first")]),t._v(": T, "),a("code",[t._v("second")]),t._v(": T): "),a("em",[t._v("boolean")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/is-equal.ts#L21",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/is-equal.ts:21"),a("OutboundLink")],1)])]),t._v(" "),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")]),t._v(": "),a("em",[t._v("object")])]),t._v(" "),a("p",[t._v("Type of objects to compare. Both of them have to be of the same type. Type has to extend the standard, generic JavaScript object (with strings as keys).")]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("first")])]),t._v(" "),a("td",[t._v("T")]),t._v(" "),a("td",[t._v("The first object to compare")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("second")])]),t._v(" "),a("td",[t._v("T")]),t._v(" "),a("td",[t._v("The second object to compare")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("boolean")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/13.f814b23e.js b/assets/js/13.2710a335.js similarity index 97% rename from assets/js/13.f814b23e.js rename to assets/js/13.2710a335.js index 9ceadfc..1e5b71e 100644 --- a/assets/js/13.f814b23e.js +++ b/assets/js/13.2710a335.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{374:function(t,s,e){"use strict";e.r(s);var a=e(42),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-mapvalues"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-mapvalues"}},[t._v("#")]),t._v(" Module: mapValues")]),t._v(" "),e("p",[t._v("Creates an object with the same keys as the "),e("code",[t._v("source")]),t._v(" object and values generated by running each own enumerable property of "),e("code",[t._v("source")]),t._v(" thru the "),e("code",[t._v("fn")]),t._v(" function.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mapValues "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mapValues")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" one"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'one'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("item"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" item"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toUpperCase")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'ONE' }")]),t._v("\n")])])]),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"mapvalues"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#mapvalues"}},[t._v("#")]),t._v(" mapValues")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("mapValues")]),t._v("‹"),e("strong",[t._v("T")]),t._v(", "),e("strong",[t._v("K")]),t._v("›("),e("code",[t._v("source")]),t._v(": T, "),e("code",[t._v("fn")]),t._v(": function): "),e("em",[t._v("object")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/map-values.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/map-values.ts:20"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("K")]),t._v(": "),e("em",[t._v("keyof T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("source")]),t._v(": "),e("em",[t._v("T")])]),t._v(" "),e("p",[t._v("Object to map the values from.")]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("fn")]),t._v(": "),e("em",[t._v("function")])]),t._v(" "),e("p",[t._v("Function to apply to each value.")]),t._v(" "),e("p",[t._v("▸ ("),e("code",[t._v("value")]),t._v(": T[K], "),e("code",[t._v("key")]),t._v(": K): "),e("em",[t._v("T[K]")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("value")])]),t._v(" "),e("td",[t._v("T[K]")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("key")])]),t._v(" "),e("td",[t._v("K")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("object")])]),t._v(" "),e("ul",[e("li",[t._v("[ "),e("strong",[t._v("k")]),t._v(": "),e("em",[t._v("string")]),t._v("]: T")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{375:function(t,s,e){"use strict";e.r(s);var a=e(42),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-mapvalues"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-mapvalues"}},[t._v("#")]),t._v(" Module: mapValues")]),t._v(" "),e("p",[t._v("Creates an object with the same keys as the "),e("code",[t._v("source")]),t._v(" object and values generated by running each own enumerable property of "),e("code",[t._v("source")]),t._v(" thru the "),e("code",[t._v("fn")]),t._v(" function.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mapValues "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("mapValues")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" one"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'one'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("item"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" item"),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("toUpperCase")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'ONE' }")]),t._v("\n")])])]),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"mapvalues"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#mapvalues"}},[t._v("#")]),t._v(" mapValues")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("mapValues")]),t._v("‹"),e("strong",[t._v("T")]),t._v(", "),e("strong",[t._v("K")]),t._v("›("),e("code",[t._v("source")]),t._v(": T, "),e("code",[t._v("fn")]),t._v(": function): "),e("em",[t._v("object")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/map-values.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/map-values.ts:20"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("K")]),t._v(": "),e("em",[t._v("keyof T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("source")]),t._v(": "),e("em",[t._v("T")])]),t._v(" "),e("p",[t._v("Object to map the values from.")]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("fn")]),t._v(": "),e("em",[t._v("function")])]),t._v(" "),e("p",[t._v("Function to apply to each value.")]),t._v(" "),e("p",[t._v("▸ ("),e("code",[t._v("value")]),t._v(": T[K], "),e("code",[t._v("key")]),t._v(": K): "),e("em",[t._v("T[K]")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("value")])]),t._v(" "),e("td",[t._v("T[K]")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("key")])]),t._v(" "),e("td",[t._v("K")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("object")])]),t._v(" "),e("ul",[e("li",[t._v("[ "),e("strong",[t._v("k")]),t._v(": "),e("em",[t._v("string")]),t._v("]: T")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/14.ec2ac09b.js b/assets/js/14.4026c459.js similarity index 96% rename from assets/js/14.ec2ac09b.js rename to assets/js/14.4026c459.js index bc911d4..ac8edb3 100644 --- a/assets/js/14.ec2ac09b.js +++ b/assets/js/14.4026c459.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{375:function(t,r,s){"use strict";s.r(r);var e=s(42),n=Object(e.a)({},(function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-mirror"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-mirror"}},[t._v("#")]),t._v(" Module: mirror")]),t._v(" "),s("p",[t._v("Generates a key mirror (also known as key-value mirror), which is an object where for each property, the key is the same as the value.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mirror "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mirror")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'one'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'two'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'one', two: 'two' };")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mirror")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" one"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" two"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'one', two: 'two' };")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"mirror"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mirror"}},[t._v("#")]),t._v(" mirror")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("mirror")]),t._v("("),s("code",[t._v("source")]),t._v(": string[]): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/mirror.ts#L18",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/mirror.ts:18"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("string[]")]),t._v(" "),s("td",[t._v("Either an array of strings or an object from where to pick the mirrored keys and values. If it's an object, the values will be overwritten.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: string")])]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("mirror")]),t._v("‹"),s("strong",[t._v("T")]),t._v(", "),s("strong",[t._v("K")]),t._v("›("),s("code",[t._v("source")]),t._v(": T): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/mirror.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/mirror.ts:19"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("K")]),t._v(": "),s("em",[t._v("keyof T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("T")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: K")])])])}),[],!1,null,null,null);r.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{376:function(t,r,s){"use strict";s.r(r);var e=s(42),n=Object(e.a)({},(function(){var t=this,r=t.$createElement,s=t._self._c||r;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-mirror"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-mirror"}},[t._v("#")]),t._v(" Module: mirror")]),t._v(" "),s("p",[t._v("Generates a key mirror (also known as key-value mirror), which is an object where for each property, the key is the same as the value.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" mirror "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mirror")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'one'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'two'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'one', two: 'two' };")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("mirror")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" one"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" two"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'value'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { one: 'one', two: 'two' };")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"mirror"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#mirror"}},[t._v("#")]),t._v(" mirror")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("mirror")]),t._v("("),s("code",[t._v("source")]),t._v(": string[]): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/mirror.ts#L18",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/mirror.ts:18"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("string[]")]),t._v(" "),s("td",[t._v("Either an array of strings or an object from where to pick the mirrored keys and values. If it's an object, the values will be overwritten.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: string")])]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("mirror")]),t._v("‹"),s("strong",[t._v("T")]),t._v(", "),s("strong",[t._v("K")]),t._v("›("),s("code",[t._v("source")]),t._v(": T): "),s("em",[t._v("object")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/mirror.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/mirror.ts:19"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("K")]),t._v(": "),s("em",[t._v("keyof T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("source")])]),t._v(" "),s("td",[t._v("T")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("object")])]),t._v(" "),s("ul",[s("li",[t._v("[ "),s("strong",[t._v("key")]),t._v(": "),s("em",[t._v("string")]),t._v("]: K")])])])}),[],!1,null,null,null);r.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/15.16bfbd43.js b/assets/js/15.a1eba587.js similarity index 96% rename from assets/js/15.16bfbd43.js rename to assets/js/15.a1eba587.js index c67cd6a..0fdf378 100644 --- a/assets/js/15.16bfbd43.js +++ b/assets/js/15.a1eba587.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{376:function(t,s,e){"use strict";e.r(s);var r=e(42),n=Object(r.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-occurrences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-occurrences"}},[t._v("#")]),t._v(" Module: occurrences")]),t._v(" "),e("p",[t._v("Returns the number of times that a substring "),e("code",[t._v("search")]),t._v(" appears in a string "),e("code",[t._v("input")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" occurrences "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("occurrences")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mississippi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'i'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns 4")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("occurrences")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mississippi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ssi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns 2")]),t._v("\n")])])]),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"occurrences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#occurrences"}},[t._v("#")]),t._v(" occurrences")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("occurrences")]),t._v("("),e("code",[t._v("input")]),t._v(": string, "),e("code",[t._v("search")]),t._v(": string): "),e("em",[t._v("number")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/occurrences.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/occurrences.ts:19"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("input")])]),t._v(" "),e("td",[t._v("string")]),t._v(" "),e("td",[t._v("The string to search in.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("search")])]),t._v(" "),e("td",[t._v("string")]),t._v(" "),e("td",[t._v("The substring to be searched.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("number")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{377:function(t,s,e){"use strict";e.r(s);var r=e(42),n=Object(r.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-occurrences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-occurrences"}},[t._v("#")]),t._v(" Module: occurrences")]),t._v(" "),e("p",[t._v("Returns the number of times that a substring "),e("code",[t._v("search")]),t._v(" appears in a string "),e("code",[t._v("input")]),t._v(".")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" occurrences "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("occurrences")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mississippi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'i'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns 4")]),t._v("\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("occurrences")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mississippi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ssi'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns 2")]),t._v("\n")])])]),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"occurrences"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#occurrences"}},[t._v("#")]),t._v(" occurrences")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("occurrences")]),t._v("("),e("code",[t._v("input")]),t._v(": string, "),e("code",[t._v("search")]),t._v(": string): "),e("em",[t._v("number")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/occurrences.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/occurrences.ts:19"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("input")])]),t._v(" "),e("td",[t._v("string")]),t._v(" "),e("td",[t._v("The string to search in.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("search")])]),t._v(" "),e("td",[t._v("string")]),t._v(" "),e("td",[t._v("The substring to be searched.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("number")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/16.d53072cc.js b/assets/js/16.f44e1835.js similarity index 96% rename from assets/js/16.d53072cc.js rename to assets/js/16.f44e1835.js index 22c1faa..bf11556 100644 --- a/assets/js/16.d53072cc.js +++ b/assets/js/16.f44e1835.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{377:function(t,s,e){"use strict";e.r(s);var r=e(42),a=Object(r.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-omit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-omit"}},[t._v("#")]),t._v(" Module: omit")]),t._v(" "),e("p",[t._v("Takes an object and a list of properties to remove, and returns a new object equal to the original one but the listed properties removed.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" omit "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("omit")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" prop1"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stays'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" prop2"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'leaves'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'prop2'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { prop1: 'stays' }")]),t._v("\n")])])]),e("p",[e("strong",[e("code",[t._v("remark")])]),t._v("\nCurrently nested properties are not supported.")]),t._v(" "),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"omit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#omit"}},[t._v("#")]),t._v(" omit")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("omit")]),t._v("‹"),e("strong",[t._v("T")]),t._v(", "),e("strong",[t._v("K")]),t._v("›("),e("code",[t._v("source")]),t._v(": T, "),e("code",[t._v("properties")]),t._v(": K[]): "),e("em",[t._v("T")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/omit.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/omit.ts:22"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("K")]),t._v(": "),e("em",[t._v("keyof T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("source")])]),t._v(" "),e("td",[t._v("T")]),t._v(" "),e("td",[t._v("The original object to remove the properties from.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("properties")])]),t._v(" "),e("td",[t._v("K[]")]),t._v(" "),e("td",[t._v("An array of property names to be removed.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("T")])])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{378:function(t,s,e){"use strict";e.r(s);var r=e(42),a=Object(r.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-omit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-omit"}},[t._v("#")]),t._v(" Module: omit")]),t._v(" "),e("p",[t._v("Takes an object and a list of properties to remove, and returns a new object equal to the original one but the listed properties removed.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" omit "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("omit")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" prop1"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'stays'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" prop2"),e("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'leaves'")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'prop2'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { prop1: 'stays' }")]),t._v("\n")])])]),e("p",[e("strong",[e("code",[t._v("remark")])]),t._v("\nCurrently nested properties are not supported.")]),t._v(" "),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"omit"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#omit"}},[t._v("#")]),t._v(" omit")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("omit")]),t._v("‹"),e("strong",[t._v("T")]),t._v(", "),e("strong",[t._v("K")]),t._v("›("),e("code",[t._v("source")]),t._v(": T, "),e("code",[t._v("properties")]),t._v(": K[]): "),e("em",[t._v("T")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/omit.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/omit.ts:22"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("K")]),t._v(": "),e("em",[t._v("keyof T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("source")])]),t._v(" "),e("td",[t._v("T")]),t._v(" "),e("td",[t._v("The original object to remove the properties from.")])]),t._v(" "),e("tr",[e("td",[e("code",[t._v("properties")])]),t._v(" "),e("td",[t._v("K[]")]),t._v(" "),e("td",[t._v("An array of property names to be removed.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("T")])])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/17.aaf7b62d.js b/assets/js/17.f9a4c227.js similarity index 96% rename from assets/js/17.aaf7b62d.js rename to assets/js/17.f9a4c227.js index c98daa8..ac6c5e5 100644 --- a/assets/js/17.aaf7b62d.js +++ b/assets/js/17.f9a4c227.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{378:function(t,e,n){"use strict";n.r(e);var a=n(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"module-random"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#module-random"}},[t._v("#")]),t._v(" Module: random")]),t._v(" "),n("p",[t._v("Returns a random integer between a minimum and a maximum.")]),t._v(" "),n("div",{staticClass:"language-typescript extra-class"},[n("pre",{pre:!0,attrs:{class:"language-typescript"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" random "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("random")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns a random integer between 1 and 9")]),t._v("\n")])])]),n("p",[n("strong",[n("code",[t._v("remarks")])]),t._v("\nThis method does not provide cryptographically secure random numbers. Do not use them for anything related to security.")]),t._v(" "),n("h2",{attrs:{id:"functions"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),n("h3",{attrs:{id:"random"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#random"}},[t._v("#")]),t._v(" random")]),t._v(" "),n("p",[t._v("▸ "),n("strong",[t._v("random")]),t._v("("),n("code",[t._v("min")]),t._v(": number, "),n("code",[t._v("max")]),t._v(": number, "),n("code",[t._v("isMaxInclusive")]),t._v(": boolean): "),n("em",[t._v("number")])]),t._v(" "),n("p",[n("em",[t._v("Defined in "),n("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/random.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/random.ts:22"),n("OutboundLink")],1)])]),t._v(" "),n("p",[n("strong",[t._v("Parameters:")])]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Name")]),t._v(" "),n("th",[t._v("Type")]),t._v(" "),n("th",[t._v("Default")]),t._v(" "),n("th",[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("min")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("-")]),t._v(" "),n("td",[t._v("The lower number of the range (always inclusive).")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("max")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("min")]),t._v(" "),n("td",[t._v("The higher number of the range. Defaults to "),n("code",[t._v("min")]),t._v(".")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("isMaxInclusive")])]),t._v(" "),n("td",[t._v("boolean")]),t._v(" "),n("td",[t._v("false")]),t._v(" "),n("td",[t._v("Whether the higher number of the range should be inclusive or exclusive. Defaults to "),n("code",[t._v("false")]),t._v(".")])])])]),t._v(" "),n("p",[n("strong",[t._v("Returns:")]),t._v(" "),n("em",[t._v("number")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{379:function(t,e,n){"use strict";n.r(e);var a=n(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"module-random"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#module-random"}},[t._v("#")]),t._v(" Module: random")]),t._v(" "),n("p",[t._v("Returns a random integer between a minimum and a maximum.")]),t._v(" "),n("div",{staticClass:"language-typescript extra-class"},[n("pre",{pre:!0,attrs:{class:"language-typescript"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" random "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("random")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns a random integer between 1 and 9")]),t._v("\n")])])]),n("p",[n("strong",[n("code",[t._v("remarks")])]),t._v("\nThis method does not provide cryptographically secure random numbers. Do not use them for anything related to security.")]),t._v(" "),n("h2",{attrs:{id:"functions"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),n("h3",{attrs:{id:"random"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#random"}},[t._v("#")]),t._v(" random")]),t._v(" "),n("p",[t._v("▸ "),n("strong",[t._v("random")]),t._v("("),n("code",[t._v("min")]),t._v(": number, "),n("code",[t._v("max")]),t._v(": number, "),n("code",[t._v("isMaxInclusive")]),t._v(": boolean): "),n("em",[t._v("number")])]),t._v(" "),n("p",[n("em",[t._v("Defined in "),n("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/random.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/random.ts:22"),n("OutboundLink")],1)])]),t._v(" "),n("p",[n("strong",[t._v("Parameters:")])]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Name")]),t._v(" "),n("th",[t._v("Type")]),t._v(" "),n("th",[t._v("Default")]),t._v(" "),n("th",[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("min")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("-")]),t._v(" "),n("td",[t._v("The lower number of the range (always inclusive).")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("max")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("min")]),t._v(" "),n("td",[t._v("The higher number of the range. Defaults to "),n("code",[t._v("min")]),t._v(".")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("isMaxInclusive")])]),t._v(" "),n("td",[t._v("boolean")]),t._v(" "),n("td",[t._v("false")]),t._v(" "),n("td",[t._v("Whether the higher number of the range should be inclusive or exclusive. Defaults to "),n("code",[t._v("false")]),t._v(".")])])])]),t._v(" "),n("p",[n("strong",[t._v("Returns:")]),t._v(" "),n("em",[t._v("number")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/18.ea8d4348.js b/assets/js/18.ba51bc2c.js similarity index 97% rename from assets/js/18.ea8d4348.js rename to assets/js/18.ba51bc2c.js index 24512b8..2ccad82 100644 --- a/assets/js/18.ea8d4348.js +++ b/assets/js/18.ba51bc2c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{380:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-sample"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-sample"}},[t._v("#")]),t._v(" Module: sample")]),t._v(" "),a("p",[t._v("Returns one or more items of an array picked at random.")]),t._v(" "),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"sample"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sample"}},[t._v("#")]),t._v(" sample")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("sample")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("elements")]),t._v(": T[], "),a("code",[t._v("size")]),t._v(": number): "),a("em",[t._v("T[]")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/sample.ts#L38",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/sample.ts:38"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("Returns "),a("code",[t._v("n")]),t._v(" random elements from an array.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" sample "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sample")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns an array with two random elements from 1 to 5.")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Default")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("elements")])]),t._v(" "),a("td",[t._v("T[]")]),t._v(" "),a("td",[t._v("-")]),t._v(" "),a("td",[t._v("The array to get a random element from.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("size")])]),t._v(" "),a("td",[t._v("number")]),t._v(" "),a("td",[t._v("1")]),t._v(" "),a("td",[t._v("The amount of elements to pick. Defaults to 1.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("T[]")])]),t._v(" "),a("hr"),t._v(" "),a("h3",{attrs:{id:"sampleone"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sampleone"}},[t._v("#")]),t._v(" sampleOne")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("sampleOne")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("elements")]),t._v(": T[]): "),a("em",[t._v("T")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/sample.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/sample.ts:22"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("Returns a random element from an array.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" sampleOne "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sampleOne")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns a random element from 1 to 5.")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("elements")])]),t._v(" "),a("td",[t._v("T[]")]),t._v(" "),a("td",[t._v("The array to get a random element from.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("T")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{380:function(t,s,a){"use strict";a.r(s);var e=a(42),n=Object(e.a)({},(function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"module-sample"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#module-sample"}},[t._v("#")]),t._v(" Module: sample")]),t._v(" "),a("p",[t._v("Returns one or more items of an array picked at random.")]),t._v(" "),a("h2",{attrs:{id:"functions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),a("h3",{attrs:{id:"sample"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sample"}},[t._v("#")]),t._v(" sample")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("sample")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("elements")]),t._v(": T[], "),a("code",[t._v("size")]),t._v(": number): "),a("em",[t._v("T[]")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/sample.ts#L38",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/sample.ts:38"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("Returns "),a("code",[t._v("n")]),t._v(" random elements from an array.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" sample "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sample")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns an array with two random elements from 1 to 5.")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Default")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("elements")])]),t._v(" "),a("td",[t._v("T[]")]),t._v(" "),a("td",[t._v("-")]),t._v(" "),a("td",[t._v("The array to get a random element from.")])]),t._v(" "),a("tr",[a("td",[a("code",[t._v("size")])]),t._v(" "),a("td",[t._v("number")]),t._v(" "),a("td",[t._v("1")]),t._v(" "),a("td",[t._v("The amount of elements to pick. Defaults to 1.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("T[]")])]),t._v(" "),a("hr"),t._v(" "),a("h3",{attrs:{id:"sampleone"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#sampleone"}},[t._v("#")]),t._v(" sampleOne")]),t._v(" "),a("p",[t._v("▸ "),a("strong",[t._v("sampleOne")]),t._v("‹"),a("strong",[t._v("T")]),t._v("›("),a("code",[t._v("elements")]),t._v(": T[]): "),a("em",[t._v("T")])]),t._v(" "),a("p",[a("em",[t._v("Defined in "),a("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/sample.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/sample.ts:22"),a("OutboundLink")],1)])]),t._v(" "),a("p",[t._v("Returns a random element from an array.")]),t._v(" "),a("div",{staticClass:"language-typescript extra-class"},[a("pre",{pre:!0,attrs:{class:"language-typescript"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" sampleOne "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("sampleOne")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns a random element from 1 to 5.")]),t._v("\n")])])]),a("p",[a("strong",[t._v("Type parameters:")])]),t._v(" "),a("p",[t._v("▪ "),a("strong",[t._v("T")])]),t._v(" "),a("p",[a("strong",[t._v("Parameters:")])]),t._v(" "),a("table",[a("thead",[a("tr",[a("th",[t._v("Name")]),t._v(" "),a("th",[t._v("Type")]),t._v(" "),a("th",[t._v("Description")])])]),t._v(" "),a("tbody",[a("tr",[a("td",[a("code",[t._v("elements")])]),t._v(" "),a("td",[t._v("T[]")]),t._v(" "),a("td",[t._v("The array to get a random element from.")])])])]),t._v(" "),a("p",[a("strong",[t._v("Returns:")]),t._v(" "),a("em",[t._v("T")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/19.cbeca9a3.js b/assets/js/19.cd979674.js similarity index 98% rename from assets/js/19.cbeca9a3.js rename to assets/js/19.cd979674.js index 74679da..3259df2 100644 --- a/assets/js/19.cbeca9a3.js +++ b/assets/js/19.cd979674.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{381:function(t,s,e){"use strict";e.r(s);var a=e(42),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-shuffle"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-shuffle"}},[t._v("#")]),t._v(" Module: shuffle")]),t._v(" "),e("p",[t._v("Shuffles an array, i.e. returns a new array with same elements in a random order.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shuffle "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("shuffle")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2, 4, 1, 5, 3] (for example)")]),t._v("\n")])])]),e("p",[e("strong",[e("code",[t._v("remarks")])])]),t._v(" "),e("ul",[e("li",[t._v("This method uses a version of the Fisher-Yates shuffle.")]),t._v(" "),e("li",[t._v("This method does not mutate the array passed, but returns a new array instead.")])]),t._v(" "),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"shuffle"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shuffle"}},[t._v("#")]),t._v(" shuffle")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("shuffle")]),t._v("‹"),e("strong",[t._v("T")]),t._v("›("),e("code",[t._v("elements")]),t._v(": T[]): "),e("em",[t._v("T[]")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/shuffle.ts#L23",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/shuffle.ts:23"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("elements")])]),t._v(" "),e("td",[t._v("T[]")]),t._v(" "),e("td",[t._v("The array to be shuffled.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("T[]")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{381:function(t,s,e){"use strict";e.r(s);var a=e(42),n=Object(a.a)({},(function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"module-shuffle"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#module-shuffle"}},[t._v("#")]),t._v(" Module: shuffle")]),t._v(" "),e("p",[t._v("Shuffles an array, i.e. returns a new array with same elements in a random order.")]),t._v(" "),e("div",{staticClass:"language-typescript extra-class"},[e("pre",{pre:!0,attrs:{class:"language-typescript"}},[e("code",[e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shuffle "),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),e("span",{pre:!0,attrs:{class:"token function"}},[t._v("shuffle")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),e("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),e("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2, 4, 1, 5, 3] (for example)")]),t._v("\n")])])]),e("p",[e("strong",[e("code",[t._v("remarks")])])]),t._v(" "),e("ul",[e("li",[t._v("This method uses a version of the Fisher-Yates shuffle.")]),t._v(" "),e("li",[t._v("This method does not mutate the array passed, but returns a new array instead.")])]),t._v(" "),e("h2",{attrs:{id:"functions"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),e("h3",{attrs:{id:"shuffle"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#shuffle"}},[t._v("#")]),t._v(" shuffle")]),t._v(" "),e("p",[t._v("▸ "),e("strong",[t._v("shuffle")]),t._v("‹"),e("strong",[t._v("T")]),t._v("›("),e("code",[t._v("elements")]),t._v(": T[]): "),e("em",[t._v("T[]")])]),t._v(" "),e("p",[e("em",[t._v("Defined in "),e("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/shuffle.ts#L23",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/shuffle.ts:23"),e("OutboundLink")],1)])]),t._v(" "),e("p",[e("strong",[t._v("Type parameters:")])]),t._v(" "),e("p",[t._v("▪ "),e("strong",[t._v("T")])]),t._v(" "),e("p",[e("strong",[t._v("Parameters:")])]),t._v(" "),e("table",[e("thead",[e("tr",[e("th",[t._v("Name")]),t._v(" "),e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Description")])])]),t._v(" "),e("tbody",[e("tr",[e("td",[e("code",[t._v("elements")])]),t._v(" "),e("td",[t._v("T[]")]),t._v(" "),e("td",[t._v("The array to be shuffled.")])])])]),t._v(" "),e("p",[e("strong",[t._v("Returns:")]),t._v(" "),e("em",[t._v("T[]")])])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/5.2048ec6b.js b/assets/js/5.963da158.js similarity index 99% rename from assets/js/5.2048ec6b.js rename to assets/js/5.963da158.js index 4d46245..1db6e83 100644 --- a/assets/js/5.2048ec6b.js +++ b/assets/js/5.963da158.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{379:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist"}},[t._v("#")]),t._v(" utilist")]),t._v(" "),s("h1",{attrs:{id:"utilist-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist-2"}},[t._v("#")]),t._v(" utilist")]),t._v(" "),s("p",[s("img",{attrs:{src:"https://img.shields.io/npm/v/utilist?color=red&logo=npm",alt:"npm"}}),t._v(" "),s("img",{attrs:{src:"https://img.shields.io/bundlephobia/minzip/utilist",alt:"npm bundle size"}}),t._v(" "),s("img",{attrs:{src:"https://github.com/davguij/utilist/workflows/CI/badge.svg",alt:"CI"}}),t._v(" "),s("a",{attrs:{href:"https://codecov.io/gh/davguij/utilist",target:"_blank",rel:"noopener noreferrer"}},[s("img",{attrs:{src:"https://codecov.io/gh/davguij/utilist/branch/main/graph/badge.svg",alt:"codecov"}}),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("A modern utility library for JavaScript and TypeScript, both for the browser and for Node.js, that helps you solve routine tasks and common problems in a fast way, therefore letting you focus on what matters (building awesome stuff!)")]),t._v(" "),s("h2",{attrs:{id:"why-utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#why-utilist"}},[t._v("#")]),t._v(" Why "),s("strong",[t._v("utilist")])]),t._v(" "),s("p",[s("strong",[t._v("utilist")]),t._v(" is the spiritual successor of Underscore and Lodash, but it has been built in a time when ES6+ and the latest versions of the evergreen browsers and Node.js have effectively made redundant quite a big part of the functionality of those libraries.")]),t._v(" "),s("p",[t._v("With this in mind, "),s("strong",[t._v("utilist")]),t._v(" is:")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("lean")]),t._v(", as it only implements utilities that are still useful in the present times.")]),t._v(" "),s("li",[s("strong",[t._v("performant")]),t._v(", because it's modular and tree-shakeable, so you only add to your bundle those bytes that you're actually using.")]),t._v(" "),s("li",[s("strong",[t._v("reliable and safe")]),t._v(", for it's built without any external dependencies, and fully written in TypeScript.")])]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("p",[s("strong",[t._v("Using npm")])]),t._v(" "),s("p",[s("code",[t._v("npm install utilist")])]),t._v(" "),s("p",[s("strong",[t._v("Using yarn")])]),t._v(" "),s("p",[s("code",[t._v("yarn add utilist")])]),t._v(" "),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[s("strong",[t._v("utilist")]),t._v(" is exported in both CommonJS and ESM formats. This means you can import it with both "),s("code",[t._v("require")]),t._v(" (mostly for Node.js environments) and "),s("code",[t._v("import")]),t._v(" syntaxes.")]),t._v(" "),s("h3",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shuffle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// shuffles an array")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token generic-function"}},[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("shuffle")]),s("span",{pre:!0,attrs:{class:"token generic class-name"}},[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("number")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")])])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2, 5, 3, 4, 1]")]),t._v("\n")])])]),s("h3",{attrs:{id:"list-of-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#list-of-methods"}},[t._v("#")]),t._v(" List of methods")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("chunk()")]),t._v(" — Creates an array of elements split into subarrays the length of "),s("code",[t._v("size")]),t._v(". "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_difference_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("difference()")]),t._v(" — Takes two arrays and returns the difference between them as a new array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_difference_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("filterByValue()")]),t._v(" — Filters an object by its values. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_filter_object_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("isDate()")]),t._v(" — Assesses if the input is of the type Date. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_is_date_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("isEqual()")]),t._v(" — Compares two objects and returns whether their values are equivalent. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_is_equal_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("mapValues()")]),t._v(" — Like "),s("code",[t._v("map()")]),t._v(" but applied to the values of an object. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_map_values_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("occurrences()")]),t._v(" — Counts the number of times that a substring appears in a string. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_occurrences_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("omit()")]),t._v(" — Removes a list of properties from an object. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_omit_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("random()")]),t._v(" — Generates a random integer between a minimum and a maximum. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_random_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("sample()")]),t._v(" and "),s("code",[t._v("sampleOne()")]),t._v(" — Return one or more random elements from an array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_sample_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("shuffle()")]),t._v(" — Shuffles an array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_shuffle_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{367:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist"}},[t._v("#")]),t._v(" utilist")]),t._v(" "),s("h1",{attrs:{id:"utilist-2"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist-2"}},[t._v("#")]),t._v(" utilist")]),t._v(" "),s("p",[s("img",{attrs:{src:"https://img.shields.io/npm/v/utilist?color=red&logo=npm",alt:"npm"}}),t._v(" "),s("img",{attrs:{src:"https://img.shields.io/bundlephobia/minzip/utilist",alt:"npm bundle size"}}),t._v(" "),s("img",{attrs:{src:"https://github.com/davguij/utilist/workflows/CI/badge.svg",alt:"CI"}}),t._v(" "),s("a",{attrs:{href:"https://codecov.io/gh/davguij/utilist",target:"_blank",rel:"noopener noreferrer"}},[s("img",{attrs:{src:"https://codecov.io/gh/davguij/utilist/branch/main/graph/badge.svg",alt:"codecov"}}),s("OutboundLink")],1)]),t._v(" "),s("p",[t._v("A modern utility library for JavaScript and TypeScript, both for the browser and for Node.js, that helps you solve routine tasks and common problems in a fast way, therefore letting you focus on what matters (building awesome stuff!)")]),t._v(" "),s("h2",{attrs:{id:"why-utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#why-utilist"}},[t._v("#")]),t._v(" Why "),s("strong",[t._v("utilist")])]),t._v(" "),s("p",[s("strong",[t._v("utilist")]),t._v(" is the spiritual successor of Underscore and Lodash, but it has been built in a time when ES6+ and the latest versions of the evergreen browsers and Node.js have effectively made redundant quite a big part of the functionality of those libraries.")]),t._v(" "),s("p",[t._v("With this in mind, "),s("strong",[t._v("utilist")]),t._v(" is:")]),t._v(" "),s("ul",[s("li",[s("strong",[t._v("lean")]),t._v(", as it only implements utilities that are still useful in the present times.")]),t._v(" "),s("li",[s("strong",[t._v("performant")]),t._v(", because it's modular and tree-shakeable, so you only add to your bundle those bytes that you're actually using.")]),t._v(" "),s("li",[s("strong",[t._v("reliable and safe")]),t._v(", for it's built without any external dependencies, and fully written in TypeScript.")])]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("p",[s("strong",[t._v("Using npm")])]),t._v(" "),s("p",[s("code",[t._v("npm install utilist")])]),t._v(" "),s("p",[s("strong",[t._v("Using yarn")])]),t._v(" "),s("p",[s("code",[t._v("yarn add utilist")])]),t._v(" "),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[s("strong",[t._v("utilist")]),t._v(" is exported in both CommonJS and ESM formats. This means you can import it with both "),s("code",[t._v("require")]),t._v(" (mostly for Node.js environments) and "),s("code",[t._v("import")]),t._v(" syntaxes.")]),t._v(" "),s("h3",{attrs:{id:"example"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[t._v("#")]),t._v(" Example")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shuffle "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// shuffles an array")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token generic-function"}},[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("shuffle")]),s("span",{pre:!0,attrs:{class:"token generic class-name"}},[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("number")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")])])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2, 5, 3, 4, 1]")]),t._v("\n")])])]),s("h3",{attrs:{id:"list-of-methods"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#list-of-methods"}},[t._v("#")]),t._v(" List of methods")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("chunk()")]),t._v(" — Creates an array of elements split into subarrays the length of "),s("code",[t._v("size")]),t._v(". "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_difference_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("difference()")]),t._v(" — Takes two arrays and returns the difference between them as a new array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_difference_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("filterByValue()")]),t._v(" — Filters an object by its values. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_filter_object_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("isDate()")]),t._v(" — Assesses if the input is of the type Date. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_is_date_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("isEqual()")]),t._v(" — Compares two objects and returns whether their values are equivalent. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_is_equal_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("mapValues()")]),t._v(" — Like "),s("code",[t._v("map()")]),t._v(" but applied to the values of an object. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_map_values_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("occurrences()")]),t._v(" — Counts the number of times that a substring appears in a string. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_occurrences_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("omit()")]),t._v(" — Removes a list of properties from an object. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_omit_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("random()")]),t._v(" — Generates a random integer between a minimum and a maximum. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_random_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("sample()")]),t._v(" and "),s("code",[t._v("sampleOne()")]),t._v(" — Return one or more random elements from an array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_sample_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)]),t._v(" "),s("li",[s("code",[t._v("shuffle()")]),t._v(" — Shuffles an array. "),s("a",{attrs:{href:"https://davguij.github.io/utilist/modules/_shuffle_.html",target:"_blank",rel:"noopener noreferrer"}},[t._v("See documentation."),s("OutboundLink")],1)])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/6.71795fc6.js b/assets/js/6.125341a3.js similarity index 85% rename from assets/js/6.71795fc6.js rename to assets/js/6.125341a3.js index d3229ab..8b86bfa 100644 --- a/assets/js/6.71795fc6.js +++ b/assets/js/6.125341a3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{367:function(t,s,i){"use strict";i.r(s);var e=i(42),n=Object(e.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist"}},[this._v("#")]),this._v(" utilist")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{368:function(t,s,i){"use strict";i.r(s);var e=i(42),n=Object(e.a)({},(function(){var t=this.$createElement,s=this._self._c||t;return s("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}},[s("h1",{attrs:{id:"utilist"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#utilist"}},[this._v("#")]),this._v(" utilist")])])}),[],!1,null,null,null);s.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/7.ccbdeccb.js b/assets/js/7.987adca2.js similarity index 96% rename from assets/js/7.ccbdeccb.js rename to assets/js/7.987adca2.js index 3168876..e300bbb 100644 --- a/assets/js/7.ccbdeccb.js +++ b/assets/js/7.987adca2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{368:function(t,s,n){"use strict";n.r(s);var e=n(42),a=Object(e.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"module-chunk"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#module-chunk"}},[t._v("#")]),t._v(" Module: chunk")]),t._v(" "),n("p",[t._v("Creates an array of elements split into subarrays the length of "),n("code",[t._v("size")]),t._v(". If "),n("code",[t._v("elements")]),t._v(" can't be split evenly, the final chunk will contain the remaining elements.")]),t._v(" "),n("div",{staticClass:"language-typescript extra-class"},[n("pre",{pre:!0,attrs:{class:"language-typescript"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" chunk "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("chunk")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [[0, 1, 2, 3], [4, 5]]")]),t._v("\n")])])]),n("h2",{attrs:{id:"functions"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),n("h3",{attrs:{id:"chunk"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#chunk"}},[t._v("#")]),t._v(" chunk")]),t._v(" "),n("p",[t._v("▸ "),n("strong",[t._v("chunk")]),t._v("‹"),n("strong",[t._v("T")]),t._v("›("),n("code",[t._v("elements")]),t._v(": T[], "),n("code",[t._v("size")]),t._v(": number): "),n("em",[t._v("T[][]")])]),t._v(" "),n("p",[n("em",[t._v("Defined in "),n("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/chunk.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/chunk.ts:19"),n("OutboundLink")],1)])]),t._v(" "),n("p",[n("strong",[t._v("Type parameters:")])]),t._v(" "),n("p",[t._v("▪ "),n("strong",[t._v("T")])]),t._v(" "),n("p",[n("strong",[t._v("Parameters:")])]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Name")]),t._v(" "),n("th",[t._v("Type")]),t._v(" "),n("th",[t._v("Default")]),t._v(" "),n("th",[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("elements")])]),t._v(" "),n("td",[t._v("T[]")]),t._v(" "),n("td",[t._v("-")]),t._v(" "),n("td",[t._v("The array to split.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("size")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("1")]),t._v(" "),n("td",[t._v("The amount of elements in each subarrays.")])])])]),t._v(" "),n("p",[n("strong",[t._v("Returns:")]),t._v(" "),n("em",[t._v("T[][]")])])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{369:function(t,s,n){"use strict";n.r(s);var e=n(42),a=Object(e.a)({},(function(){var t=this,s=t.$createElement,n=t._self._c||s;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"module-chunk"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#module-chunk"}},[t._v("#")]),t._v(" Module: chunk")]),t._v(" "),n("p",[t._v("Creates an array of elements split into subarrays the length of "),n("code",[t._v("size")]),t._v(". If "),n("code",[t._v("elements")]),t._v(" can't be split evenly, the final chunk will contain the remaining elements.")]),t._v(" "),n("div",{staticClass:"language-typescript extra-class"},[n("pre",{pre:!0,attrs:{class:"language-typescript"}},[n("code",[n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" chunk "),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),n("span",{pre:!0,attrs:{class:"token function"}},[t._v("chunk")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("5")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token number"}},[t._v("4")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),n("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),n("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [[0, 1, 2, 3], [4, 5]]")]),t._v("\n")])])]),n("h2",{attrs:{id:"functions"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),n("h3",{attrs:{id:"chunk"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#chunk"}},[t._v("#")]),t._v(" chunk")]),t._v(" "),n("p",[t._v("▸ "),n("strong",[t._v("chunk")]),t._v("‹"),n("strong",[t._v("T")]),t._v("›("),n("code",[t._v("elements")]),t._v(": T[], "),n("code",[t._v("size")]),t._v(": number): "),n("em",[t._v("T[][]")])]),t._v(" "),n("p",[n("em",[t._v("Defined in "),n("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/chunk.ts#L19",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/chunk.ts:19"),n("OutboundLink")],1)])]),t._v(" "),n("p",[n("strong",[t._v("Type parameters:")])]),t._v(" "),n("p",[t._v("▪ "),n("strong",[t._v("T")])]),t._v(" "),n("p",[n("strong",[t._v("Parameters:")])]),t._v(" "),n("table",[n("thead",[n("tr",[n("th",[t._v("Name")]),t._v(" "),n("th",[t._v("Type")]),t._v(" "),n("th",[t._v("Default")]),t._v(" "),n("th",[t._v("Description")])])]),t._v(" "),n("tbody",[n("tr",[n("td",[n("code",[t._v("elements")])]),t._v(" "),n("td",[t._v("T[]")]),t._v(" "),n("td",[t._v("-")]),t._v(" "),n("td",[t._v("The array to split.")])]),t._v(" "),n("tr",[n("td",[n("code",[t._v("size")])]),t._v(" "),n("td",[t._v("number")]),t._v(" "),n("td",[t._v("1")]),t._v(" "),n("td",[t._v("The amount of elements in each subarrays.")])])])]),t._v(" "),n("p",[n("strong",[t._v("Returns:")]),t._v(" "),n("em",[t._v("T[][]")])])])}),[],!1,null,null,null);s.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/8.3cdbb7d4.js b/assets/js/8.9286c760.js similarity index 96% rename from assets/js/8.3cdbb7d4.js rename to assets/js/8.9286c760.js index 606e6a1..e9bd044 100644 --- a/assets/js/8.3cdbb7d4.js +++ b/assets/js/8.9286c760.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{369:function(t,e,s){"use strict";s.r(e);var n=s(42),a=Object(n.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-difference"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-difference"}},[t._v("#")]),t._v(" Module: difference")]),t._v(" "),s("p",[t._v('Takes two arrays and returns the difference between them as a new array.\nIn this case, "difference" is to be understood as the elements of one array not present in the other.')]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" difference "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("difference")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2]")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"difference"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#difference"}},[t._v("#")]),t._v(" difference")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("difference")]),t._v("‹"),s("strong",[t._v("T")]),t._v("›("),s("code",[t._v("first")]),t._v(": T[], "),s("code",[t._v("second")]),t._v(": T[]): "),s("em",[t._v("T[]")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/difference.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/difference.ts:22"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("first")])]),t._v(" "),s("td",[t._v("T[]")]),t._v(" "),s("td",[t._v("First array.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("second")])]),t._v(" "),s("td",[t._v("T[]")]),t._v(" "),s("td",[t._v("Second array.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("T[]")])])])}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{370:function(t,e,s){"use strict";s.r(e);var n=s(42),a=Object(n.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-difference"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-difference"}},[t._v("#")]),t._v(" Module: difference")]),t._v(" "),s("p",[t._v('Takes two arrays and returns the difference between them as a new array.\nIn this case, "difference" is to be understood as the elements of one array not present in the other.')]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" difference "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("difference")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns [2]")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"difference"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#difference"}},[t._v("#")]),t._v(" difference")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("difference")]),t._v("‹"),s("strong",[t._v("T")]),t._v("›("),s("code",[t._v("first")]),t._v(": T[], "),s("code",[t._v("second")]),t._v(": T[]): "),s("em",[t._v("T[]")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/difference.ts#L22",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/difference.ts:22"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")]),t._v(" "),s("th",[t._v("Description")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("first")])]),t._v(" "),s("td",[t._v("T[]")]),t._v(" "),s("td",[t._v("First array.")])]),t._v(" "),s("tr",[s("td",[s("code",[t._v("second")])]),t._v(" "),s("td",[t._v("T[]")]),t._v(" "),s("td",[t._v("Second array.")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("T[]")])])])}),[],!1,null,null,null);e.default=a.exports}}]); \ No newline at end of file diff --git a/assets/js/9.7046360a.js b/assets/js/9.9079a1bd.js similarity index 97% rename from assets/js/9.7046360a.js rename to assets/js/9.9079a1bd.js index a9f2d74..915ee6d 100644 --- a/assets/js/9.7046360a.js +++ b/assets/js/9.9079a1bd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{370:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-filterobject"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-filterobject"}},[t._v("#")]),t._v(" Module: filterObject")]),t._v(" "),s("p",[t._v("Returns a new object identical to the "),s("code",[t._v("source")]),t._v(" object, but without the entries for which the function "),s("code",[t._v("fn")]),t._v(" returns false.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" filterByValue "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("filterByValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" value "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { a: 1, b: 2 }")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"filterbyvalue"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#filterbyvalue"}},[t._v("#")]),t._v(" filterByValue")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("filterByValue")]),t._v("‹"),s("strong",[t._v("T")]),t._v(", "),s("strong",[t._v("K")]),t._v("›("),s("code",[t._v("source")]),t._v(": T, "),s("code",[t._v("fn")]),t._v(": function): "),s("em",[t._v("any")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/070f421/src/filter-object.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/filter-object.ts:20"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("K")]),t._v(": "),s("em",[t._v("keyof T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("source")]),t._v(": "),s("em",[t._v("T")])]),t._v(" "),s("p",[t._v("Object to filter.")]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("fn")]),t._v(": "),s("em",[t._v("function")])]),t._v(" "),s("p",[t._v("Function used to filter each value. Needs to return a boolean.")]),t._v(" "),s("p",[t._v("▸ ("),s("code",[t._v("value")]),t._v(": T[K]): "),s("em",[t._v("boolean")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("value")])]),t._v(" "),s("td",[t._v("T[K]")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("any")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{371:function(t,e,s){"use strict";s.r(e);var a=s(42),r=Object(a.a)({},(function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"module-filterobject"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#module-filterobject"}},[t._v("#")]),t._v(" Module: filterObject")]),t._v(" "),s("p",[t._v("Returns a new object identical to the "),s("code",[t._v("source")]),t._v(" object, but without the entries for which the function "),s("code",[t._v("fn")]),t._v(" returns false.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" filterByValue "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'utilist'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("filterByValue")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" a"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" b"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" c"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("value"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" value "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// returns { a: 1, b: 2 }")]),t._v("\n")])])]),s("h2",{attrs:{id:"functions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#functions"}},[t._v("#")]),t._v(" Functions")]),t._v(" "),s("h3",{attrs:{id:"filterbyvalue"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#filterbyvalue"}},[t._v("#")]),t._v(" filterByValue")]),t._v(" "),s("p",[t._v("▸ "),s("strong",[t._v("filterByValue")]),t._v("‹"),s("strong",[t._v("T")]),t._v(", "),s("strong",[t._v("K")]),t._v("›("),s("code",[t._v("source")]),t._v(": T, "),s("code",[t._v("fn")]),t._v(": function): "),s("em",[t._v("any")])]),t._v(" "),s("p",[s("em",[t._v("Defined in "),s("a",{attrs:{href:"https://github.com/davguij/utilist/blob/3435028/src/filter-object.ts#L20",target:"_blank",rel:"noopener noreferrer"}},[t._v("src/filter-object.ts:20"),s("OutboundLink")],1)])]),t._v(" "),s("p",[s("strong",[t._v("Type parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("T")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("K")]),t._v(": "),s("em",[t._v("keyof T")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("source")]),t._v(": "),s("em",[t._v("T")])]),t._v(" "),s("p",[t._v("Object to filter.")]),t._v(" "),s("p",[t._v("▪ "),s("strong",[t._v("fn")]),t._v(": "),s("em",[t._v("function")])]),t._v(" "),s("p",[t._v("Function used to filter each value. Needs to return a boolean.")]),t._v(" "),s("p",[t._v("▸ ("),s("code",[t._v("value")]),t._v(": T[K]): "),s("em",[t._v("boolean")])]),t._v(" "),s("p",[s("strong",[t._v("Parameters:")])]),t._v(" "),s("table",[s("thead",[s("tr",[s("th",[t._v("Name")]),t._v(" "),s("th",[t._v("Type")])])]),t._v(" "),s("tbody",[s("tr",[s("td",[s("code",[t._v("value")])]),t._v(" "),s("td",[t._v("T[K]")])])])]),t._v(" "),s("p",[s("strong",[t._v("Returns:")]),t._v(" "),s("em",[t._v("any")])])])}),[],!1,null,null,null);e.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/app.52e0f118.js b/assets/js/app.433ba986.js similarity index 96% rename from assets/js/app.52e0f118.js rename to assets/js/app.433ba986.js index dbad135..b82829e 100644 --- a/assets/js/app.52e0f118.js +++ b/assets/js/app.433ba986.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(t){function e(e){for(var r,a,u=e[0],c=e[1],s=e[2],l=0,p=[];l0?o(r(t),9007199254740991):0}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(31),o=n(23);t.exports=function(t){return r(o(t))}},function(t,e,n){var r=n(140),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();t.exports=i},function(t,e,n){var r=n(6),o=n(1),i=n(7),a=Object.defineProperty,u={},c=function(t){throw t};t.exports=function(t,e){if(i(u,t))return u[t];e||(e={});var n=[][t],s=!!i(e,"ACCESSORS")&&e.ACCESSORS,f=i(e,0)?e[0]:c,l=i(e,1)?e[1]:void 0;return u[t]=!!n&&!o((function(){if(s&&!r)return!0;var t={length:-1};s?a(t,1,{enumerable:!0,get:c}):t[1]=1,n.call(t,f,l)}))}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(110),o=n(3),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t])||i(o[t]):r[t]&&r[t][e]||o[t]&&o[t][e]}},function(t,e){t.exports=!1},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,n){var r=n(220),o=n(223);t.exports=function(t,e){var n=o(t,e);return r(n)?n:void 0}},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,n){"use strict";var r=n(0),o=n(29).filter,i=n(51),a=n(17),u=i("filter"),c=a("filter");r({target:"Array",proto:!0,forced:!u||!c},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(6),o=n(75),i=n(32),a=n(15),u=n(44),c=n(7),s=n(105),f=Object.getOwnPropertyDescriptor;e.f=r?f:function(t,e){if(t=a(t),e=u(e,!0),s)try{return f(t,e)}catch(t){}if(c(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){"use strict";var r=n(128).charAt,o=n(28),i=n(111),a=o.set,u=o.getterFor("String Iterator");i(String,"String",(function(t){a(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=u(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,n){var r,o,i,a=n(180),u=n(3),c=n(4),s=n(11),f=n(7),l=n(48),p=n(34),h=u.WeakMap;if(a){var d=new h,v=d.get,y=d.has,m=d.set;r=function(t,e){return m.call(d,t,e),e},o=function(t){return v.call(d,t)||{}},i=function(t){return y.call(d,t)}}else{var g=l("state");p[g]=!0,r=function(t,e){return s(t,g,e),e},o=function(t){return f(t,g)?t[g]:{}},i=function(t){return f(t,g)}}t.exports={set:r,get:o,has:i,enforce:function(t){return i(t)?o(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!c(e)||(n=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},function(t,e,n){var r=n(50),o=n(31),i=n(12),a=n(13),u=n(127),c=[].push,s=function(t){var e=1==t,n=2==t,s=3==t,f=4==t,l=6==t,p=5==t||l;return function(h,d,v,y){for(var m,g,b=i(h),_=o(b),x=r(d,v,3),w=a(_.length),O=0,S=y||u,j=e?S(h,w):n?S(h,0):void 0;w>O;O++)if((p||O in _)&&(g=x(m=_[O],O,b),t))if(e)j[O]=g;else if(g)switch(t){case 3:return!0;case 5:return m;case 6:return O;case 2:c.call(j,m)}else if(f)return!1;return l?-1:s||f?f:j}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6)}},function(t,e,n){var r=n(39),o=n(205),i=n(206),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,n){var r=n(1),o=n(18),i="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var r,o=n(5),i=n(179),a=n(73),u=n(34),c=n(109),s=n(70),f=n(48),l=f("IE_PROTO"),p=function(){},h=function(t){return" + diff --git a/index.html b/index.html index 0d70479..d42e1c6 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + @@ -15,6 +15,6 @@ shuffle<number>([1, 2, 3, 4, 5]); // returns [2, 5, 3, 4, 1]

# List of methods

- + diff --git a/modules/chunk.html b/modules/chunk.html index 32c6001..9a941e7 100644 --- a/modules/chunk.html +++ b/modules/chunk.html @@ -7,18 +7,18 @@ - +

# Module: chunk

Creates an array of elements split into subarrays the length of size. If elements can't be split evenly, the final chunk will contain the remaining elements.

import { chunk } from 'utilist';
 
 chunk([0, 1, 2, 3, 4, 5], 4); // returns [[0, 1, 2, 3], [4, 5]]
-

# Functions

# chunk

chunkT›(elements: T[], size: number): T[][]

Defined in src/chunk.ts:19

Type parameters:

T

Parameters:

Name Type Default Description
elements T[] - The array to split.
size number 1 The amount of elements in each subarrays.

Returns: T[][]

# Functions

# chunk

chunkT›(elements: T[], size: number): T[][]

Defined in src/chunk.ts:19

Type parameters:

T

Parameters:

Name Type Default Description
elements T[] - The array to split.
size number 1 The amount of elements in each subarrays.

Returns: T[][]

- + diff --git a/modules/difference.html b/modules/difference.html index a397f62..3ef699f 100644 --- a/modules/difference.html +++ b/modules/difference.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ In this case, "difference" is to be understood as the elements of one array not present in the other.

import { difference } from 'utilist';
 
 difference([1, 2, 3], [1, 3]); // returns [2]
-

# Functions

# difference

differenceT›(first: T[], second: T[]): T[]

Defined in src/difference.ts:22

Type parameters:

T

Parameters:

Name Type Description
first T[] First array.
second T[] Second array.

Returns: T[]

# Functions

# difference

differenceT›(first: T[], second: T[]): T[]

Defined in src/difference.ts:22

Type parameters:

T

Parameters:

Name Type Description
first T[] First array.
second T[] Second array.

Returns: T[]

- + diff --git a/modules/filterobject.html b/modules/filterobject.html index 3c2dad1..43bb5d6 100644 --- a/modules/filterobject.html +++ b/modules/filterobject.html @@ -7,14 +7,14 @@ - +

# Module: filterObject

Returns a new object identical to the source object, but without the entries for which the function fn returns false.

import { filterByValue } from 'utilist';
 
 filterByValue({ a: 1, b: 2, c: 3 }, (value) => value <= 2); // returns { a: 1, b: 2 }
-

# Functions

# filterByValue

filterByValueT, K›(source: T, fn: function): any

Defined in src/filter-object.ts:20

Type parameters:

T

K: keyof T

Parameters:

source: T

Object to filter.

fn: function

Function used to filter each value. Needs to return a boolean.

▸ (value: T[K]): boolean

Parameters:

Name Type
value T[K]

Returns: any

# Functions

# filterByValue

filterByValueT, K›(source: T, fn: function): any

Defined in src/filter-object.ts:20

Type parameters:

T

K: keyof T

Parameters:

source: T

Object to filter.

fn: function

Function used to filter each value. Needs to return a boolean.

▸ (value: T[K]): boolean

Parameters:

Name Type
value T[K]

Returns: any

- + diff --git a/modules/flip.html b/modules/flip.html index 53e1b40..40213a9 100644 --- a/modules/flip.html +++ b/modules/flip.html @@ -7,14 +7,14 @@ - +

# Module: flip

Returns a new object identical to the source object, but with the key and the value swapped on each of its own enumerable properties.

import { flip } from 'utilist';
 
 flip({ key: 'value', left: 'right' }); // returns { value: 'key', right: 'left' }
-

remark Does not mutate the original object.

# Functions

# flip

flipT›(source: T): object

Defined in src/flip.ts:20

Type parameters:

T: object

Parameters:

Name Type Description
source T The object of which the keys and the values should be swapped.

Returns: object

  • [ key: string]: string

remark Does not mutate the original object.

# Functions

# flip

flipT›(source: T): object

Defined in src/flip.ts:20

Type parameters:

T: object

Parameters:

Name Type Description
source T The object of which the keys and the values should be swapped.

Returns: object

  • [ key: string]: string
- + diff --git a/modules/isdate.html b/modules/isdate.html index d6def9b..b717e90 100644 --- a/modules/isdate.html +++ b/modules/isdate.html @@ -7,7 +7,7 @@ - + @@ -16,7 +16,7 @@ isDate(new Date('2020-01-01')); // returns true isDate('2020-01-01'); // returns false

remarks -Date entities are remarkably hard to identify safely in JavaScript.

# Functions

# isDate

isDate(input: unknown): boolean

Defined in src/is-date.ts:22

Parameters:

Name Type Description
input unknown Any type of input is accepted.

Returns: boolean

- + diff --git a/modules/isequal.html b/modules/isequal.html index 57209c5..cc722fe 100644 --- a/modules/isequal.html +++ b/modules/isequal.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ isEqual({ key: 'value' }, { key: 'value' }); // returns true isEqual({ key: 'value' }, { anotherKey: 'another value' }); // returns false -

# Functions

# isEqual

isEqualT›(first: T, second: T): boolean

Defined in src/is-equal.ts:21

Type parameters:

T: object

Type of objects to compare. Both of them have to be of the same type. Type has to extend the standard, generic JavaScript object (with strings as keys).

Parameters:

Name Type Description
first T The first object to compare
second T The second object to compare

Returns: boolean

# Functions

# isEqual

isEqualT›(first: T, second: T): boolean

Defined in src/is-equal.ts:21

Type parameters:

T: object

Type of objects to compare. Both of them have to be of the same type. Type has to extend the standard, generic JavaScript object (with strings as keys).

Parameters:

Name Type Description
first T The first object to compare
second T The second object to compare

Returns: boolean

- + diff --git a/modules/mapvalues.html b/modules/mapvalues.html index 8128282..1db01d7 100644 --- a/modules/mapvalues.html +++ b/modules/mapvalues.html @@ -7,14 +7,14 @@ - +

# Module: mapValues

Creates an object with the same keys as the source object and values generated by running each own enumerable property of source thru the fn function.

import { mapValues } from 'utilist';
 
 mapValues({ one: 'one' }, (item) => item.toUpperCase()); // returns { one: 'ONE' }
-

# Functions

# mapValues

mapValuesT, K›(source: T, fn: function): object

Defined in src/map-values.ts:20

Type parameters:

T

K: keyof T

Parameters:

source: T

Object to map the values from.

fn: function

Function to apply to each value.

▸ (value: T[K], key: K): T[K]

Parameters:

Name Type
value T[K]
key K

Returns: object

  • [ k: string]: T

# Functions

# mapValues

mapValuesT, K›(source: T, fn: function): object

Defined in src/map-values.ts:20

Type parameters:

T

K: keyof T

Parameters:

source: T

Object to map the values from.

fn: function

Function to apply to each value.

▸ (value: T[K], key: K): T[K]

Parameters:

Name Type
value T[K]
key K

Returns: object

  • [ k: string]: T
- + diff --git a/modules/mirror.html b/modules/mirror.html index fb04629..ec96c5b 100644 --- a/modules/mirror.html +++ b/modules/mirror.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ mirror(['one', 'two']); // returns { one: 'one', two: 'two' }; mirror({ one: null, two: 'value' }); // returns { one: 'one', two: 'two' }; -

# Functions

# mirror

mirror(source: string[]): object

Defined in src/mirror.ts:18

Parameters:

Name Type Description
source string[] Either an array of strings or an object from where to pick the mirrored keys and values. If it's an object, the values will be overwritten.

Returns: object

mirrorT, K›(source: T): object

Defined in src/mirror.ts:19

Type parameters:

T

K: keyof T

Parameters:

Name Type
source T

Returns: object

# Functions

# mirror

mirror(source: string[]): object

Defined in src/mirror.ts:18

Parameters:

Name Type Description
source string[] Either an array of strings or an object from where to pick the mirrored keys and values. If it's an object, the values will be overwritten.

Returns: object

mirrorT, K›(source: T): object

Defined in src/mirror.ts:19

Type parameters:

T

K: keyof T

Parameters:

Name Type
source T

Returns: object

- + diff --git a/modules/occurrences.html b/modules/occurrences.html index 84fa539..d1609b6 100644 --- a/modules/occurrences.html +++ b/modules/occurrences.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ occurrences('mississippi', 'i'); // returns 4 occurrences('mississippi', 'ssi'); // returns 2 -

# Functions

# occurrences

occurrences(input: string, search: string): number

Defined in src/occurrences.ts:19

Parameters:

Name Type Description
input string The string to search in.
search string The substring to be searched.

Returns: number

# Functions

# occurrences

occurrences(input: string, search: string): number

Defined in src/occurrences.ts:19

Parameters:

Name Type Description
input string The string to search in.
search string The substring to be searched.

Returns: number

- + diff --git a/modules/omit.html b/modules/omit.html index 22ba56f..9524704 100644 --- a/modules/omit.html +++ b/modules/omit.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ omit({ prop1: 'stays', prop2: 'leaves' }, ['prop2']); // returns { prop1: 'stays' }

remark -Currently nested properties are not supported.

# Functions

# omit

omitT, K›(source: T, properties: K[]): T

Defined in src/omit.ts:22

Type parameters:

T

K: keyof T

Parameters:

Name Type Description
source T The original object to remove the properties from.
properties K[] An array of property names to be removed.

Returns: T

- + diff --git a/modules/random.html b/modules/random.html index e80de2b..cce82f5 100644 --- a/modules/random.html +++ b/modules/random.html @@ -7,7 +7,7 @@ - + @@ -15,7 +15,7 @@ random(1, 10); // returns a random integer between 1 and 9

remarks -This method does not provide cryptographically secure random numbers. Do not use them for anything related to security.

# Functions

# random

random(min: number, max: number, isMaxInclusive: boolean): number

Defined in src/random.ts:22

Parameters:

Name Type Default Description
min number - The lower number of the range (always inclusive).
max number min The higher number of the range. Defaults to min.
isMaxInclusive boolean false Whether the higher number of the range should be inclusive or exclusive. Defaults to false.

Returns: number

- + diff --git a/modules/sample.html b/modules/sample.html index c935d75..903ccb9 100644 --- a/modules/sample.html +++ b/modules/sample.html @@ -7,14 +7,14 @@ - + -

# Module: sample

Returns one or more items of an array picked at random.

# Functions

# sample

sampleT›(elements: T[], size: number): T[]

Defined in src/sample.ts:38

Returns n random elements from an array.

import { sample } from 'utilist';
+    

# Module: sample

Returns one or more items of an array picked at random.

# Functions

# sample

sampleT›(elements: T[], size: number): T[]

Defined in src/sample.ts:38

Returns n random elements from an array.

import { sample } from 'utilist';
 
 sample([1, 2, 3, 4, 5], 2); // returns an array with two random elements from 1 to 5.
-

Type parameters:

T

Parameters:

Name Type Default Description
elements T[] - The array to get a random element from.
size number 1 The amount of elements to pick. Defaults to 1.

Returns: T[]


# sampleOne

sampleOneT›(elements: T[]): T

Defined in src/sample.ts:22

Returns a random element from an array.

import { sampleOne } from 'utilist';
+

Type parameters:

T

Parameters:

Name Type Default Description
elements T[] - The array to get a random element from.
size number 1 The amount of elements to pick. Defaults to 1.

Returns: T[]


# sampleOne

sampleOneT›(elements: T[]): T

Defined in src/sample.ts:22

Returns a random element from an array.

import { sampleOne } from 'utilist';
 
 sampleOne([1, 2, 3, 4, 5]); // returns a random element from 1 to 5.
 

Type parameters:

T

Parameters:

Name Type Description
elements T[] The array to get a random element from.

Returns: T

- + diff --git a/modules/shuffle.html b/modules/shuffle.html index 3508e5a..2da7eae 100644 --- a/modules/shuffle.html +++ b/modules/shuffle.html @@ -7,18 +7,18 @@ - +

# Module: shuffle

Shuffles an array, i.e. returns a new array with same elements in a random order.

import { shuffle } from 'utilist';
 
 shuffle([1, 2, 3, 4, 5]); // returns [2, 4, 1, 5, 3] (for example)
-

remarks

  • This method uses a version of the Fisher-Yates shuffle.
  • This method does not mutate the array passed, but returns a new array instead.

# Functions

# shuffle

shuffleT›(elements: T[]): T[]

Defined in src/shuffle.ts:23

Type parameters:

T

Parameters:

Name Type Description
elements T[] The array to be shuffled.

Returns: T[]

remarks

  • This method uses a version of the Fisher-Yates shuffle.
  • This method does not mutate the array passed, but returns a new array instead.

# Functions

# shuffle

shuffleT›(elements: T[]): T[]

Defined in src/shuffle.ts:23

Type parameters:

T

Parameters:

Name Type Description
elements T[] The array to be shuffled.

Returns: T[]

- +