Skip to content

Commit

Permalink
Merge pull request #16 from gen-tech/clone-improvements
Browse files Browse the repository at this point in the history
Clone improvements
  • Loading branch information
alisahinozcelik authored May 20, 2018
2 parents 8326b78 + 4653981 commit a004b57
Show file tree
Hide file tree
Showing 26 changed files with 1,030 additions and 46 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/search.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions docs/classes/_open_promise_.openpromise.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</spa
<li class=" tsd-kind-external-module">
<a href="../modules/_is_truthy_.html">"is-<wbr>truthy"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/_map_merge_.html">"map-<wbr>merge"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/_min_max_.html">"min-<wbr>max"</a>
</li>
Expand Down
4 changes: 4 additions & 0 deletions docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ <h3>External modules</h3>
<li class="tsd-kind-external-module"><a href="modules/_intersection_.html" class="tsd-kind-icon">"intersection"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_is_falsy_.html" class="tsd-kind-icon">"is-<wbr>falsy"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_is_truthy_.html" class="tsd-kind-icon">"is-<wbr>truthy"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_map_merge_.html" class="tsd-kind-icon">"map-<wbr>merge"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_min_max_.html" class="tsd-kind-icon">"min-<wbr>max"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_noop_.html" class="tsd-kind-icon">"noop"</a></li>
<li class="tsd-kind-external-module"><a href="modules/_open_promise_.html" class="tsd-kind-icon">"open-<wbr>promise"</a></li>
Expand Down Expand Up @@ -117,6 +118,9 @@ <h3>External modules</h3>
<li class=" tsd-kind-external-module">
<a href="modules/_is_truthy_.html">"is-<wbr>truthy"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="modules/_map_merge_.html">"map-<wbr>merge"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="modules/_min_max_.html">"min-<wbr>max"</a>
</li>
Expand Down
5 changes: 5 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h1 id="-gen-tech-js-utils">@gen-tech/js-utils</h1>
<a href="https://coveralls.io/github/gen-tech/js-utils?branch=master"><img src="https://coveralls.io/repos/github/gen-tech/js-utils/badge.svg?branch=master" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/@gen-tech/js-utils"><img src="https://img.shields.io/npm/v/@gen-tech/js-utils.svg" alt="npm"></a>
<a href="https://www.npmjs.com/package/@gen-tech/js-utils"><img src="https://img.shields.io/npm/dw/@gen-tech/js-utils.svg" alt="npm"></a>
<a href="https://github.com/ellerbrock/typescript-badges/"><img src="https://badges.frapsoft.com/typescript/version/typescript-next.svg?v=101" alt="TypeScript"></a>
<a href="https://github.com/gen-tech/js-utils/blob/master/LICENSE"><img src="https://img.shields.io/npm/l/@gen-tech/js-utils.svg" alt="npm"></a> <a href="https://gitter.im/gen-tech_js-utils/Lobby?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"><img src="https://badges.gitter.im/gen-tech_js-utils/Lobby.svg" alt="Join the chat at https://gitter.im/gen-tech_js-utils/Lobby"></a></p>
<h4 id="installation">Installation</h4>
<p><code>npm install @gen-tech/js-utils --save</code></p>
Expand All @@ -82,6 +83,7 @@ <h4 id="utility-functions">Utility Functions</h4>
<li><a href="https://gen-tech.github.io/js-utils/modules/_is_truthy_.html">is-truthy</a></li>
<li><a href="https://gen-tech.github.io/js-utils/modules/_min_max_.html">min-max</a></li>
<li><a href="https://gen-tech.github.io/js-utils/modules/_noop_.html">noop</a></li>
<li><a href="https://gen-tech.github.io/js-utils/modules/_promise_timeout_.html">promise-timeout</a></li>
<li><a href="https://gen-tech.github.io/js-utils/modules/_unique_id_.html">unique-id</a></li>
</ul>
<h4 id="utility-classes">Utility Classes</h4>
Expand Down Expand Up @@ -121,6 +123,9 @@ <h4 id="utility-classes">Utility Classes</h4>
<li class=" tsd-kind-external-module">
<a href="modules/_is_truthy_.html">"is-<wbr>truthy"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="modules/_map_merge_.html">"map-<wbr>merge"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="modules/_min_max_.html">"min-<wbr>max"</a>
</li>
Expand Down
63 changes: 59 additions & 4 deletions docs/interfaces/_clone_.icloneoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ <h2>Index</h2>
<section class="tsd-index-section ">
<h3>Properties</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="_clone_.icloneoptions.html#customcloners" class="tsd-kind-icon">custom<wbr>Cloners</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="_clone_.icloneoptions.html#instancestorefer" class="tsd-kind-icon">instances<wbr>ToRefer</a></li>
<li class="tsd-kind-property tsd-parent-kind-interface"><a href="_clone_.icloneoptions.html#propstorefer" class="tsd-kind-icon">props<wbr>ToRefer</a></li>
</ul>
Expand All @@ -105,13 +106,49 @@ <h3>Methods</h3>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Properties</h2>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="customcloners" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> custom<wbr>Cloners</h3>
<div class="tsd-signature tsd-kind-icon">custom<wbr>Cloners<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Function</span><span class="tsd-signature-symbol">, </span><a href="../modules/_clone_.html#tinstancecloner" class="tsd-signature-type">TInstanceCloner</a><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L106">clone.ts:106</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<h4 id="custom-cloner-map">Custom Cloner Map</h4>
</div>
<hr>
<p>Example:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { clone } <span class="hljs-keyword">from</span> <span class="hljs-string">"@gen-tech/js-utils"</span>;

