This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function exposeInternalType(value) { | |
return Object.prototype.toString.call(value); | |
} | |
function isAsyncFuntionType(value) { | |
return exposeInternalType(value) === '[object AsyncFunction]'; | |
} | |
function isFunction(value) { | |
return ( | |
typeof value === 'function' && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
// https://stackoverflow.com/questions/78105670/cutom-elements-cant-extend-from-button-illegal-constructor/78106993 | |
//--> | |
<script> | |
(function (globalThis) { | |
// scope of `dom-safari` or `custom-element-safari` module | |
'use strict'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// BEGIN :: module scope | |
'use strict'; | |
/* function type specifc detection helpers */ | |
/** | |
* Detects whether a passed function type features a truly `writable` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
// BEGIN :: module scope | |
'use strict'; | |
/* function type specifc detection helpers */ | |
/** | |
* Detects whether a passed function type features a truly `writable` | |
* `prototype` property. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a strictly educational deep clone attempt/approach. | |
function exposeInternalyType(value) { | |
return Object.prototype.toString.call(value); | |
} | |
function isRegExp(value) { | |
return exposeInternalyType(value) === '[object RegExp]'; | |
} | |
function isDate(value) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* - include core-js for enabling/implementing the new `Set` methods | |
* | |
* <script src="https://cdnjs.cloudflare.com/ajax/libs/core-js/3.36.0/minified.js"></script> | |
* | |
* - for related tasks, like splitting any given keypath most generically into key-partials, | |
* have a look at ... [https://regex101.com/r/tew8gr/3] ... and its regular expression ... | |
* | |
* possible usage: | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PausedStateSignal extends EventTarget { | |
// shared protected/private state. | |
#state; | |
constructor(connect) { | |
super(); | |
this.#state = { | |
isPaused: false, | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// utility/helper functions. | |
function getFunctionName(value) { | |
return Object.getOwnPropertyDescriptor(value, 'name').value; | |
// return value.name; | |
} | |
function getFunctionSignature(value) { | |
return Function.prototype.toString.call(value).trim(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* see ... [https://stackoverflow.com/a/76575046/2627243] | |
* | |
* ... answering following SO question ... | |
* | |
* "How to prevent an async function from being invoked | |
* a 2nd time before having finished fetching the first | |
* query from a firestore database?" | |
*/ | |
(function (Object, Function, Symbol, Reflect) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see ... [https://stackoverflow.com/questions/71015428/how-to-get-the-intersection-of-two-sets-while-recognizing-equal-set-values-items/71016510#71016510] | |
// | |
// How to get the intersection of two sets while recognizing | |
// equal set values/items not only by reference but by their | |
// equal structures and entries too? | |
// see also ... [https://stackoverflow.com/questions/76512735/javascript-check-if-arrays-within-an-array-are-the-same] | |
// | |
// Javascript - Check if arrays within an array are the same |
NewerOlder