Skip to content

Commit

Permalink
📝 chore(docs): update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
OysterD3 committed Jul 22, 2022
1 parent c5eef0e commit c225136
Show file tree
Hide file tree
Showing 11 changed files with 837 additions and 65 deletions.
2 changes: 1 addition & 1 deletion docs/array_index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<nav>

<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Generator</h2><h3>Global</h3><ul><li><a href="global.html#Modifier">Modifier</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#capitalize">capitalize</a></li><li><a href="global.html#hyphenToPascalCase">hyphenToPascalCase</a></li><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>

</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/browser_index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<nav>

<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Generator</h2><h3>Global</h3><ul><li><a href="global.html#Modifier">Modifier</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#capitalize">capitalize</a></li><li><a href="global.html#hyphenToPascalCase">hyphenToPascalCase</a></li><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>

</nav>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/checker_index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<nav>

<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Generator</h2><h3>Global</h3><ul><li><a href="global.html#Modifier">Modifier</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#capitalize">capitalize</a></li><li><a href="global.html#hyphenToPascalCase">hyphenToPascalCase</a></li><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>

</nav>
</div>
Expand Down
12 changes: 9 additions & 3 deletions docs/collection_index.ts.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

<nav>

<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>Array</h2><h3>Global</h3><ul><li><a href="global.html#cartesian">cartesian</a></li><li><a href="global.html#difference">difference</a></li><li><a href="global.html#differenceBy">differenceBy</a></li><li><a href="global.html#move">move</a></li><li><a href="global.html#toObject">toObject</a></li><li><a href="global.html#uniqueArray">uniqueArray</a></li><li><a href="global.html#uniqueArrayByKey">uniqueArrayByKey</a></li></ul></div><div class="category"><h2>Browser</h2><h3>Global</h3><ul><li><a href="global.html#deleteCookie">deleteCookie</a></li><li><a href="global.html#getCookie">getCookie</a></li><li><a href="global.html#setCookie">setCookie</a></li></ul></div><div class="category"><h2>Checker</h2><h3>Global</h3><ul><li><a href="global.html#isEqual">isEqual</a></li><li><a href="global.html#isFalsey">isFalsey</a></li><li><a href="global.html#isObject">isObject</a></li></ul></div><div class="category"><h2>Collection</h2><h3>Global</h3><ul><li><a href="global.html#deepClone">deepClone</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#has">has</a></li></ul></div><div class="category"><h2>DOM</h2><h3>Global</h3><ul><li><a href="global.html#getAttribute">getAttribute</a></li><li><a href="global.html#getElement">getElement</a></li><li><a href="global.html#off">off</a></li><li><a href="global.html#on">on</a></li></ul></div><div class="category"><h2>Function</h2><h3>Global</h3><ul><li><a href="global.html#debounce">debounce</a></li></ul></div><div class="category"><h2>Generator</h2><h3>Global</h3><ul><li><a href="global.html#Modifier">Modifier</a></li></ul></div><div class="category"><h2>Number</h2><h3>Global</h3><ul><li><a href="global.html#clamp">clamp</a></li><li><a href="global.html#formatMoney">formatMoney</a></li><li><a href="global.html#random">random</a></li></ul></div><div class="category"><h2>String</h2><h3>Global</h3><ul><li><a href="global.html#capitalize">capitalize</a></li><li><a href="global.html#hyphenToPascalCase">hyphenToPascalCase</a></li><li><a href="global.html#slugify">slugify</a></li><li><a href="global.html#truncate">truncate</a></li></ul></div>

</nav>
</div>
Expand All @@ -91,6 +91,7 @@ <h1>collection/index.ts</h1>
* Deep clone object or array
* @method
* @param value {T}
* @param hasFunctionOrUndefinedValue {boolean?}
* @returns {T}
* @example
* const obj = { foo: { bar: 1 } }
Expand All @@ -100,14 +101,19 @@ <h1>collection/index.ts</h1>
* @category Collection
* @version v0.1.0
*/
export const deepClone = &lt;T>(value: T): T => {
export const deepClone = &lt;T>(
value: T,
hasFunctionOrUndefinedValue = false,
): T => {
if (Array.isArray(value)) return [...value] as unknown as T;
if (typeof value === "object")
if (typeof value === "object" &amp;&amp; hasFunctionOrUndefinedValue)
return Object.keys(value).reduce((acc, key) => {
const temp = (value as never)[key];
(acc as never)[key] = deepClone(temp);
return acc;
}, {} as T);
if (typeof value === "object" &amp;&amp; !hasFunctionOrUndefinedValue)
return JSON.parse(JSON.stringify(value));
return value;
};

Expand Down
Loading

0 comments on commit c225136

Please sign in to comment.