<span class="hljs-keyword">const</span> object = {
width: <span class="hljs-number">250</span>,
element: <span class="hljs-built_in">document</span>.querySelector(<span class="hljs-string">"div"</span>)
};

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">divCloner</span>(<span class="hljs-params">objectToClone, options, internalData</span>) </span>{
<span class="hljs-keyword">const</span> newElement = <span class="hljs-built_in">document</span>.createElement(<span class="hljs-string">"div"</span>);
newElement.classList.add(<span class="hljs-string">"cloned"</span>);
<span class="hljs-keyword">return</span> newElement;
}

<span class="hljs-keyword">const</span> customCloners = <span class="hljs-keyword">new</span> Map();
customCloners.set(HTMLDivElement, divCloner);

<span class="hljs-keyword">const</span> clonedObject = clone(object);
</code></pre>
<hr>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="instancestorefer" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> instances<wbr>ToRefer</h3>
<div class="tsd-signature tsd-kind-icon">instances<wbr>ToRefer<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">[]</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L29">clone.ts:29</a></li>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L30">clone.ts:30</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -142,10 +179,10 @@ <h4 id="instance-constructors-which-cloning-unwanted">Instance constructors whic
<section class="tsd-panel tsd-member tsd-kind-property tsd-parent-kind-interface">
<a name="propstorefer" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagOptional">Optional</span> props<wbr>ToRefer</h3>
<div class="tsd-signature tsd-kind-icon">props<wbr>ToRefer<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">symbol</span><span class="tsd-signature-symbol">&gt;</span></div>
<div class="tsd-signature tsd-kind-icon">props<wbr>ToRefer<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Array</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L77">clone.ts:77</a></li>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L78">clone.ts:78</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -186,7 +223,7 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> value<wbr>Filterer<wb
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L55">clone.ts:55</a></li>
<li>Defined in <a href="https://github.com/gen-tech/js-utils/blob/master/src/clone.ts#L56">clone.ts:56</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -261,6 +298,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</
<li class=" tsd-kind-external-module">
<a href="../modules/_is_truthy_.html">"is-<wbr>truthy"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/_map_merge_.html">"map-<wbr>merge"</a>
</li>
<li class=" tsd-kind-external-module">
<a href="../modules/_min_max_.html">"min-<wbr>max"</a>
</li>
Expand All @@ -285,6 +325,9 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</
<li class="current tsd-kind-interface tsd-parent-kind-external-module">
<a href="_clone_.icloneoptions.html" class="tsd-kind-icon">IClone<wbr>Options</a>
<ul>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="_clone_.icloneoptions.html#customcloners" class="tsd-kind-icon">custom<wbr>Cloners</a>
</li>
<li class=" tsd-kind-property tsd-parent-kind-interface">
<a href="_clone_.icloneoptions.html#instancestorefer" class="tsd-kind-icon">instances<wbr>ToRefer</a>
</li>
Expand All @@ -298,6 +341,18 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">boolean</
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-interface tsd-parent-kind-external-module">
<a href="_clone_.iclonerinternaldata.html" class="tsd-kind-icon">ICloner<wbr>Internal<wbr>Data</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module tsd-has-type-parameter">
<a href="../modules/_clone_.html#polyfillrequired" class="tsd-kind-icon">Polyfill<wbr>Required</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/_clone_.html#tinstancecloner" class="tsd-kind-icon">TInstance<wbr>Cloner</a>
</li>
<li class=" tsd-kind-type-alias tsd-parent-kind-external-module">
<a href="../modules/_clone_.html#tnonoptionalcloneoptions" class="tsd-kind-icon">TNon<wbr>Optional<wbr>Clone<wbr>Options</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-external-module tsd-has-type-parameter">
<a href="../modules/_clone_.html#clone" class="tsd-kind-icon">clone</a>
</li>
Expand Down
Loading

0 comments on commit a004b57

Please sign in to comment.