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 handlePropertyChange(nativeEvent) {
if (nativeEvent.propertyName !== 'value') {
return;
}
if (getInstIfValueChanged(activeElementInst)) {
manualDispatchChangeEvent(nativeEvent);
}
} | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | handlePropertyChange | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function handleEventsForInputEventPolyfill(topLevelType, target, targetInst) {
if (topLevelType === 'topFocus') {
// In IE9, propertychange fires for most input events but is buggy and
// doesn't fire when text is deleted, but conveniently, selectionchange
// appears to fire in all of the remaining cases ... | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | handleEventsForInputEventPolyfill | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
// On the selectionchange event, the target is just document which isn't
// helpful for us so just check activeElement instead.
... | (For IE <=9) Handles a propertychange event, sending a `change` event if
the value of the active element has changed. | getTargetInstForInputEventPolyfill | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticUIEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticEvent} | SyntheticUIEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function modifierStateGetter(keyArg) {
var syntheticEvent = this;
var nativeEvent = syntheticEvent.nativeEvent;
if (nativeEvent.getModifierState) {
return nativeEvent.getModifierState(keyArg);
}
var keyProp = modifierKeyToProp[keyArg];
return keyProp ? !!nativeEvent[keyProp] : false;
} | Translation from modifier key to the associated property in the event.
@see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers | modifierStateGetter | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getEventModifierState(nativeEvent) {
return modifierStateGetter;
} | Translation from modifier key to the associated property in the event.
@see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers | getEventModifierState | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticMouseEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticMouseEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getSelection(node) {
if ('selectionStart' in node && ReactInputSelection_1.hasSelectionCapabilities(node)) {
return {
start: node.selectionStart,
end: node.selectionEnd
};
} else if (window.getSelection) {
var selection = window.getSelection();
return {
anchorNode: selecti... | Get an object which is a unique representation of the current selection.
The return value will not be consistent across nodes or browsers, but
two identical selections on the same node will return identical objects.
@param {DOMElement} node
@return {object} | getSelection | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function constructSelectEvent(nativeEvent, nativeEventTarget) {
// Ensure we have the right element, and that the user is not dragging a
// selection (this matches native `select` event behavior). In HTML5, select
// fires only on input and textarea thus if there's no focused element we
// won't dispatch.
if ... | Poll selection to see whether it's changed.
@param {object} nativeEvent
@return {?SyntheticEvent} | constructSelectEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticAnimationEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticEvent} | SyntheticAnimationEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticClipboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticClipboardEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticFocusEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticFocusEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getEventCharCode(nativeEvent) {
var charCode;
var keyCode = nativeEvent.keyCode;
if ('charCode' in nativeEvent) {
charCode = nativeEvent.charCode;
// FF does not set `charCode` for the Enter-key, check against `keyCode`.
if (charCode === 0 && keyCode === 13) {
charCode = 13;
}
}... | `charCode` represents the actual "character code" and is safe to use with
`String.fromCharCode`. As such, only keys that correspond to printable
characters produce a valid `charCode`, the only exception to this is Enter.
The Tab-key is considered non-printable and does not have a `charCode`,
presumably because it does ... | getEventCharCode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getEventKey(nativeEvent) {
if (nativeEvent.key) {
// Normalize inconsistent values reported by browsers due to
// implementations of a working draft specification.
// FireFox implements `key` but returns `MozPrintableKey` for all
// printable characters (normalized to `Unidentified`), ignore... | @param {object} nativeEvent Native browser event.
@return {string} Normalized `key` property. | getEventKey | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticKeyboardEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticKeyboardEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticDragEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticMouseEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticDragEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticTouchEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticUIEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticUIEvent} | SyntheticTouchEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticTransitionEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticEvent} | SyntheticTransitionEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function SyntheticWheelEvent(dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget) {
return SyntheticMouseEvent_1.call(this, dispatchConfig, dispatchMarker, nativeEvent, nativeEventTarget);
} | @param {object} dispatchConfig Configuration used to dispatch this event.
@param {string} dispatchMarker Marker identifying the event target.
@param {object} nativeEvent Native browser event.
@extends {SyntheticMouseEvent} | SyntheticWheelEvent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
capitalize = function (token) {
return token[1].toUpperCase();
} | This is a list of all SVG attributes that need special casing,
namespacing, or boolean value assignment.
When adding attributes to this list, be sure to also add them to
the `possibleStandardNames` module to ensure casing and incorrect
name warnings.
SVG Attributes List:
https://www.w3.org/TR/SVG/attindex.html
SMIL S... | capitalize | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isValidContainer(node) {
return !!(node && (node.nodeType === ELEMENT_NODE || node.nodeType === DOCUMENT_NODE || node.nodeType === DOCUMENT_FRAGMENT_NODE || node.nodeType === COMMENT_NODE && node.nodeValue === ' react-mount-point-unstable '));
} | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | isValidContainer | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getReactRootElementInContainer(container) {
if (!container) {
return null;
}
if (container.nodeType === DOCUMENT_NODE) {
return container.documentElement;
} else {
return container.firstChild;
}
} | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | getReactRootElementInContainer | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function shouldHydrateDueToLegacyHeuristic(container) {
var rootElement = getReactRootElementInContainer(container);
return !!(rootElement && rootElement.nodeType === ELEMENT_NODE && rootElement.hasAttribute(ROOT_ATTRIBUTE_NAME));
} | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | shouldHydrateDueToLegacyHeuristic | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function shouldAutoFocusHostComponent(type, props) {
switch (type) {
case 'button':
case 'input':
case 'select':
case 'textarea':
return !!props.autoFocus;
}
return false;
} | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | shouldAutoFocusHostComponent | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function renderSubtreeIntoContainer(parentComponent, children, container, forceHydrate, callback) {
!isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
{
if (container._reactRootContainer && container.nodeType !== COMMENT_NODE) {
var hostInstance = DOMRende... | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | renderSubtreeIntoContainer | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createPortal(children, container) {
var key = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
!isValidContainer(container) ? invariant(false, 'Target container is not a DOM element.') : void 0;
// TODO: pass ReactDOM portal implementation as third argument
return ReactPortal.... | True if the supplied DOM node is a valid node element.
@param {?DOMElement} node The candidate DOM node.
@return {boolean} True if the DOM is a valid DOM node.
@internal | createPortal | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function hyphenateStyleName(string) {
return hyphenate(string).replace(msPattern, '-ms-');
} | Hyphenates a camelcased CSS property name, for example:
> hyphenateStyleName('backgroundColor')
< "background-color"
> hyphenateStyleName('MozTransition')
< "-moz-transition"
> hyphenateStyleName('msTransition')
< "-ms-transition"
As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix... | hyphenateStyleName | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function hyphenate(string) {
return string.replace(_uppercasePattern, '-$1').toLowerCase();
} | Hyphenates a camelcased string, for example:
> hyphenate('backgroundColor')
< "background-color"
For CSS style names, use `hyphenateStyleName` instead which works properly
with all vendor prefixes, including `ms`.
@param {string} string
@return {string} | hyphenate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function camelize(string) {
return string.replace(_hyphenPattern, function (_, character) {
return character.toUpperCase();
});
} | Camelcases a hyphenated string, for example:
> camelize('background-color')
< "backgroundColor"
@param {string} string
@return {string} | camelize | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn === 'function') {
return iteratorFn;
}
} | Returns the iterator method function contained on the iterable object.
Be sure to invoke the function with the iterable as context:
var iteratorFn = getIteratorFn(myIterable);
if (iteratorFn) {
var iterator = iteratorFn.call(myIterable);
...
}
@param {?object} maybeIterable
@return {?function... | getIteratorFn | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function PropTypeError(message) {
this.message = message;
this.stack = '';
} | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | PropTypeError | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== 'production') {
var manualPropTypeCallCache = {};
var manualPropTypeWarningCount = 0;
}
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentNam... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createChainableTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
componentName = componentName || ANONYMOUS;
propFullName = propFullName || propName;
if (secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
// New behavior only for users of `... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | checkType | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regex... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createPrimitiveTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== expectedType) {
// `propValue` being instance of, say, date/regexp, pass the 'object'
// check, but we can offer ... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunction.thatReturnsNull);
} | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createAnyTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arra... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createArrayOfTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
}
var propValue = props[propName]... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createElementTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` sup... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createInstanceTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS;
var actualClassName = getClassName(props[propName]);
return new PropTypeError('Invalid ' + location + ' `'... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
function validate(props, propName... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createEnumTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
for (var i = 0; i < expectedValues.length; i++) {
if (is(propValue, expectedValues[i])) {
return null;
}
}
var valuesString = JSON.stringify(expectedValues);
... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside obj... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createObjectOfTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker !== 'function') {
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
}
var propValue = props[propName... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers)) {
process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
return emptyFunction.thatReturnsNull;
}
for (var i = 0; i ... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createUnionTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {
return null;
... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createNodeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
if (!isNode(props[propName])) {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
}
return null;
} | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullNam... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createShapeTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied t... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propF... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | createStrictShapeTypeChecker | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
var propType = getPropType(propValue);
if (propType !== 'object') {
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied t... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | validate | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isNode(propValue) {
switch (typeof propValue) {
case 'number':
case 'string':
case 'undefined':
return true;
case 'boolean':
return !propValue;
case 'object':
if (Array.isArray(propValue)) {
return propValue.every(isNode);
}
if... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | isNode | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function isSymbol(propType, propValue) {
// Native Symbol.
if (propType === 'symbol') {
return true;
}
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
if (propValue['@@toStringTag'] === 'Symbol') {
return true;
}
// Fallback for non-spec compliant Symbols which are pol... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | isSymbol | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getPropType(propValue) {
var propType = typeof propValue;
if (Array.isArray(propValue)) {
return 'array';
}
if (propValue instanceof RegExp) {
// Old webkits (at least until Android 4.0) return 'function' rather than
// 'object' for typeof a RegExp. We'll normalize this here s... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | getPropType | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getPreciseType(propValue) {
if (typeof propValue === 'undefined' || propValue === null) {
return '' + propValue;
}
var propType = getPropType(propValue);
if (propType === 'object') {
if (propValue instanceof Date) {
return 'date';
} else if (propValue instanceof RegExp... | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | getPreciseType | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case 'array':
case 'object':
return 'an ' + type;
case 'boolean':
case 'date':
case 'regexp':
return 'a ' + type;
default:
return type;
}
} | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | getPostfixForTypeWarning | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function getClassName(propValue) {
if (!propValue.constructor || !propValue.constructor.name) {
return ANONYMOUS;
}
return propValue.constructor.name;
} | We use an Error-like object for backward compatibility as people may call
PropTypes directly and inspect their output. However, we don't use real
Errors anymore. We don't inspect their stack anyway, and creating them
is prohibitively expensive if they are created too often, such as what
happens in oneOfType() for any t... | getClassName | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
printWarning = function printWarning(format) {
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var argIndex = 0;
var message = 'Warning: ' + format.replace(/%s/g, function () {
return args[argIndex... | Similar to invariant but only logs a warning if the condition is not met.
This can be used to log issues in development environments in critical
paths. Removing the logging code for production environments will keep the
same logic and follow the same code paths. | printWarning | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== 'production') {
for (var typeSpecName in typeSpecs) {
if (typeSpecs.hasOwnProperty(typeSpecName)) {
var error;
// Prop type validation may throw. In case they do, we don't want to
... | Assert that the values match with the type specs.
Error messages are memorized and will only be shown once.
@param {object} typeSpecs Map of name to a ReactPropType
@param {object} values Runtime values that need to be type-checked
@param {string} location e.g. "prop", "context", "child context"
@param {string} compon... | checkPropTypes | javascript | agermanidis/livepython | dist/variable_inspector.js | https://github.com/agermanidis/livepython/blob/master/dist/variable_inspector.js | MIT |
getDistance=function(x1,y1,x2,y2){
// Octile distance
var dx,dy;return diagonalsEnabled?(dx=Math.abs(x1-x2))<(dy=Math.abs(y1-y2))?1.4*dx+dy:1.4*dy+dx:(dx=Math.abs(x1-x2))+(dy=Math.abs(y1-y2))} | This method steps through the A* Algorithm in an attempt to
find your path(s). It will search 4-8 tiles (depending on diagonals) for every calculation.
You can change the number of calculations done in a call by using
easystar.setIteratonsPerCalculation(). | getDistance | javascript | prettymuchbryce/easystarjs | bin/easystar-0.4.4.js | https://github.com/prettymuchbryce/easystarjs/blob/master/bin/easystar-0.4.4.js | MIT |
callbackWrapper = function(result) {
if (syncEnabled) {
callback(result);
} else {
setTimeout(function() {
callback(result);
});
}
} | Find a path.
@param {Number} startX The X position of the starting point.
@param {Number} startY The Y position of the starting point.
@param {Number} endX The X position of the ending point.
@param {Number} endY The Y position of the ending point.
@param {Function} callback A function that is called when your path
is... | callbackWrapper | javascript | prettymuchbryce/easystarjs | src/easystar.js | https://github.com/prettymuchbryce/easystarjs/blob/master/src/easystar.js | MIT |
checkAdjacentNode = function(instance, searchNode, x, y, cost) {
var adjacentCoordinateX = searchNode.x+x;
var adjacentCoordinateY = searchNode.y+y;
if ((pointsToAvoid[adjacentCoordinateY] === undefined ||
pointsToAvoid[adjacentCoordinateY][adjacentCoordinateX] === undefined) &&
... | This method steps through the A* Algorithm in an attempt to
find your path(s). It will search 4-8 tiles (depending on diagonals) for every calculation.
You can change the number of calculations done in a call by using
easystar.setIteratonsPerCalculation(). | checkAdjacentNode | javascript | prettymuchbryce/easystarjs | src/easystar.js | https://github.com/prettymuchbryce/easystarjs/blob/master/src/easystar.js | MIT |
isTileWalkable = function(collisionGrid, acceptableTiles, x, y, sourceNode) {
var directionalCondition = directionalConditions[y] && directionalConditions[y][x];
if (directionalCondition) {
var direction = calculateDirection(sourceNode.x - x, sourceNode.y - y)
var directionInclud... | This method steps through the A* Algorithm in an attempt to
find your path(s). It will search 4-8 tiles (depending on diagonals) for every calculation.
You can change the number of calculations done in a call by using
easystar.setIteratonsPerCalculation(). | isTileWalkable | javascript | prettymuchbryce/easystarjs | src/easystar.js | https://github.com/prettymuchbryce/easystarjs/blob/master/src/easystar.js | MIT |
directionIncluded = function () {
for (var i = 0; i < directionalCondition.length; i++) {
if (directionalCondition[i] === direction) return true
}
return false
} | This method steps through the A* Algorithm in an attempt to
find your path(s). It will search 4-8 tiles (depending on diagonals) for every calculation.
You can change the number of calculations done in a call by using
easystar.setIteratonsPerCalculation(). | directionIncluded | javascript | prettymuchbryce/easystarjs | src/easystar.js | https://github.com/prettymuchbryce/easystarjs/blob/master/src/easystar.js | MIT |
function isValidObjectMaxDepth(maxDepth) {
return isNumber(maxDepth) && maxDepth > 0;
} | @private
@param {Number} maxDepth
@return {boolean} | isValidObjectMaxDepth | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function minErr(module, ErrorConstructor) {
ErrorConstructor = ErrorConstructor || Error;
return function() {
var code = arguments[0],
template = arguments[1],
message = '[' + (module ? module + ':' : '') + code + '] ',
templateArgs = sliceArgs(arguments, 2).map(function(arg) {
return ... | @description
This object provides a utility for producing rich Error messages within
AngularJS. It can be called as follows:
var exampleMinErr = minErr('example');
throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
The above creates an instance of minErr in the example namespace. The
resulting error will have ... | minErr | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
var ngMinErr = minErr('ng');
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
var angular = ensure(window, 'angular', Object);
// We need to expose `angular.$$minErr` to modules such a... | @ngdoc type
@name angular.Module
@module ng
@description
Interface for configuring AngularJS {@link angular.module modules}. | setupModuleLoader | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
} | @ngdoc type
@name angular.Module
@module ng
@description
Interface for configuring AngularJS {@link angular.module modules}. | ensure | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
assertNotHasOwnProperty = function(name, context) {
if (name === 'hasOwnProperty') {
throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
}
} | @ngdoc function
@name angular.module
@module ng
@description
The `angular.module` is a global place for creating, registering and retrieving AngularJS
modules.
All modules (AngularJS core or 3rd party) that should be available to an application must be
registered using this mechanism.
Passing one argument retrieves a... | assertNotHasOwnProperty | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function invokeLater(provider, method, insertMethod, queue) {
if (!queue) queue = invokeQueue;
return function() {
queue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
};
} | @param {string} provider
@param {string} method
@param {String=} insertMethod
@returns {angular.Module} | invokeLater | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function invokeLaterAndSetModuleName(provider, method, queue) {
if (!queue) queue = invokeQueue;
return function(recipeName, factoryFunction) {
if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
queue.push([provider, method, arguments]);
... | @param {string} provider
@param {string} method
@returns {angular.Module} | invokeLaterAndSetModuleName | javascript | angular/batarang | loader.js | https://github.com/angular/batarang/blob/master/loader.js | MIT |
function isValidObjectMaxDepth(maxDepth) {
return isNumber(maxDepth) && maxDepth > 0;
} | @private
@param {Number} maxDepth
@return {boolean} | isValidObjectMaxDepth | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function minErr(module, ErrorConstructor) {
ErrorConstructor = ErrorConstructor || Error;
return function() {
var code = arguments[0],
template = arguments[1],
message = '[' + (module ? module + ':' : '') + code + '] ',
templateArgs = sliceArgs(arguments, 2).map(function(arg) {
return ... | @description
This object provides a utility for producing rich Error messages within
AngularJS. It can be called as follows:
var exampleMinErr = minErr('example');
throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
The above creates an instance of minErr in the example namespace. The
resulting error will have ... | minErr | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function setupModuleLoader(window) {
var $injectorMinErr = minErr('$injector');
var ngMinErr = minErr('ng');
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
}
var angular = ensure(window, 'angular', Object);
// We need to expose `angular.$$minErr` to modules such a... | @ngdoc type
@name angular.Module
@module ng
@description
Interface for configuring AngularJS {@link angular.module modules}. | setupModuleLoader | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function ensure(obj, name, factory) {
return obj[name] || (obj[name] = factory());
} | @ngdoc type
@name angular.Module
@module ng
@description
Interface for configuring AngularJS {@link angular.module modules}. | ensure | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
assertNotHasOwnProperty = function(name, context) {
if (name === 'hasOwnProperty') {
throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
}
} | @ngdoc function
@name angular.module
@module ng
@description
The `angular.module` is a global place for creating, registering and retrieving AngularJS
modules.
All modules (AngularJS core or 3rd party) that should be available to an application must be
registered using this mechanism.
Passing one argument retrieves a... | assertNotHasOwnProperty | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function invokeLater(provider, method, insertMethod, queue) {
if (!queue) queue = invokeQueue;
return function() {
queue[insertMethod || 'push']([provider, method, arguments]);
return moduleInstance;
};
} | @param {string} provider
@param {string} method
@param {String=} insertMethod
@returns {angular.Module} | invokeLater | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function invokeLaterAndSetModuleName(provider, method, queue) {
if (!queue) queue = invokeQueue;
return function(recipeName, factoryFunction) {
if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
queue.push([provider, method, arguments]);
... | @param {string} provider
@param {string} method
@returns {angular.Module} | invokeLaterAndSetModuleName | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function maybeBootstrap() {
// we don't know if angular is loaded
if (!angular.resumeBootstrap) {
return setTimeout(maybeBootstrap, 1);
}
var modules = loadModules();
angular.resumeBootstrap(modules);
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | maybeBootstrap | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function loadModules() {
var modules = [], elt;
if (angular.version.minor < 2) {
return modules;
}
if ((elt = document.querySelector('[ng-hint-include]'))) {
modules = hintModulesFromElement(elt);
} else if (elt = document.querySelector('[ng-hint-exclude]')) {
modules = excludeModules(hintModules... | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | loadModules | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function excludeModules(modulesToExclude) {
return AVAILABLE_MODULES.filter(function(module) {
return modulesToExclude.indexOf(module) === -1;
});
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | excludeModules | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function hintModulesFromElement (elt) {
var selectedModules = (elt.attributes['ng-hint-include'] ||
elt.attributes['ng-hint-exclude']).value.split(' ');
return selectedModules.map(hintModuleName).filter(function (name) {
return (AVAILABLE_MODULES.indexOf(name) > -1) ||
angular.hint.emit('general:404m... | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | hintModulesFromElement | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function hintModuleName(name) {
return 'ngHint' + title(name);
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | hintModuleName | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function title(str) {
return str[0].toUpperCase() + str.substr(1);
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | title | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function shallowSummary (obj, prop) {
obj[prop] = summarizeProperty(model[prop]);
return obj;
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | shallowSummary | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function isAngularPrivatePropertyName (key) {
return !(key[0] === '$' && key[1] === '$') && key !== '$parent' && key !== '$root';
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | isAngularPrivatePropertyName | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function summarizeProperty (obj) {
return obj instanceof Array ?
{ '~array-length': obj.length } :
obj === null ?
null :
typeof obj === 'object' ?
{ '~object': true } :
obj;
} | Closure compiler type information
@typedef { {
requires: !Array.<string>,
invokeQueue: !Array.<Array.<*>>,
service: function(string, Function):angular.Module,
factory: function(string, Function):angular.Module,
value: function(string, *):angular.Module,
filter: function(string, Function):angular.Module,
... | summarizeProperty | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function controllerDecorator($delegate) {
return function(ctrl) {
if (typeof ctrl === 'string') {
var match = ctrl.match(CNTRL_REG);
var ctrlName = (match && match[1]) || ctrl;
if (!nameToControllerMap[ctrlName]) {
sendMessageForControllerName(ctrlName);
}
if (!nameToContro... | Decorates $controller with a patching function to
log a message if the controller is instantiated on the window | controllerDecorator | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function stringOrObjectRegister(controllerName) {
if ((controllerName !== null) && (typeof controllerName === 'object')) {
Object.keys(controllerName).forEach(processController);
} else {
processController(controllerName);
}
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | stringOrObjectRegister | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function processController(ctrlName) {
nameToControllerMap[ctrlName] = true;
sendMessageForControllerName(ctrlName);
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | processController | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function sendMessageForGlobalController(name) {
angular.hint.emit(MODULE_NAME + ':global',
'add `' + name + '` to a module',
angular.version.minor <= 2 ? SEVERITY_WARNING : SEVERITY_ERROR,
CATEGORY_GLOBAL_CONTROLLER);
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | sendMessageForGlobalController | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function sendMessageForControllerName(name) {
var newName = name;
if (!startsWithUpperCase(name)) {
newName = title(newName);
}
if (!endsWithController(name)) {
newName = addControllerSuffix(newName);
}
if (name !== newName) {
angular.hint.emit(MODULE_NAME + ':rename',
'Consider renaming `... | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | sendMessageForControllerName | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function startsWithUpperCase(name) {
var firstChar = name.charAt(0);
return firstChar === firstChar.toUpperCase() &&
firstChar !== firstChar.toLowerCase();
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | startsWithUpperCase | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function title (name) {
return name[0].toUpperCase() + name.substr(1);
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | title | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function endsWithController(name) {
return CONTROLLER_RE.test(name);
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | endsWithController | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function addControllerSuffix(name) {
return name.replace(RE, 'Controller');
} | Save details of the controllers as they are instantiated
for use in decoration.
Hint about the best practices for naming controllers. | addControllerSuffix | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
function removeStringExp(str) {
return str.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,
function(match, pos, full) {
// this is our lookaround code so that our regex doesn't become so
// complicated.
if (pos !== 0 && (match.length + pos) !== full.length &&
full[pos - 1] === '[' && f... | Load necessary functions from /lib into variables. | removeStringExp | javascript | angular/batarang | dist/hint.js | https://github.com/angular/batarang/blob/master/dist/hint.js | MIT |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.