repo_name
stringlengths
2
55
dataset
stringclasses
1 value
owner
stringlengths
3
31
lang
stringclasses
10 values
func_name
stringlengths
1
104
code
stringlengths
20
96.7k
docstring
stringlengths
1
4.92k
url
stringlengths
94
241
sha
stringlengths
40
40
researchgpt
github_2023
MrPeterJin
javascript
findInsertionIndex
function findInsertionIndex(id) { // the start index should be `flushIndex + 1` let start = flushIndex + 1; let end = queue.length; while (start < end) { const middle = (start + end) >>> 1; const middleJobId = getId(queue[middle]); middleJobId < id ? (start = middle + 1) : (end =...
// #2768
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js#L266-L276
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
getTargetAttrs
function getTargetAttrs(tagName) { if (attributes.cache[tagName]) { return attributes.cache[tagName] } /** @type {string[]} */ const result = [] if (attributes.names[tagName]) { result.push(...attributes.names[tagName]) } for (const { name, attrs } of attributes...
/** * Get the attribute to be verified from the element name. * @param {string} tagName * @returns {Set<string>} */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/rules/no-bare-strings-in-template.js#L176-L196
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
isAwaitedPromise
function isAwaitedPromise(callExpression) { if (callExpression.parent.type === 'AwaitExpression') { // cases like `await nextTick()` return true } if (callExpression.parent.type === 'ReturnStatement') { // cases like `return nextTick()` return true } if ( callExpression.parent.type === 'A...
/** * @param {CallExpression} callExpression * @returns {boolean} */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/rules/valid-next-tick.js#L61-L109
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
buildVElementMatcher
function buildVElementMatcher(selectorValue, test) { const val = selector.insensitive ? selectorValue.toLowerCase() : selectorValue return (element) => { const attrValue = getAttributeValue(element, key) if (attrValue == null) { return false } return test( sel...
/** * @param {string} selectorValue * @param {(attrValue:string, selectorValue: string)=>boolean} test * @returns {VElementMatcher} */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint-plugin-vue/lib/utils/selector.js#L298-L312
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
FlatESLint.constructor
constructor(options = {}) { const defaultConfigs = []; const processedOptions = processOptions(options); const linter = new Linter({ cwd: processedOptions.cwd, configType: "flat" }); const cacheFilePath = getCacheFile( processedOptions.cacheL...
/** * Creates a new instance of the main ESLint API. * @param {FlatESLintOptions} options The options for this instance. */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/eslint/flat-eslint.js#L589-L634
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
reportAccessingEval
function reportAccessingEval(globalScope) { const variable = astUtils.getVariableByName(globalScope, "eval"); if (!variable) { return; } const references = variable.references; for (let i = 0; i < references.length; ++i) { co...
/** * Reports all accesses of `eval` (excludes direct calls to eval). * @param {eslint-scope.Scope} globalScope The global scope. * @returns {void} */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/no-eval.js#L174-L193
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
markReturnStatementsOnSegmentAsUsed
function markReturnStatementsOnSegmentAsUsed(segment) { if (!segment.reachable) { usedUnreachableSegments.add(segment); segment.allPrevSegments .filter(isReturned) .filter(prevSegment => !usedUnreachableSegments.has(prevSegment)) ...
/** * Removes the return statements on the given segment from the useless return * statement list. * * This segment may be an unreachable segment. * In that case, the information object of the unreachable segment is not * initialized because `onCodePathSegmentStart`...
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/no-useless-return.js#L157-L173
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
startsWithUpperCase
function startsWithUpperCase(s) { return s[0] !== s[0].toLocaleLowerCase(); }
/** * Checks whether the given string starts with uppercase or not. * @param {string} s The string to check. * @returns {boolean} `true` if the string starts with uppercase. */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/utils/ast-utils.js#L79-L81
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
isClosingParenToken
function isClosingParenToken(token) { return token.value === ")" && token.type === "Punctuator"; }
/** * Checks if the given token is a closing parenthesis token or not. * @param {Token} token The token to check. * @returns {boolean} `true` if the token is a closing parenthesis token. */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/eslint/lib/rules/utils/ast-utils.js#L599-L601
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
isArrayLike
function isArrayLike(value) { return value != null && isLength(value.length) && !isFunction(value); }
/** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value ...
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash.merge/index.js#L1597-L1599
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
objectToString
function objectToString(value) { return nativeObjectToString.call(value); }
/** * Converts `value` to a string using `Object.prototype.toString`. * * @private * @param {*} value The value to convert. * @returns {string} Returns the converted string. */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/_objectToString.js#L18-L20
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
dropRightWhile
function dropRightWhile(array, predicate) { return (array && array.length) ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; }
/** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Arr...
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/lodash.js#L7190-L7194
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
browserConvert
function browserConvert(lodash, options) { return baseConvert(lodash, lodash, options); }
/** * Converts `lodash` to an immutable auto-curried iteratee-first data-last * version with conversion `options` applied. * * @param {Function} lodash The lodash function to convert. * @param {Object} [options] The options object. See `baseConvert` for more details. * @returns {Function} Returns the converted `l...
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/lodash/fp/_convertBrowser.js#L11-L13
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
Chunk.preRender
preRender(options, inputBase, snippets) { const { _, getPropertyAccess, n } = snippets; const magicString = new Bundle$1({ separator: `${n}${n}` }); this.usedModules = []; this.indentString = getIndentString(this.orderedModules, options); const renderOptions = { dynam...
// prerender allows chunk hashes and names to be generated before finalizing
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/rollup/dist/shared/rollup.js#L14880-L14968
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
generatedPositionAfter
function generatedPositionAfter(mappingA, mappingB) { // Optimized for most common case var lineA = mappingA.generatedLine; var lineB = mappingB.generatedLine; var columnA = mappingA.generatedColumn; var columnB = mappingB.generatedColumn; return lineB > lineA || lineB == lineA && columnB >= columnA || ...
/** * Determine whether mappingB is after mappingA with respect to generated * position. */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/source-map/lib/mapping-list.js#L14-L22
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
visit
function visit(cst, visitor) { if ('type' in cst && cst.type === 'document') cst = { start: cst.start, value: cst.value }; _visit(Object.freeze([]), cst, visitor); }
/** * Apply a visitor to a CST document or item. * * Walks through the tree (depth-first) starting from the root, calling a * `visitor` function with two arguments when entering each item: * - `item`: The current item, which included the following members: * - `start: SourceToken[]` – Source tokens before t...
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vite/dist/node/chunks/dep-5605cfa4.js#L23806-L23810
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
VueElement._resolveDef
_resolveDef() { this._resolved = true; // set initial attrs for (let i = 0; i < this.attributes.length; i++) { this._setAttr(this.attributes[i].name); } // watch future attr changes new MutationObserver(mutations => { for (const m of mutations) { ...
/** * resolve inner component definition (handle possible async component) */
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vue/dist/vue.esm-browser.js#L9958-L10003
722c28ee04655cc4359c036f5186ae6b478110ee
researchgpt
github_2023
MrPeterJin
javascript
useHydration
function useHydration() { if (!IN_BROWSER) return ref(false); const { ssr } = useDisplay(); if (ssr) { const isMounted = ref(false); onMounted(() => { isMounted.value = true; }); return isMounted; } else { return ref(true); } }
// Utilities
https://github.com/MrPeterJin/researchgpt/blob/722c28ee04655cc4359c036f5186ae6b478110ee/frontend/node_modules/vuetify/dist/vuetify.esm.js#L9221-L9235
722c28ee04655cc4359c036f5186ae6b478110ee
ai-pr-reviewer
github_2023
coderabbitai
javascript
ReadableStreamDefaultReader.read
read() { if (!IsReadableStreamDefaultReader(this)) { return promiseRejectedWith(defaultReaderBrandCheckException('read')); } if (this._ownerReadableStream === undefined) { return promiseRejectedWith(readerLockException('read from')); } ...
/** * Returns a promise that allows access to the next chunk from the stream's internal queue, if available. * * If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source. */
https://github.com/coderabbitai/ai-pr-reviewer/blob/d5ec3970b3acc4b9d673e6cd601bf4d3cf043b55/dist/index.js#L30824-L30844
d5ec3970b3acc4b9d673e6cd601bf4d3cf043b55
Jellystat
github_2023
CyferShepard
javascript
backup
async function backup(refLog) { const config = await new configClass().getConfig(); if (config.error) { refLog.logData.push({ color: "red", Message: "Backup Failed: Failed to get config" }); refLog.logData.push({ color: "red", Message: "Backup Failed with errors" }); Logging.updateLog(refLog.uuid, refL...
// Backup function
https://github.com/CyferShepard/Jellystat/blob/99a8c49e6e226636274d3be88f42622aa8e52880/backend/classes/backup.js#L31-L159
99a8c49e6e226636274d3be88f42622aa8e52880
internet_archive_downloader
github_2023
elementdavv
javascript
WritableStreamDefaultWriterAbort
function WritableStreamDefaultWriterAbort(writer, reason) { const stream = writer._ownerWritableStream; return WritableStreamAbort(stream, reason); }
// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.
https://github.com/elementdavv/internet_archive_downloader/blob/c81f05f33498dbb771570cd22a2bca6fd779ebfd/moz/js/utils/ponyfill.es6.js#L2143-L2146
c81f05f33498dbb771570cd22a2bca6fd779ebfd
RazorSlices
github_2023
DamianEdwards
javascript
computeStyleTests
function computeStyleTests() { // This is a singleton, we need to execute it only once if ( !div ) { return; } container.style.cssText = "position:absolute;left:-11111px;width:60px;" + "margin-top:1px;padding:0;border:0"; div.style.cssText = "position:relative;display:block;box-sizing:border-box;ov...
// Executing both pixelPosition & boxSizingReliable tests require only one layout
https://github.com/DamianEdwards/RazorSlices/blob/cf2e413551e49c3a3b40623ce020d678697f123a/samples/RazorSlices.Samples.WebApp/wwwroot/lib/jquery/dist/jquery.slim.js#L6522-L6564
cf2e413551e49c3a3b40623ce020d678697f123a
OpenCharacters
github_2023
josephrocca
javascript
escapeMarkdownV2
function escapeMarkdownV2(text) { const ESCAPE_CHARACTERS = /[_*[\]()~>#\+\-=|{}.!]/g; return text.replace(ESCAPE_CHARACTERS, '\\$&'); }
// Telegraf for Telegram bot integration
https://github.com/josephrocca/OpenCharacters/blob/bfc1acbc68c27434e24b6837678867cc439dbfba/plugins/telegram/server.js#L44-L47
bfc1acbc68c27434e24b6837678867cc439dbfba
socketioxide
github_2023
Totodore
javascript
ɵɵresolveDocument
function ɵɵresolveDocument(element) { return { name: 'document', target: element.ownerDocument }; }
/** * * @codeGenApi */
https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L24692-L24694
a480430ca3f611f9a550268e23d4ee455202e642
socketioxide
github_2023
Totodore
javascript
DomEventsPlugin.supports
supports(eventName) { return true; }
// This plugin should come last in the list of plugins, because it accepts all
https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L52229-L52231
a480430ca3f611f9a550268e23d4ee455202e642
socketioxide
github_2023
Totodore
javascript
formatCurrency
function formatCurrency(value, locale, currency, currencyCode, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); pattern.minFrac = getNumberOfCurrencyDigits(currencyCode); ...
/** * @ngModule CommonModule * @description * * Formats a number as currency using locale rules. * * @param value The number to format. * @param locale A locale code for the locale format rules to use. * @param currency A string containing the currency symbol or its name, * such as "$" or "Canadian Dollar". Us...
https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/angular-todomvc/dist/vendor.js#L57577-L57592
a480430ca3f611f9a550268e23d4ee455202e642
socketioxide
github_2023
Totodore
javascript
arrayIndexOfSorted
function arrayIndexOfSorted(array, value) { return _arrayIndexOfSorted(array, value, 0); }
/** * Get an index of an `value` in a sorted `array`. * * NOTE: * - This uses binary search algorithm for fast removals. * * @param array A sorted array to binary search. * @param value The value to look for. * @returns index of the value. * - positive index if value found. * - negative index if value not...
https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/basic-crud-application/dist/vendor.js#L22443-L22445
a480430ca3f611f9a550268e23d4ee455202e642
socketioxide
github_2023
Totodore
javascript
createRootComponent
function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) { const tView = rootLView[TVIEW]; // Create directive instance with factory() and store at next index in viewData const component = instantiateRootComponent(tView, rootLView, componentDef); rootContext.compon...
/** * Creates a root component and sets it up with features and host bindings. Shared by * renderComponent() and ViewContainerRef.createComponent(). */
https://github.com/Totodore/socketioxide/blob/a480430ca3f611f9a550268e23d4ee455202e642/examples/basic-crud-application/dist/vendor.js#L30373-L30397
a480430ca3f611f9a550268e23d4ee455202e642
serverMmon
github_2023
souying
javascript
Plugin
function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options...
// MODAL PLUGIN DEFINITION
https://github.com/souying/serverMmon/blob/d4ab92bb36dc1e273810ba5f1e33aa209bd81335/admin/js/bootstrap.js#L1208-L1218
d4ab92bb36dc1e273810ba5f1e33aa209bd81335
FreshCryptoLib
github_2023
rdubois-crypto
javascript
Express
function Express(options) { if (options === void 0) { options = {}; } /** * @inheritDoc */ this.name = Express.id; this._router = options.router || options.app; this._methods = (Array.isArray(options.methods) ? options.methods : []).concat('use'); }
/** * @inheritDoc */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@sentry/tracing/esm/integrations/express.js#L12-L20
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
log
function log (message, site) { var haslisteners = eehaslisteners(process, 'deprecation') // abort early if no destination if (!haslisteners && this._ignored) { return } var caller var callFile var callSite var depSite var i = 0 var seen = false var stack = getStack() var file = this._file ...
/** * Display deprecation message. */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/depd/index.js#L185-L261
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
Wordlist.split
split(mnemonic) { return mnemonic.toLowerCase().split(/ +/g); }
// Subclasses may override this
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ethers/dist/ethers.esm.js#L15522-L15524
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
dotindex
function dotindex(value) { var match = lastDotRe.exec(value) return match ? match.index + 1 : value.length }
// Get the position of the last dot in `value`.
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/markdown-table/index.js#L246-L250
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
copyFromBufferString
function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0...
// Copies a specified amount of characters from the list of buffered data
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/mocha/mocha.js#L4585-L4609
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
Sender.doPong
doPong(data, mask, readOnly, cb) { this.sendFrame( Sender.frame(data, { fin: true, rsv1: false, opcode: 0x0a, mask, readOnly }), cb ); }
/** * Frames and sends a pong message. * * @param {Buffer} data The message to send * @param {Boolean} [mask=false] Specifies whether or not to mask `data` * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified * @param {Function} [cb] Callback * @private */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ws/lib/sender.js#L231-L242
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
socketOnError
function socketOnError() { this.destroy(); }
/** * Handle premature socket errors. * * @private */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/ws/lib/websocket-server.js#L371-L373
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
Progress
function Progress(runner, options) { Base.call(this, runner, options); var self = this; var width = (Base.window.width * 0.5) | 0; var total = runner.total; var complete = 0; var lastN = -1; // default chars options = options || {}; var reporterOptions = options.reporterOptions || {}; options.ope...
/** * Constructs a new `Progress` reporter instance. * * @public * @class * @memberof Mocha.reporters * @extends Mocha.reporters.Base * @param {Runner} runner - Instance triggers reporter actions. * @param {Object} [options] - runner options */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/eth-gas-reporter/node_modules/mocha/lib/reporters/progress.js#L40-L97
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
getAllKeys
function getAllKeys(object) { return baseGetAllKeys(object, keys, getSymbols); }
/** * Creates an array of own enumerable property names and symbols of `object`. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names and symbols. */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/lodash.js#L5915-L5917
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
memoizeCapped
function memoizeCapped(func) { var result = memoize(func, function(key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } return key; }); var cache = result.cache; return result; }
/** * A specialized version of `_.memoize` which clears the memoized function's * cache when it exceeds `MAX_MEMOIZE_SIZE`. * * @private * @param {Function} func The function to have its output memoized. * @returns {Function} Returns the new memoized function. */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/lodash.js#L6488-L6498
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
baseLt
function baseLt(value, other) { return value < other; }
/** * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if `value` is less than `other`, * else `false`. */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/lodash/_baseLt.js#L10-L12
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
httpFetch
async function httpFetch (fetchParams) { // 1. Let request be fetchParams’s request. const request = fetchParams.request // 2. Let response be null. let response = null // 3. Let actualResponse be null. let actualResponse = null // 4. Let timingInfo be fetchParams’s timing info. const timingInfo = fe...
// https://fetch.spec.whatwg.org/#http-fetch
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/undici/lib/fetch/index.js#L999-L1099
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
Miner.mine
async mine(iterations = 0) { const solution = await this.iterate(iterations); if (solution) { if (this.block) { const data = this.block.toJSON(); data.header.mixHash = solution.mixHash; data.header.nonce = solution.nonce; return...
/** * Iterate `iterations` time over nonces, returns a `BlockHeader` or `Block` if a solution is found, `undefined` otherwise * @param iterations - Number of iterations to iterate over. If `-1` is passed, the loop runs until a solution is found * @returns - `undefined` if no solution was found within the...
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-ethash/dist/index.js#L50-L66
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
trap
function trap(err) { // TODO: facilitate extra data along with errors throw new exceptions_1.EvmError(err); }
/** * Wraps error message as EvmError */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-evm/dist/opcodes/util.js#L27-L30
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
DefaultStateManager.getProof
async getProof(address, storageSlots = []) { const account = await this.getAccount(address); const accountProof = (await this._trie.createProof(address.buf)).map((p) => (0, ethereumjs_util_1.bufferToHex)(p)); const storageProof = []; const storageTrie = await this._getStorageTrie(address...
/** * Get an EIP-1186 proof * @param address address to get proof of * @param storageSlots storage slots to get proof of */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/@nomicfoundation/ethereumjs-statemanager/dist/stateManager.js#L250-L278
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
generatorEqual
function generatorEqual(leftHandOperand, rightHandOperand, options) { return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options); }
/*! * Simple equality for generator objects such as those returned by generator functions. * * @param {Iterable} leftHandOperand * @param {Iterable} rightHandOperand * @param {Object} [options] (Optional) * @return {Boolean} result */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/deep-eql/index.js#L330-L332
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
errorDiff
function errorDiff(actual, expected) { return diff .diffWordsWithSpace(actual, expected) .map(function(str) { if (str.added) { return colorLines('diff added', str.value); } if (str.removed) { return colorLines('diff removed', str.value); } return str.value; })...
/** * Returns character diff for `err`. * * @private * @param {String} actual * @param {String} expected * @return {string} the diff */
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/solidity-coverage/node_modules/mocha/mocha.js#L2836-L2849
8179e08cac72072bd260796633fec41fdfd5b441
FreshCryptoLib
github_2023
rdubois-crypto
javascript
_interopRequireDefault
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
/*istanbul ignore start*/
https://github.com/rdubois-crypto/FreshCryptoLib/blob/8179e08cac72072bd260796633fec41fdfd5b441/solidity/tests/hardhat/node_modules/solidity-coverage/node_modules/mocha/mocha.js#L11230-L11230
8179e08cac72072bd260796633fec41fdfd5b441
torch-merf
github_2023
ashawkey
javascript
TorusGeometry
function TorusGeometry( radius, tube, radialSegments, tubularSegments, arc ) { Geometry.call( this ); this.type = 'TorusGeometry'; this.parameters = { radius: radius, tube: tube, radialSegments: radialSegments, tubularSegments: tubularSegments, arc: arc }; this.fromBufferGeometry( new Torus...
/** * @author oosmoxiecode * @author mrdoob / http://mrdoob.com/ * @author Mugen87 / https://github.com/Mugen87 */
https://github.com/ashawkey/torch-merf/blob/a669be605349c3af5167832f8ead6f69bbf8e697/renderer/third_party/three.js#L29523-L29540
a669be605349c3af5167832f8ead6f69bbf8e697
halo-theme-dream2.0
github_2023
nineya
javascript
TokenTreeEmitter.addSublanguage
addSublanguage(emitter, name) { /** @type DataNode */ const node = emitter.root; node.kind = name; node.sublanguage = true; this.add(node); }
/** * @param {Emitter & {root: DataNode}} emitter * @param {string} name */
https://github.com/nineya/halo-theme-dream2.0/blob/3fdaf6a59b976a36962e905cc230bdbf2a04708f/templates/assets/lib/highlightjs@11.5.1/es/highlight.js#L346-L352
3fdaf6a59b976a36962e905cc230bdbf2a04708f
ai-codereviewer
github_2023
aidar-freeed
javascript
dateTimeDeserializer
function dateTimeDeserializer(key, value) { if (typeof value === 'string') { const a = new Date(value); if (!isNaN(a.valueOf())) { return a; } } return value; ...
// get the result from the body
https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L1877-L1885
a9a064dfa1db8c83f40ef63f6e247fa09c935ed6
ai-codereviewer
github_2023
aidar-freeed
javascript
AbortController.signal
get signal() { return getSignal(this); }
/** * Returns the `AbortSignal` object associated with this object. */
https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L4339-L4341
a9a064dfa1db8c83f40ef63f6e247fa09c935ed6
ai-codereviewer
github_2023
aidar-freeed
javascript
ReadableStreamDefaultController.desiredSize
get desiredSize() { if (!IsReadableStreamDefaultController(this)) { throw defaultControllerBrandCheckException$1('desiredSize'); } return ReadableStreamDefaultControllerGetDesiredSize(this); }
/** * Returns the desired size to fill the controlled stream's internal queue. It can be negative, if the queue is * over-full. An underlying source ought to use this information to determine when and how to apply backpressure. */
https://github.com/aidar-freeed/ai-codereviewer/blob/a9a064dfa1db8c83f40ef63f6e247fa09c935ed6/dist/index.js#L12319-L12324
a9a064dfa1db8c83f40ef63f6e247fa09c935ed6
stable-diffusion-webui-vectorstudio
github_2023
GeorgLegato
javascript
Ellipse$1
function Ellipse$1(rx,ry,ax){if(!(this instanceof Ellipse$1)){return new Ellipse$1(rx,ry,ax);}this.rx=rx;this.ry=ry;this.ax=ax;}// Apply a linear transform m to the ellipse
// Class constructor :
https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/Editor.js#L19848-L19848
03535f64caef1de151122574cf4a39943db6e1eb
stable-diffusion-webui-vectorstudio
github_2023
GeorgLegato
javascript
MainMenu.savePreferences
async savePreferences(e) { const { lang, bgcolor, bgurl, gridsnappingon, gridsnappingstep, gridcolor, showrulers, baseunit } = e.detail; // Set background this.editor.setBackground(bgcolor, bgurl); // set language if (l...
/** * Save user preferences based on current values in the UI. * @param {Event} e * @function module:SVGthis.savePreferences * @returns {Promise<void>} */
https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/iife-Editor.js#L33348-L33380
03535f64caef1de151122574cf4a39943db6e1eb
stable-diffusion-webui-vectorstudio
github_2023
GeorgLegato
javascript
keyDown
function keyDown(e) { if (e.target.value === '' && e.target !== hex && (bindedHex && e.target !== bindedHex || !bindedHex)) return undefined; if (!validateKey(e)) return e; switch (e.target) { case red: switch (e.keyCode) { case 38: red.value = setValueInRan...
// input box key down - use arrows to alter color
https://github.com/GeorgLegato/stable-diffusion-webui-vectorstudio/blob/03535f64caef1de151122574cf4a39943db6e1eb/scripts/editor/xdomain-Editor.js#L22339-L22429
03535f64caef1de151122574cf4a39943db6e1eb
dujiaoka
github_2023
hiouttime
javascript
uncurryThis
function uncurryThis( fn ) { return function() { return call.apply( fn, arguments ); }; }
// http://jsperf.com/uncurrythis
https://github.com/hiouttime/dujiaoka/blob/51538b6a7e74a67a4f92a242b1e3c6799b64f5ca/public/vendor/dcat-admin/dcat/plugins/webuploader/webuploader.nolog.js#L205-L209
51538b6a7e74a67a4f92a242b1e3c6799b64f5ca
actions-permissions
github_2023
GitHubSecurityLab
javascript
getStreamingResponseStatusCodes
function getStreamingResponseStatusCodes(operationSpec) { const result = new Set(); for (const statusCode in operationSpec.responses) { const operationResponse = operationSpec.responses[statusCode]; if (operationResponse.bodyMapper && operationResponse.bodyMapper.type.name === serial...
/** * Gets the list of status codes for streaming responses. * @internal */
https://github.com/GitHubSecurityLab/actions-permissions/blob/babd69bc8d78e6cdece903dfdcfb72d4e1a4f00d/monitor/dist/index.js#L105800-L105810
babd69bc8d78e6cdece903dfdcfb72d4e1a4f00d
pyobsplot
github_2023
juba
javascript
array_default
function array_default(a4, b) { return (isNumberArray(b) ? numberArray_default : genericArray)(a4, b); }
// node_modules/d3-interpolate/src/array.js
https://github.com/juba/pyobsplot/blob/4ae57b857091989d7f2911e052b9f3ad636e6fea/src/pyobsplot/static/static-widget.js#L4558-L4560
4ae57b857091989d7f2911e052b9f3ad636e6fea
pyobsplot
github_2023
juba
javascript
conicProjection
function conicProjection(projectAt) { var phi02 = 0, phi12 = pi4 / 3, m3 = projectionMutator(projectAt), p = m3(phi02, phi12); p.parallels = function(_) { return arguments.length ? m3(phi02 = _[0] * radians2, phi12 = _[1] * radians2) : [phi02 * degrees3, phi12 * degrees3]; }; return p; }
// node_modules/d3-geo/src/projection/conic.js
https://github.com/juba/pyobsplot/blob/4ae57b857091989d7f2911e052b9f3ad636e6fea/src/pyobsplot/static/static-widget.js#L12209-L12215
4ae57b857091989d7f2911e052b9f3ad636e6fea
pianometer
github_2023
wiwikuan
javascript
WebMidi
function WebMidi() { // Singleton. Prevent instantiation through WebMidi.__proto__.constructor() if (WebMidi.prototype._singleton) { throw new Error("WebMidi is a singleton, it cannot be instantiated directly."); } WebMidi.prototype._singleton = this; // MIDI inputs and outputs this._inp...
/** * The `WebMidi` object makes it easier to work with the Web MIDI API. Basically, it simplifies * two things: sending outgoing MIDI messages and reacting to incoming MIDI messages. * * Sending MIDI messages is done via an `Output` object. All available outputs can be accessed in * the `WebMidi.outputs...
https://github.com/wiwikuan/pianometer/blob/4122760cd710a873b12ab4d7740cf36c50df4a6a/webmidi.js#L60-L491
4122760cd710a873b12ab4d7740cf36c50df4a6a
sveltekit-lucia-starter
github_2023
qwacko
javascript
Router.addCacheListener
addCacheListener() { // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705 self.addEventListener('message', event => { // event.data is type 'any' // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (event.data && event.dat...
/** * Adds a message event listener for URLs to cache from the window. * This is useful to cache resources loaded on the page prior to when the * service worker started controlling it. * * The format of the message data sent from the window should be as follows. * Where the `ur...
https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-39884a30.js#L748-L781
2c01cb76c8607c2a9f4e80f78dfd1e9def43768e
sveltekit-lucia-starter
github_2023
qwacko
javascript
waitUntil
function waitUntil(event, asyncFn) { const returnPromise = asyncFn(); event.waitUntil(returnPromise); return returnPromise; }
/* Copyright 2020 Google LLC Use of this source code is governed by an MIT-style license that can be found in the LICENSE file or at https://opensource.org/licenses/MIT. */
https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-39884a30.js#L1247-L1251
2c01cb76c8607c2a9f4e80f78dfd1e9def43768e
sveltekit-lucia-starter
github_2023
qwacko
javascript
PrecacheController.getCachedURLs
getCachedURLs() { return [...this._urlsToCacheKeys.keys()]; }
/** * Returns a list of all the URLs that have been precached by the current * service worker. * * @return {Array<string>} The precached URLs. */
https://github.com/qwacko/sveltekit-lucia-starter/blob/2c01cb76c8607c2a9f4e80f78dfd1e9def43768e/dev-dist/workbox-dcc48fc1.js#L2854-L2856
2c01cb76c8607c2a9f4e80f78dfd1e9def43768e
lets-form
github_2023
guidone
javascript
isEmpty$1
function isEmpty$1(value) { if (value == null) { return true; } if (isArrayLike(value) && (isArray$3(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments$1(value))) { return !value.length; } var tag = getTag(valu...
/** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed * properties. * * Array-like values such as `arguments` objects, arrays, buffers, strings, or * jQuery-like collections are considered empty if they have...
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-antd-umd/main.js#L4089-L4109
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
initCloneArray$1
function initCloneArray$1(array) { var length = array.length, result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty$2.call(array, 'index')) { result.index = array.index; result.input = array.input; ...
/** * Initializes an array clone. * * @private * @param {Array} array The array to clone. * @returns {Array} Returns the initialized clone. */
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-bootstrap-umd/main.js#L2771-L2781
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
stringToArray$2
function stringToArray$2(string) { return hasUnicode$1(string) ? unicodeToArray(string) : asciiToArray(string); }
/** * Converts `string` to an array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the converted array. */
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-bootstrap-umd/main.js#L19958-L19960
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
memoize$1
function memoize$1(func, resolver) { if (typeof func != 'function' || resolver != null && typeof resolver != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function () { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = mem...
/** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func`...
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/react-rsuite5-umd/main.js#L3333-L3350
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
baseFindIndex$1
function baseFindIndex$1(array, predicate, fromIndex, fromRight) { var length = array.length, index = fromIndex + (fromRight ? 1 : -1); while (fromRight ? index-- : ++index < length) { if (predicate(array[index], index, array)) { return index; } } return -1; }
/** * The base implementation of `_.findIndex` and `_.findLastIndex` without * support for iteratee shorthands. * * @private * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fr...
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-esm/index.js#L4769-L4778
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
listCacheHas$1
function listCacheHas$1(key) { return assocIndexOf$1(this.__data__, key) > -1; }
/** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-umd/main.js#L1561-L1563
793271834cca296f28b6321d258821b8486061f1
lets-form
github_2023
guidone
javascript
isIndex$3
function isIndex$3(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER$1 : length; return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; }
/** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */
https://github.com/guidone/lets-form/blob/793271834cca296f28b6321d258821b8486061f1/dist/utils-umd/main.js#L2047-L2051
793271834cca296f28b6321d258821b8486061f1
chatgpt-java-wx
github_2023
c-ttpfx
javascript
bnpFromString
function bnpFromString(s,b) { var k; if(b == 16) k = 4; else if(b == 8) k = 3; else if(b == 256) k = 8; // byte array else if(b == 2) k = 1; else if(b == 32) k = 5; else if(b == 4) k = 2; else { this.fromRadix(s,b); return; } this.t = 0; this.s = 0; var ...
// (protected) set from string and radix
https://github.com/c-ttpfx/chatgpt-java-wx/blob/2961a981e151a379ea2b877af6fe4122bc9113a2/ttpfx的聊天机器人/miniprogram_npm/jsbn/index.js#L139-L175
2961a981e151a379ea2b877af6fe4122bc9113a2
chatgpt-java-wx
github_2023
c-ttpfx
javascript
op_xor
function op_xor(x,y) { return x^y; }
// (public) this ^ a
https://github.com/c-ttpfx/chatgpt-java-wx/blob/2961a981e151a379ea2b877af6fe4122bc9113a2/ttpfx的聊天机器人/miniprogram_npm/jsbn/index.js#L735-L735
2961a981e151a379ea2b877af6fe4122bc9113a2
AstroSharp
github_2023
deepskydetail
javascript
vendorPropName
function vendorPropName( name ) { // Shortcut for names that are not vendor prefixed if ( name in emptyStyle ) { return name; } // Check for vendor prefixed names var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i ] + capName; if ( nam...
// Return a css property mapped to a potentially vendor prefixed property
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Win/library/jquerylib/lib/2.2.4/jquery-2.2.4.js#L5882-L5899
b632424fa2e9749d008851cf40f49b5fcec490d3
AstroSharp
github_2023
deepskydetail
javascript
hsvToRgb
function hsvToRgb(h, s, v) { h = bound01(h, 360) * 6; s = bound01(s, 100); v = bound01(v, 100); var i = math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v...
// `hsvToRgb`
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Win/library/shinyWidgets/assets/spectrum/spectrum.js#L1683-L1700
b632424fa2e9749d008851cf40f49b5fcec490d3
gotour
github_2023
ardanlabs
javascript
makeChangeSingleDocInEditor
function makeChangeSingleDocInEditor(cm, change, spans) { var doc = cm.doc, display = cm.display, from = change.from, to = change.to var recomputeMaxLength = false, checkWidthStart = from.line if (!cm.options.lineWrapping) { checkWidthStart = lineNo(visualLine(getLine(doc, from.line))) doc.iter(checkWidt...
// Handle the interaction of a change to a document with the editor
https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/fre/static/lib/codemirror/lib/codemirror.js#L5195-L5252
6599a0b6d88dd03619c8bc4c5f53e59c70c36208
gotour
github_2023
ardanlabs
javascript
attachLocalSpans
function attachLocalSpans(doc, change, from, to) { var existing = change["spans_" + doc.id], n = 0 doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { if (line.markedSpans) { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans } ++n }...
// Used to store marked span information in the history.
https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/ita/static/lib/codemirror/lib/codemirror.js#L4724-L4731
6599a0b6d88dd03619c8bc4c5f53e59c70c36208
gotour
github_2023
ardanlabs
javascript
countColumn
function countColumn(string, end, tabSize, startIndex, startValue) { if (end == null) { end = string.search(/[^\s\u00a0]/) if (end == -1) { end = string.length } } for (var i = startIndex || 0, n = startValue || 0;;) { var nextTab = string.indexOf("\t", i) if (nextTab < 0 || nextTab >= end) ...
// Counts the column offset in a string, taking tabs into account.
https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/pol/static/lib/codemirror/lib/codemirror.js#L161-L174
6599a0b6d88dd03619c8bc4c5f53e59c70c36208
gotour
github_2023
ardanlabs
javascript
handleCharBinding
function handleCharBinding(cm, e, ch) { return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) }
// Handle a key from the keypress event
https://github.com/ardanlabs/gotour/blob/6599a0b6d88dd03619c8bc4c5f53e59c70c36208/_content/tour/por/static/lib/codemirror/lib/codemirror.js#L6858-L6860
6599a0b6d88dd03619c8bc4c5f53e59c70c36208
napari-chatgpt
github_2023
royerlab
javascript
LinkedList
function LinkedList() { /** @type {LinkedListNode<T>} */ var head = { value: null, prev: null, next: null }; /** @type {LinkedListNode<T>} */ var tail = { value: null, prev: head, next: null }; head.next = tail; /** @type {LinkedListNode<T>} */ this.head = head; /** @type {LinkedListNode<T>} */ this....
/** * @typedef LinkedListNode * @property {T} value * @property {LinkedListNode<T> | null} prev The previous node. * @property {LinkedListNode<T> | null} next The next node. * @template T * @private */
https://github.com/royerlab/napari-chatgpt/blob/59b996a8547bd315004773bee942a2fae925ae43/src/napari_chatgpt/chat_server/static/prism.js#L1078-L1090
59b996a8547bd315004773bee942a2fae925ae43
lazyrepo
github_2023
ds300
javascript
LazyError.constructor
constructor(headline, more) { super(stripAnsi(headline)) this.headline = headline this.more = more }
/** * @param {string} headline * @param {{ error?: Error, detail?: string }} [more] */
https://github.com/ds300/lazyrepo/blob/c67eda9d332b85c135f8a69a23570a67b3b1f698/src/logger/LazyError.js#L9-L13
c67eda9d332b85c135f8a69a23570a67b3b1f698
x-ui
github_2023
sing-web
javascript
ensureCtor
function ensureCtor (comp, base) { if ( comp.__esModule || (hasSymbol && comp[Symbol.toStringTag] === 'Module') ) { comp = comp.default; } return isObject(comp) ? base.extend(comp) : comp }
/* */
https://github.com/sing-web/x-ui/blob/0cd2536025dd3115fa3809c04fd6b370b3f48704/web/assets/vue@2.6.12/vue.runtime.js#L3584-L3594
0cd2536025dd3115fa3809c04fd6b370b3f48704
cy_jsvmp
github_2023
2833844911
javascript
length
function length(val) { return val.toString().length; }
/** * Get the string length of `val` */
https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/expand-range/node_modules/fill-range/index.js#L406-L408
f714b87f46b8c638924c697ca8ef6b3745e3a729
cy_jsvmp
github_2023
2833844911
javascript
baseIndexOfWith
function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, length = array.length; while (++index < length) { if (comparator(array[index], value)) { return index; } } return -1; }
/** * This function is like `baseIndexOf` except that it accepts a comparator. * * @private * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. * @returns...
https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/lodash/_baseIndexOfWith.js#L11-L21
f714b87f46b8c638924c697ca8ef6b3745e3a729
cy_jsvmp
github_2023
2833844911
javascript
isIndex
function isIndex(value, length) { var type = typeof value; length = length == null ? MAX_SAFE_INTEGER : length; return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && (value > -1 && value % 1 == 0 && value < length); }
/** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. */
https://github.com/2833844911/cy_jsvmp/blob/f714b87f46b8c638924c697ca8ef6b3745e3a729/node_modules/lodash/lodash.js#L6324-L6332
f714b87f46b8c638924c697ca8ef6b3745e3a729
voyager
github_2023
spotify
javascript
baseCreate
function baseCreate(prototype) { if (!isObject(prototype)) return {}; if (nativeCreate) return nativeCreate(prototype); var Ctor = ctor(); Ctor.prototype = prototype; var result = new Ctor; Ctor.prototype = null; return result; }
// An internal function for creating a new object that inherits from another.
https://github.com/spotify/voyager/blob/8e724398a57d4eca63d6e0dc2cd051d172fea95a/docs/python/_static/underscore-1.13.1.js#L610-L618
8e724398a57d4eca63d6e0dc2cd051d172fea95a
Hello-CTF
github_2023
ProbiusOfficial
javascript
preventSelection
function preventSelection(el) { el.style.userSelect = 'none'; el.style.webkitUserSelect = 'none'; el.addEventListener('selectstart', preventDefault); }
/* Selection ----------------------------------------------------------------------------------------------------------------------*/
https://github.com/ProbiusOfficial/Hello-CTF/blob/d51bc86bafa737be4798db83b2a5b253f9f0842c/docs/javascripts/FullCalendar.js#L354-L358
d51bc86bafa737be4798db83b2a5b253f9f0842c
kv.js
github_2023
HeyPuter
javascript
kvjs.zintercard
zintercard(...keys) { const intersection = this.ZINTER(...keys); return intersection.size; }
/** * Get the number of members in the intersection between the given sorted sets stored at the specified keys. * * @param {...string} keys - The keys where the sorted sets are stored. * @returns {number} - The number of members in the intersection. */
https://github.com/HeyPuter/kv.js/blob/749e24c6868b3f048e8858e45a35d79b53ad7eb6/kv.js#L1852-L1855
749e24c6868b3f048e8858e45a35d79b53ad7eb6
openkoda
github_2023
openkoda
javascript
toType
function toType(obj) { if (obj === null || typeof obj === 'undefined') { return "" + obj; } return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); }
// Shoutout AngusCroll (https://goo.gl/pxwQGp)
https://github.com/openkoda/openkoda/blob/d86335959f5fb1da2fa58a9a5c7f02065d322975/openkoda/src/main/resources/public/vendor/bootstrap/js/bootstrap.bundle.js#L70-L76
d86335959f5fb1da2fa58a9a5c7f02065d322975
inventory
github_2023
carmonabernaldiego
javascript
createFxNow
function createFxNow() { window.setTimeout( function() { fxNow = undefined; } ); return ( fxNow = jQuery.now() ); }
// Animations created synchronously will run synchronously
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/jquery/jquery.js#L7498-L7503
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
cleanupStylesWhenDeleting
function cleanupStylesWhenDeleting() { var doc = editor.getDoc(), dom = editor.dom, selection = editor.selection; var MutationObserver = window.MutationObserver, olderWebKit, dragStartRng; // Add mini polyfill f...
/** * Fixes a WebKit bug when deleting contents using backspace or delete key. * WebKit will produce a span element if you delete across two block elements. * * Example: * <h1>a</h1><p>|b</p> * * Will produce this on backspace: ...
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/tinymce/tinymce.jquery.min.js#L32436-L33021
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
isDefaultPrevented
function isDefaultPrevented(e) { return e.isDefaultPrevented(); }
/** * Returns true/false if the event is prevented or not. * * @private * @param {Event} e Event object. * @return {Boolean} true/false if the event is prevented or not. */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/plugins/tinymce/tinymce.js#L31914-L31916
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
setWrapToString
function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); }
/** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. * * @private * @param {Function} wrapper The function to modify. * @param {Function} reference The reference function. * @param {number} ...
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/app.js#L21044-L21047
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
forEachRight
function forEachRight(collection, iteratee) { var func = isArray(collection) ? arrayEachRight : baseEachRight; return func(collection, getIteratee(iteratee, 3)); }
/** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * * @static * @memberOf _ * @since 2.0.0 * @alias eachRight * @category Collection * @param {Array|Object} collection The collection to iterate over. * @par...
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/app.js#L23744-L23747
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
EffectScope.off
off() { activeEffectScope = this.parent; }
/** * This should only be called on non-detached scopes * @internal */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/category.js#L26469-L26471
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
noop
function noop(a, b, c) { }
/* eslint-disable no-unused-vars */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/invoice.js#L23215-L23215
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
checkKeyCodes
function checkKeyCodes(eventKeyCode, key, builtInKeyCode, eventKeyName, builtInKeyName) { const mappedKeyCode = config.keyCodes[key] || builtInKeyCode; if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { return isKeyNotMatch(builtInKeyName, eventKeyName); } else if (mappedKeyCode) { ...
/** * Runtime helper for checking keyCodes from config. * exposed as Vue.prototype._k * passing in eventKeyName as last argument separately for backwards compat */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/product.js#L24888-L24900
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
queueActivatedComponent
function queueActivatedComponent(vm) { // setting _inactive to false here so that a render function can // rely on checking whether it's in an inactive tree (e.g. router-view) vm._inactive = false; activatedChildren.push(vm); }
/** * Queue a kept-alive component that was activated during patch. * The queue will be processed after the entire tree has been patched. */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/role.js#L26168-L26173
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
nextTick
function nextTick(cb, ctx) { let _resolve; callbacks.push(() => { if (cb) { try { cb.call(ctx); } catch (e) { handleError(e, ctx, 'nextTick'); } } else if (_resolve) { _resolve(ctx); } ...
/** * @internal */
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/user.js#L26742-L26767
f0fa12c3e312cab38147ff9c204945667f46da75
inventory
github_2023
carmonabernaldiego
javascript
hydrate
function hydrate(elm, vnode, insertedVnodeQueue, inVPre) { let i; const { tag, data, children } = vnode; inVPre = inVPre || (data && data.pre); vnode.elm = elm; if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { vnode.isAsyncPlaceholder = true; re...
// Note: this is a browser-only function so we can assume elms are DOM nodes.
https://github.com/carmonabernaldiego/inventory/blob/f0fa12c3e312cab38147ff9c204945667f46da75/public/js/user.js#L29871-L29964
f0fa12c3e312cab38147ff9c204945667f46da75
mrjs
github_2023
Volumetrics-io
javascript
MRHand.constructor
constructor(handedness, scene) { this.handedness = handedness; this.pinch = false; this.lastPosition = new THREE.Vector3(); this.active = false; this.jointPhysicsBodies = {}; this.pointer = new THREE.Object3D(); this.identityPosition = new THREE.Vector3(); ...
/** * @class * @description Constructor for the MRHand class object. Setups up all attributes for MRHand including physics, mouse/cursor information, hand tracking and state, and model * @param {object} handedness - enum for the `left`` or `right` hand. * @param {object} scene - the threejs scene ob...
https://github.com/Volumetrics-io/mrjs/blob/8b31dbfc30f9c12ba74dd59ca44bde6e7de32f79/src/core/user/MRHand.js#L67-L105
8b31dbfc30f9c12ba74dd59ca44bde6e7de32f79