code
stringlengths
24
2.07M
docstring
stringlengths
25
85.3k
func_name
stringlengths
1
92
language
stringclasses
1 value
repo
stringlengths
5
64
path
stringlengths
4
172
url
stringlengths
44
218
license
stringclasses
7 values
function createSafeFragment( document ) { var list = nodeNames.split( "|" ), safeFrag = document.createDocumentFragment(); if ( safeFrag.createElement ) { while ( list.length ) { safeFrag.createElement( list.pop() ); } } return safeFrag; }
Determines whether an object can have data
createSafeFragment
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function getAll( context, tag ) { var elems, elem, i = 0, found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : undefined; if ( !found ) { for ( found = [], el...
Determines whether an object can have data
getAll
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function fixDefaultChecked( elem ) { if ( rcheckableType.test( elem.type ) ) { elem.defaultChecked = elem.checked; } }
Determines whether an object can have data
fixDefaultChecked
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function manipulationTarget( elem, content ) { return jQuery.nodeName( elem, "table" ) && jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? elem.getElementsByTagName("tbody")[0] || elem.appendChild( elem.ownerDocument.createElement("tbody") ) : elem; }
Determines whether an object can have data
manipulationTarget
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function disableScript( elem ) { elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; return elem; }
Determines whether an object can have data
disableScript
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function restoreScript( elem ) { var match = rscriptTypeMasked.exec( elem.type ); if ( match ) { elem.type = match[1]; } else { elem.removeAttribute("type"); } return elem; }
Determines whether an object can have data
restoreScript
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function setGlobalEval( elems, refElements ) { var elem, i = 0; for ( ; (elem = elems[i]) != null; i++ ) { jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); } }
Determines whether an object can have data
setGlobalEval
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function cloneCopyEvent( src, dest ) { if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { return; } var type, i, l, oldData = jQuery._data( src ), curData = jQuery._data( dest, oldData ), events = oldData.events; if ( events ) { delete curData.handle; curData.events = {}; for ( type in events ...
Determines whether an object can have data
cloneCopyEvent
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function fixCloneNodeIssues( src, dest ) { var nodeName, e, data; // We do not need to do anything for non-Elements if ( dest.nodeType !== 1 ) { return; } nodeName = dest.nodeName.toLowerCase(); // IE6-8 copies events bound via attachEvent when using cloneNode. if ( !support.noCloneEvent && dest[ jQuery.exp...
Determines whether an object can have data
fixCloneNodeIssues
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function actualDisplay( name, doc ) { var style, elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), // getDefaultComputedStyle might be reliably used only on attached element display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? // Use of this me...
Retrieve the actual display of a element @param {String} name nodeName of the element @param {Object} doc Document object
actualDisplay
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function defaultDisplay( nodeName ) { var doc = document, display = elemdisplay[ nodeName ]; if ( !display ) { display = actualDisplay( nodeName, doc ); // If the simple way fails, read from inside an iframe if ( display === "none" || !display ) { // Use the already-created iframe if possible iframe ...
Try to determine the default display value of an element @param {String} nodeName
defaultDisplay
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function addGetHookIf( conditionFn, hookFn ) { // Define the hook, we'll check on the first run if it's really needed. return { get: function() { var condition = conditionFn(); if ( condition == null ) { // The test was not ready at this point; screw the hook this time // but check again when needed ...
Try to determine the default display value of an element @param {String} nodeName
addGetHookIf
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function computeStyleTests() { // Minified: var b,c,d,j var div, body, container, contents; body = document.getElementsByTagName( "body" )[ 0 ]; if ( !body || !body.style ) { // Test fired too early or in an unsupported environment, exit. return; } // Setup div = document.createElement( "div" ); ...
Try to determine the default display value of an element @param {String} nodeName
computeStyleTests
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function vendorPropName( style, name ) { // shortcut for names that are not vendor prefixed if ( name in style ) { return name; } // check for vendor prefixed names var capName = name.charAt(0).toUpperCase() + name.slice(1), origName = name, i = cssPrefixes.length; while ( i-- ) { name = cssPrefixes[ i...
Try to determine the default display value of an element @param {String} nodeName
vendorPropName
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function showHide( elements, show ) { var display, elem, hidden, values = [], index = 0, length = elements.length; for ( ; index < length; index++ ) { elem = elements[ index ]; if ( !elem.style ) { continue; } values[ index ] = jQuery._data( elem, "olddisplay" ); display = elem.style.display; i...
Try to determine the default display value of an element @param {String} nodeName
showHide
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function setPositiveNumber( elem, value, subtract ) { var matches = rnumsplit.exec( value ); return matches ? // Guard against undefined "subtract", e.g., when used as in cssHooks Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : value; }
Try to determine the default display value of an element @param {String} nodeName
setPositiveNumber
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { var i = extra === ( isBorderBox ? "border" : "content" ) ? // If we already have the right measurement, avoid augmentation 4 : // Otherwise initialize for horizontal or vertical properties name === "width" ? 1 : 0, val = 0; for ( ; ...
Try to determine the default display value of an element @param {String} nodeName
augmentWidthOrHeight
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function getWidthOrHeight( elem, name, extra ) { // Start with offset property, which is equivalent to the border-box value var valueIsBorderBox = true, val = name === "width" ? elem.offsetWidth : elem.offsetHeight, styles = getStyles( elem ), isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", f...
Try to determine the default display value of an element @param {String} nodeName
getWidthOrHeight
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function Tween( elem, options, prop, end, easing ) { return new Tween.prototype.init( elem, options, prop, end, easing ); }
Try to determine the default display value of an element @param {String} nodeName
Tween
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function createFxNow() { setTimeout(function() { fxNow = undefined; }); return ( fxNow = jQuery.now() ); }
Try to determine the default display value of an element @param {String} nodeName
createFxNow
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function genFx( type, includeWidth ) { var which, attrs = { height: type }, i = 0; // if we include width, step value is 1 to do all cssExpand values, // if we don't include width, step value is 2 to skip over Left and Right includeWidth = includeWidth ? 1 : 0; for ( ; i < 4 ; i += 2 - includeWidth ) { whic...
Try to determine the default display value of an element @param {String} nodeName
genFx
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function createTween( value, prop, animation ) { var tween, collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), index = 0, length = collection.length; for ( ; index < length; index++ ) { if ( (tween = collection[ index ].call( animation, prop, value )) ) { // we're done with this property ...
Try to determine the default display value of an element @param {String} nodeName
createTween
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function defaultPrefilter( elem, props, opts ) { /* jshint validthis: true */ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHidden( elem ), dataShow = jQuery._data( elem, "fxshow" ); // handle queue: false pro...
Try to determine the default display value of an element @param {String} nodeName
defaultPrefilter
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function propFilter( props, specialEasing ) { var index, name, easing, value, hooks; // camelCase, specialEasing and expand cssHook pass for ( index in props ) { name = jQuery.camelCase( index ); easing = specialEasing[ name ]; value = props[ index ]; if ( jQuery.isArray( value ) ) { easing = value[ 1 ];...
Try to determine the default display value of an element @param {String} nodeName
propFilter
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function Animation( elem, properties, options ) { var result, stopped, index = 0, length = animationPrefilters.length, deferred = jQuery.Deferred().always( function() { // don't match elem in the :animated selector delete tick.elem; }), tick = function() { if ( stopped ) { return false; } ...
Try to determine the default display value of an element @param {String} nodeName
Animation
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
tick = function() { if ( stopped ) { return false; } var currentTime = fxNow || createFxNow(), remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) temp = remaining / animation.duration || 0, ...
Try to determine the default display value of an element @param {String} nodeName
tick
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
doAnimation = function() { // Operate on a copy of prop so per-property easing won't be lost var anim = Animation( this, jQuery.extend( {}, prop ), optall ); // Empty animations, or finishing resolves immediately if ( empty || jQuery._data( this, "finish" ) ) { anim.stop( true ); } }
Try to determine the default display value of an element @param {String} nodeName
doAnimation
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
stopQueue = function( hooks ) { var stop = hooks.stop; delete hooks.stop; stop( gotoEnd ); }
Try to determine the default display value of an element @param {String} nodeName
stopQueue
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function addToPrefiltersOrTransports( structure ) { // dataTypeExpression is optional and defaults to "*" return function( dataTypeExpression, func ) { if ( typeof dataTypeExpression !== "string" ) { func = dataTypeExpression; dataTypeExpression = "*"; } var dataType, i = 0, dataTypes = dataTypeE...
Try to determine the default display value of an element @param {String} nodeName
addToPrefiltersOrTransports
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { var inspected = {}, seekingTransport = ( structure === transports ); function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {...
Try to determine the default display value of an element @param {String} nodeName
inspectPrefiltersOrTransports
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function inspect( dataType ) { var selected; inspected[ dataType ] = true; jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !insp...
Try to determine the default display value of an element @param {String} nodeName
inspect
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function ajaxExtend( target, src ) { var deep, key, flatOptions = jQuery.ajaxSettings.flatOptions || {}; for ( key in src ) { if ( src[ key ] !== undefined ) { ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; } } if ( deep ) { jQuery.extend( true, target, deep ); } retur...
Try to determine the default display value of an element @param {String} nodeName
ajaxExtend
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function ajaxHandleResponses( s, jqXHR, responses ) { var firstDataType, ct, finalDataType, type, contents = s.contents, dataTypes = s.dataTypes; // Remove auto dataType and get content-type in the process while ( dataTypes[ 0 ] === "*" ) { dataTypes.shift(); if ( ct === undefined ) { ct = s.mimeType || ...
Try to determine the default display value of an element @param {String} nodeName
ajaxHandleResponses
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function ajaxConvert( s, response, jqXHR, isSuccess ) { var conv2, current, conv, tmp, prev, converters = {}, // Work with a copy of dataTypes in case we need to modify it for conversion dataTypes = s.dataTypes.slice(); // Create converters map with lowercased keys if ( dataTypes[ 1 ] ) { for ( conv in s.co...
Try to determine the default display value of an element @param {String} nodeName
ajaxConvert
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function done( status, nativeStatusText, responses, headers ) { var isSuccess, success, error, response, modified, statusText = nativeStatusText; // Called once if ( state === 2 ) { return; } // State is "done" now state = 2; // Clear timeout if it exists if ( timeoutTimer ) { cle...
Try to determine the default display value of an element @param {String} nodeName
done
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function buildParams( prefix, obj, traditional, add ) { var name; if ( jQuery.isArray( obj ) ) { // Serialize array item. jQuery.each( obj, function( i, v ) { if ( traditional || rbracket.test( prefix ) ) { // Treat each array item as a scalar. add( prefix, v ); } else { // Item is non-scalar ...
Try to determine the default display value of an element @param {String} nodeName
buildParams
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
add = function( key, value ) { // If value is a function, invoke it and return its value value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); }
Try to determine the default display value of an element @param {String} nodeName
add
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function createStandardXHR() { try { return new window.XMLHttpRequest(); } catch( e ) {} }
Try to determine the default display value of an element @param {String} nodeName
createStandardXHR
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function createActiveXHR() { try { return new window.ActiveXObject( "Microsoft.XMLHTTP" ); } catch( e ) {} }
Try to determine the default display value of an element @param {String} nodeName
createActiveXHR
javascript
lodge/lodge
public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
https://github.com/lodge/lodge/blob/master/public/assets/application-ad2df1dd7a2bc3c99128f6e5716010ee.js
MIT
function addStyleSheet(ownerDocument, cssText) { var p = ownerDocument.createElement('p'), parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; p.innerHTML = 'x<style>' + cssText + '</style>'; return parent.insertBefore(p.lastChild, parent.firstChild); }
Creates a style sheet with the given CSS text and adds it to the document. @private @param {Document} ownerDocument The document. @param {String} cssText The CSS text. @returns {StyleSheet} The style element.
addStyleSheet
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function getElements() { var elements = html5.elements; return typeof elements == 'string' ? elements.split(' ') : elements; }
Returns the value of `html5.elements` as an array. @private @returns {Array} An array of shived element node names.
getElements
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function addElements(newElements, ownerDocument) { var elements = html5.elements; if(typeof elements != 'string'){ elements = elements.join(' '); } if(typeof newElements != 'string'){ newElements = newElements.join(' '); } html5.elements = elements +' '+ newElements; shivDocument...
Extends the built-in list of html5 elements @memberOf html5 @param {String|Array} newElements whitespace separated list or array of new element names to shiv @param {Document} ownerDocument The context document.
addElements
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function getExpandoData(ownerDocument) { var data = expandoData[ownerDocument[expando]]; if (!data) { data = {}; expanID++; ownerDocument[expando] = expanID; expandoData[expanID] = data; } return data; }
Returns the data associated to the given document @private @param {Document} ownerDocument The document. @returns {Object} An object of data.
getExpandoData
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function createElement(nodeName, ownerDocument, data){ if (!ownerDocument) { ownerDocument = document; } if(supportsUnknownElements){ return ownerDocument.createElement(nodeName); } if (!data) { data = getExpandoData(ownerDocument); } var node; if (data.cache[nod...
returns a shived element for the given nodeName and document @memberOf html5 @param {String} nodeName name of the element @param {Document} ownerDocument The context document. @returns {Object} The shived element.
createElement
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function createDocumentFragment(ownerDocument, data){ if (!ownerDocument) { ownerDocument = document; } if(supportsUnknownElements){ return ownerDocument.createDocumentFragment(); } data = data || getExpandoData(ownerDocument); var clone = data.frag.cloneNode(), i = 0, ...
returns a shived DocumentFragment for the given document @memberOf html5 @param {Document} ownerDocument The context document. @returns {Object} The shived DocumentFragment.
createDocumentFragment
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function shivMethods(ownerDocument, data) { if (!data.cache) { data.cache = {}; data.createElem = ownerDocument.createElement; data.createFrag = ownerDocument.createDocumentFragment; data.frag = data.createFrag(); } ownerDocument.createElement = function(nodeName) { /...
Shivs the `createElement` and `createDocumentFragment` methods of the document. @private @param {Document|DocumentFragment} ownerDocument The document. @param {Object} data of the document.
shivMethods
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function shivDocument(ownerDocument) { if (!ownerDocument) { ownerDocument = document; } var data = getExpandoData(ownerDocument); if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { data.hasCSS = !!addStyleSheet(ownerDocument, // corrects block display not defined in IE6...
Shivs the given document. @memberOf html5 @param {Document} ownerDocument The document to shiv. @returns {Document} The shived document.
shivDocument
javascript
lodge/lodge
vendor/assets/javascripts/externals/html5shiv.js
https://github.com/lodge/lodge/blob/master/vendor/assets/javascripts/externals/html5shiv.js
MIT
function TimeSeries(options) { this.options = Util.extend({}, TimeSeries.defaultOptions, options); this.clear(); }
Initialises a new <code>TimeSeries</code> with optional data options. Options are of the form (defaults shown): <pre> { resetBounds: true, // enables/disables automatic scaling of the y-axis resetBoundsInterval: 3000 // the period between scaling calculations, in millis } </pre> Presentation options for T...
TimeSeries
javascript
01alchemist/TurboScript
benchmark/web-dsp/demo/smoothie.js
https://github.com/01alchemist/TurboScript/blob/master/benchmark/web-dsp/demo/smoothie.js
Apache-2.0
function SmoothieChart(options) { this.options = Util.extend({}, SmoothieChart.defaultChartOptions, options); this.seriesSet = []; this.currentValueRange = 1; this.currentVisMinValue = 0; this.lastRenderTimeMillis = 0; }
Initialises a new <code>SmoothieChart</code>. Options are optional, and should be of the form below. Just specify the values you need and the rest will be given sensible defaults as shown: <pre> { minValue: undefined, // specify to clamp the lower y-axis to a given value maxValue: undefined, ...
SmoothieChart
javascript
01alchemist/TurboScript
benchmark/web-dsp/demo/smoothie.js
https://github.com/01alchemist/TurboScript/blob/master/benchmark/web-dsp/demo/smoothie.js
Apache-2.0
requestAnimationFrame = function(callback, element) { var requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msReq...
Initialises a new <code>SmoothieChart</code>. Options are optional, and should be of the form below. Just specify the values you need and the rest will be given sensible defaults as shown: <pre> { minValue: undefined, // specify to clamp the lower y-axis to a given value maxValue: undefined, ...
requestAnimationFrame
javascript
01alchemist/TurboScript
benchmark/web-dsp/demo/smoothie.js
https://github.com/01alchemist/TurboScript/blob/master/benchmark/web-dsp/demo/smoothie.js
Apache-2.0
cancelAnimationFrame = function(id) { var cancelAnimationFrame = window.cancelAnimationFrame || function(id) { clearTimeout(id); }; return cancelAnimationFrame.call(window, id); }
Initialises a new <code>SmoothieChart</code>. Options are optional, and should be of the form below. Just specify the values you need and the rest will be given sensible defaults as shown: <pre> { minValue: undefined, // specify to clamp the lower y-axis to a given value maxValue: undefined, ...
cancelAnimationFrame
javascript
01alchemist/TurboScript
benchmark/web-dsp/demo/smoothie.js
https://github.com/01alchemist/TurboScript/blob/master/benchmark/web-dsp/demo/smoothie.js
Apache-2.0
timeToXPixel = function(t) { if(chartOptions.scrollBackwards) { return Math.round((time - t) / chartOptions.millisPerPixel); } return Math.round(dimensions.width - ((time - t) / chartOptions.millisPerPixel)); }
Stops the animation of this chart.
timeToXPixel
javascript
01alchemist/TurboScript
benchmark/web-dsp/demo/smoothie.js
https://github.com/01alchemist/TurboScript/blob/master/benchmark/web-dsp/demo/smoothie.js
Apache-2.0
function deriveConcreteClass(context, type, parameters, scope) { var templateNode = type.resolvedType.pointerTo ? type.resolvedType.pointerTo.symbol.node : type.resolvedType.symbol.node; var templateName = templateNode.stringValue; var typeName = templateNode.stringValue + ("<" + parameters[0].stringValue +...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
deriveConcreteClass
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function cloneChildren(child, parentNode, parameters, templateName, typeName) { var firstChildNode = null; var lastChildNode = null; while (child) { if (child.stringValue == "this" && child.parent.symbol && child.parent.symbol.kind == symbol_1.SymbolKind.FUNCTION_INSTANCE && child.kind =...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
cloneChildren
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function resolveChildren(context, node, parentScope) { var child = node.firstChild; while (child != null) { resolve(context, child, parentScope); assert_1.assert(child.resolvedType != null); child = child.nextSibling; } }
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
resolveChildren
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function resolveChildrenAsExpressions(context, node, parentScope) { var child = node.firstChild; while (child != null) { resolveAsExpression(context, child, parentScope); child = child.nextSibling; } }
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
resolveChildrenAsExpressions
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function resolveAsExpression(context, node, parentScope) { assert_1.assert(node_1.isExpression(node)); resolve(context, node, parentScope); assert_1.assert(node.resolvedType != null); if (node.resolvedType != context.errorType) { if (node.isType()) { context.log.error(node.range, "Ex...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
resolveAsExpression
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function resolveAsType(context, node, parentScope) { assert_1.assert(node_1.isExpression(node)); resolve(context, node, parentScope); assert_1.assert(node.resolvedType != null); if (node.resolvedType != context.errorType && !node.isType()) { context.log.error(node.range, "Expected type but found...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
resolveAsType
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function canConvert(context, node, to, kind) { var from = node.resolvedType; assert_1.assert(node_1.isExpression(node)); assert_1.assert(from != null); assert_1.assert(to != null); //Generic always accept any types if (from.isGeneric() || to.isGeneric()) { return true; } // Early...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
canConvert
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function checkConversion(context, node, to, kind) { if (!canConvert(context, node, to, kind)) { context.log.error(node.range, "Cannot convert from type '" + node.resolvedType.toString() + "' to type '" + to.toString() + "' " + (kind == type_1.ConversionKind.IMPLICIT && canConvert(context, node, ...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
checkConversion
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function checkStorage(context, target) { assert_1.assert(node_1.isExpression(target)); if (target.resolvedType != context.errorType && target.kind != node_1.NodeKind.INDEX && target.kind != node_1.NodeKind.POINTER_INDEX && target.kind != node_1.NodeKind.DEREFERENCE && (target.kin...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
checkStorage
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function createDefaultValueForType(context, type) { if (type.isLong()) { return node_1.createLong(0); } else if (type.isInteger()) { return node_1.createInt(0); } else if (type.isDouble()) { return node_1.createDouble(0); } else if (type.isFloat()) { return no...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
createDefaultValueForType
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function simplifyBinary(node) { var left = node.binaryLeft(); var right = node.binaryRight(); // Canonicalize commutative operators if ((node.kind == node_1.NodeKind.ADD || node.kind == node_1.NodeKind.MULTIPLY || node.kind == node_1.NodeKind.BITWISE_AND || node.kind == node_1.NodeKind.BITWISE_O...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
simplifyBinary
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function binaryHasUnsignedArguments(node) { var left = node.binaryLeft(); var right = node.binaryRight(); var leftType = left.resolvedType; var rightType = right.resolvedType; return leftType.isUnsigned() && rightType.isUnsigned() || leftType.isUnsigned() && right.isNonNegativeInteger() || l...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
binaryHasUnsignedArguments
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function isBinaryLong(node) { var left = node.binaryLeft(); var right = node.binaryRight(); var leftType = left.resolvedType; var rightType = right.resolvedType; return leftType.isLong() || rightType.isLong(); }
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
isBinaryLong
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function isBinaryDouble(node) { var left = node.binaryLeft(); var right = node.binaryRight(); var leftType = left.resolvedType; var rightType = right.resolvedType; return leftType.isDouble() || rightType.isDouble(); }
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
isBinaryDouble
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function isSymbolAccessAllowed(context, symbol, node, range) { if (symbol.isUnsafe() && !context.isUnsafeAllowed) { context.log.error(range, "Cannot use symbol '" + symbol.name + "' outside an 'unsafe' block"); return false; } if (symbol.node != null && symbol.node.isPrivate()) { var...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
isSymbolAccessAllowed
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function resolve(context, node, parentScope) { var kind = node.kind; assert_1.assert(kind == node_1.NodeKind.FILE || parentScope != null); if (node.resolvedType != null) { return; } node.resolvedType = context.errorType; if (kind == node_1.NodeKind.FILE || kind == node_1.NodeKind.GLOBAL)...
Derive a concrete class from class template type @param context @param type @param parameters @param scope @returns {Symbol}
resolve
javascript
01alchemist/TurboScript
lib/turboscript.js
https://github.com/01alchemist/TurboScript/blob/master/lib/turboscript.js
Apache-2.0
function TouchScroll(/*HTMLElement*/scrollElement, /*Object*/options){ options = options || {}; this.elastic = !!options.elastic, this.snapToGrid = !!options.snapToGrid; this.containerSize = null; this.maxSegments = {e: 1, f: 1}; this.currentSegment = {e: 0, f: 0}; // references to scroll div elements this.sc...
Constructor for scrollers. @constructor @param {HTMLElement} scrollElement The node to make scrollable @param {Object} [options] Options for the scroller- Known options are elastic {Boolean} whether the scroller bounces
TouchScroll
javascript
davidaurelio/TouchScroll
src/touchscroll.js
https://github.com/davidaurelio/TouchScroll/blob/master/src/touchscroll.js
BSD-2-Clause
async viteFinal(config) { // Merge custom configuration into the default config return mergeConfig(config, { assetsInclude: ['**/*.glb', '**/*.hdr', '**/*.glsl'], build: { assetsInlineLimit: 1024, }, }); }
@type { import('@storybook/react-vite').StorybookConfig }
viteFinal
javascript
HamishMW/portfolio
.storybook/main.js
https://github.com/HamishMW/portfolio/blob/master/.storybook/main.js
MIT
async function loadImageFromSrcSet({ src, srcSet, sizes }) { return new Promise((resolve, reject) => { try { if (!src && !srcSet) { throw new Error('No image src or srcSet provided'); } let tempImage = new Image(); if (src) { tempImage.src = src; } if (srcSet...
Use the browser's image loading to load an image and grab the `src` it chooses from a `srcSet`
loadImageFromSrcSet
javascript
HamishMW/portfolio
app/utils/image.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/image.js
MIT
onLoad = () => { tempImage.removeEventListener('load', onLoad); const source = tempImage.currentSrc; tempImage = null; resolve(source); }
Use the browser's image loading to load an image and grab the `src` it chooses from a `srcSet`
onLoad
javascript
HamishMW/portfolio
app/utils/image.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/image.js
MIT
onLoad = () => { tempImage.removeEventListener('load', onLoad); const source = tempImage.currentSrc; tempImage = null; resolve(source); }
Use the browser's image loading to load an image and grab the `src` it chooses from a `srcSet`
onLoad
javascript
HamishMW/portfolio
app/utils/image.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/image.js
MIT
async function generateImage(width = 1, height = 1) { return new Promise(resolve => { const canvas = document.createElement('canvas'); const ctx = canvas.getContext('2d'); canvas.width = width; canvas.height = height; ctx.fillStyle = 'rgba(0, 0, 0, 0)'; ctx.fillRect(0, 0, width, height); ...
Generates a transparent png of a given width and height
generateImage
javascript
HamishMW/portfolio
app/utils/image.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/image.js
MIT
async function resolveSrcFromSrcSet({ srcSet, sizes }) { const sources = await Promise.all( srcSet.split(', ').map(async srcString => { const [src, width] = srcString.split(' '); const size = Number(width.replace('w', '')); const image = await generateImage(size); return { src, image, widt...
Use native html image `srcSet` resolution for non-html images
resolveSrcFromSrcSet
javascript
HamishMW/portfolio
app/utils/image.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/image.js
MIT
rgbToThreeColor = rgb => rgb?.split(' ').map(value => Number(value) / 255) || []
Convert an rgb theme property (e.g. rgbBlack: '0 0 0') to values that can be spread into a ThreeJS Color class
rgbToThreeColor
javascript
HamishMW/portfolio
app/utils/style.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/style.js
MIT
rgbToThreeColor = rgb => rgb?.split(' ').map(value => Number(value) / 255) || []
Convert an rgb theme property (e.g. rgbBlack: '0 0 0') to values that can be spread into a ThreeJS Color class
rgbToThreeColor
javascript
HamishMW/portfolio
app/utils/style.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/style.js
MIT
function cssProps(props, style = {}) { let result = {}; const keys = Object.keys(props); for (const key of keys) { let value = props[key]; if (typeof value === 'number' && key === 'delay') { value = numToMs(value); } if (typeof value === 'number' && key !== 'opacity') { value = num...
Convert a JS object into `--` prefixed css custom properties. Optionally pass a second param for normal styles
cssProps
javascript
HamishMW/portfolio
app/utils/style.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/style.js
MIT
cleanScene = scene => { scene?.traverse(object => { if (!object.isMesh) return; object.geometry.dispose(); if (object.material.isMaterial) { cleanMaterial(object.material); } else { for (const material of object.material) { cleanMaterial(material); } } }); }
Clean up a scene's materials and geometry
cleanScene
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
cleanScene = scene => { scene?.traverse(object => { if (!object.isMesh) return; object.geometry.dispose(); if (object.material.isMaterial) { cleanMaterial(object.material); } else { for (const material of object.material) { cleanMaterial(material); } } }); }
Clean up a scene's materials and geometry
cleanScene
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
cleanMaterial = material => { material.dispose(); for (const key of Object.keys(material)) { const value = material[key]; if (value && typeof value === 'object' && 'minFilter' in value) { value.dispose(); // Close GLTF bitmap textures value.source?.data?.close?.(); } } }
Clean up and dispose of a material
cleanMaterial
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
cleanMaterial = material => { material.dispose(); for (const key of Object.keys(material)) { const value = material[key]; if (value && typeof value === 'object' && 'minFilter' in value) { value.dispose(); // Close GLTF bitmap textures value.source?.data?.close?.(); } } }
Clean up and dispose of a material
cleanMaterial
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
cleanRenderer = renderer => { renderer.dispose(); renderer = null; }
Clean up and dispose of a renderer
cleanRenderer
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
cleanRenderer = renderer => { renderer.dispose(); renderer = null; }
Clean up and dispose of a renderer
cleanRenderer
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
removeLights = lights => { for (const light of lights) { light.parent.remove(light); } }
Clean up lights by removing them from their parent
removeLights
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
removeLights = lights => { for (const light of lights) { light.parent.remove(light); } }
Clean up lights by removing them from their parent
removeLights
javascript
HamishMW/portfolio
app/utils/three.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/three.js
MIT
function formatTimecode(time) { const hours = time / 1000 / 60 / 60; const h = Math.floor(hours); const m = Math.floor((hours - h) * 60); const s = Math.floor(((hours - h) * 60 - m) * 60); const c = Math.floor(((((hours - h) * 60 - m) * 60 - s) * 1000) / 10); return `${zeroPrefix(h)}:${zeroPrefix(m)}:${ze...
Format a timecode intro a hours:minutes:seconds:centiseconds string
formatTimecode
javascript
HamishMW/portfolio
app/utils/timecode.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/timecode.js
MIT
function zeroPrefix(value) { return value < 10 ? `0${value}` : `${value}`; }
Prefix a number with zero as a string if less than 10
zeroPrefix
javascript
HamishMW/portfolio
app/utils/timecode.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/timecode.js
MIT
function readingTime(text) { const wpm = 225; const words = text.trim().split(/\s+/).length; const time = words / wpm; return time * 1000 * 60; }
Prefix a number with zero as a string if less than 10
readingTime
javascript
HamishMW/portfolio
app/utils/timecode.js
https://github.com/HamishMW/portfolio/blob/master/app/utils/timecode.js
MIT
function parse (input, options = {}) { try { options = Object.assign({}, defaultAcornOptions, options) return parser.parse(input, options); } catch (e) { e.message = [ e.message, ' ' + input.split('\n')[e.loc.line - 1], ' ' + '^'.padStart(e.loc....
@param {string} input @param {object} options @return {any}
parse
javascript
PepsRyuu/nollup
lib/impl/AcornParser.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/AcornParser.js
MIT
static async loadCJS(filepath, code) { // Once transpiled, we temporarily modify the require function // so that when it loads the config file, it will load the transpiled // version instead, and all of the require calls inside that will still work. let defaultLoader = require.extensions...
Uses compiler to compile rollup.config.js file. This allows config file to use ESM, but compiles to CJS so that import statements change to require statements. @param {string} filepath @param {string} code @return {Promise<object>}
loadCJS
javascript
PepsRyuu/nollup
lib/impl/ConfigLoader.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/ConfigLoader.js
MIT
static async loadESM(filepath, code) { let uri = `data:text/javascript;charset=utf-8,${encodeURIComponent(code)}`; return (await import(uri)).default; }
Directly imports rollup.config.mjs @param {string} filepath @param {string} code @return {Promise<object>}
loadESM
javascript
PepsRyuu/nollup
lib/impl/ConfigLoader.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/ConfigLoader.js
MIT
function blanker (input, start, end) { return input.substring(start, end).replace(/[^\n\r]/g, ' '); }
Setting imports to empty can cause source maps to break. This is because some imports could span across multiple lines when importing named exports. To bypass this problem, this function will replace all text except line breaks with spaces. This will preserve the lines so source maps function correctly. Source maps are...
blanker
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function normalizePathDelimiter (id) { return id.replace(/\\/g, '/'); }
Setting imports to empty can cause source maps to break. This is because some imports could span across multiple lines when importing named exports. To bypass this problem, this function will replace all text except line breaks with spaces. This will preserve the lines so source maps function correctly. Source maps are...
normalizePathDelimiter
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function escapeCode (code) { // Turning the code into eval statements, so we need // to escape line breaks and quotes. Using a multiline // approach here so that the compiled code is still // readable for advanced debugging situations. return code .replace(/\\/g, '\\\\') .rep...
Setting imports to empty can cause source maps to break. This is because some imports could span across multiple lines when importing named exports. To bypass this problem, this function will replace all text except line breaks with spaces. This will preserve the lines so source maps function correctly. Source maps are...
escapeCode
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function getVariableNames(node) { if (node.type === 'ObjectPattern') { return node.properties.flatMap(p => { if (p.value.type === 'Identifier') { return p.value.name; } else { return getVariableNames(p.value) } }); } if (no...
Setting imports to empty can cause source maps to break. This is because some imports could span across multiple lines when importing named exports. To bypass this problem, this function will replace all text except line breaks with spaces. This will preserve the lines so source maps function correctly. Source maps are...
getVariableNames
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function getSyntheticExports (synthetic) { if (synthetic === true) { synthetic = 'default'; } return `if (__m__.exports.${synthetic}) { for (let prop in __m__.exports.${synthetic}) { prop !== '${synthetic}' && !__m__.exports.hasOwnProperty(prop) && __e__(prop, function () { retu...
@param {boolean|string} synthetic @return {string}
getSyntheticExports
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function createExternalImports (chunk, outputOptions, externalImports) { let output = ''; let { format, globals } = outputOptions; output += externalImports.map(ei => { let name = ei.source.replace(/[\W]/g, '_'); let { source, specifiers } = ei; // Bare external import if (...
@param {RollupRenderedChunk} chunk @param {RollupOutputOptions} outputOptions @param {Array<NollupInternalModuleImport>} externalImports @return {string}
createExternalImports
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
function callNollupModuleWrap (plugins, code) { return plugins.filter(p => { return p.nollupModuleWrap }).reduce((code, p) => { return p.nollupModuleWrap(code) }, code); }
@param {NollupPlugin[]} plugins @param {string} code @return {string}
callNollupModuleWrap
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT
onESMEnter (code, filePath, ast) { activeModules[filePath] = { output: new MagicString(code), code: code }; }
@param {string} code @param {string} filePath @param {ESTree} ast
onESMEnter
javascript
PepsRyuu/nollup
lib/impl/NollupCodeGenerator.js
https://github.com/PepsRyuu/nollup/blob/master/lib/impl/NollupCodeGenerator.js
MIT