Original from joeyAghion/mongodb_collection_sizes.js
This file contains hidden or 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
// add into test/server.test.js | |
await t.test('listen should not start server if already aborted 2', async (t) => { | |
t.plan(2) | |
const controller = new AbortController() | |
controller.abort(new Error('aborting before actual start')) | |
const fastify = Fastify() | |
try { | |
// promise returning by fastify.listen is in "floating" state | |
await fastify.listen({ port: 1234, signal: controller.signal }) |
- testing-library / issues / The current testing environment is not configured to support act(...) with vitest and React 18
- jsdom / ReferenceError: AggregateError is not defined
structuredClone
is not defined (todo: issue?)- Allow to use native nodejs
require
(not jest version of it) - Allow to use nodejs versions of timers
setTimeout
,setImmediate
,queueMicrotask
etc (not a jest/sinon version of it even if FakeTimers is on) - Allow to use nodejs versions of
URL
,Blob
,Buffer
etc
This file contains hidden or 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 getOnlyUniqueValuesInArray(array) { | |
const arrayLen = array.length; | |
/** @type {Map<any, number>} */ | |
const map = new Map(); | |
for (let i = 0 ; i < arrayLen ; i++) { | |
const value = array[i]; | |
map.set(value, map.getOrInsert(value, 0) + 1); | |
} |
This file contains hidden or 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
applyPolyfills();var $S_polyfill$0 = Symbol["__polyfill__"];var $S_SET$0, $S_GET$0, $isSymbol$0;if($S_polyfill$0){$S_SET$0 = $S_polyfill$0["__setObjectSetter__"];$S_GET$0 = $S_polyfill$0["__setObjectGetter__"];$isSymbol$0 = $S_polyfill$0["__isSymbol__"];$S_polyfill$0 = true;}else {$S_polyfill$0 = false} | |
var private1 = Symbol();var $S$0 = $S_polyfill$0 && typeof private1 === 'object' && $isSymbol$0(private1); | |
var private2 = Symbol();var $S$1 = $S_polyfill$0 && typeof private2 === 'object' && $isSymbol$0(private2); | |
var publicProp1 = 'public_prop1'; | |
var publicProp2 = (function(){return 'public_prop1'})();var $S$2 = $S_polyfill$0 && typeof publicProp2 === 'object' && $isSymbol$0(publicProp2); | |
function createSymbolOrObject(createSymbol){ return createSymbol ? Symbol() : {} }; | |
{// simple | |
var obj = {}, obj1 = {}; |
This file contains hidden or 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
void function() {//closure | |
var global = this | |
, _initKeyboardEvent_type = (function( e ) { | |
try { | |
e.initKeyboardEvent( | |
"keyup" // in DOMString typeArg | |
, false // in boolean canBubbleArg | |
, false // in boolean cancelableArg | |
, global // in views::AbstractView viewArg |
This file contains hidden or 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
var _hasOwnProperty = Object.prototype.hasOwnProperty; | |
if(!Element.prototype.matchesSelector) { | |
Element.prototype.matchesSelector = | |
Element.prototype.matches || | |
Element.prototype.webkitMatchesSelector || | |
Element.prototype.mozMatchesSelector || | |
Element.prototype.msMatchesSelector || | |
Element.prototype.oMatchesSelector || function(selector) { | |
if(!selector)return false; |
This file contains hidden or 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
/** | |
* Склонение существительных | |
* Правильная форма cуществительного рядом с числом (счетная форма). | |
* | |
* @example declension("файл", "файлов", "файла", 0);//returns "файлов" | |
* @example declension("файл", "файлов", "файла", 1);//returns "файл" | |
* @example declension("файл", "файлов", "файла", 2);//returns "файла" | |
* | |
* @param {string} oneNominative единственное число (именительный падеж) | |
* @param {string} severalGenitive множественное число (родительный падеж) |
This file contains hidden or 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
//////////////////////////////////////////////////////////////////////////////// | |
// Author: Thaddee Tyl 2012. | |
// The following work is under CC0. | |
void function() { | |
// Hook the polyfill. | |
Element.prototype._scrollIntoView = function scrollIntoView(options) { | |
if( !this.ownerDocument )return; | |
This file contains hidden or 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
/** @license MIT License (c) copyright Egor Halimonenko (termi1uc1@gmail.com) */ | |
// ==ClosureCompiler== | |
// @compilation_level ADVANCED_OPTIMIZATIONS | |
// @warning_level VERBOSE | |
// @jscomp_warning missingProperties | |
// @output_file_name a.js.querySelector.min.js | |
// @check_types | |
// ==/ClosureCompiler== |
NewerOlder