Started adding frontend notifications, fixing firefox file upload bug

This commit is contained in:
2018-01-22 19:03:06 -05:00
parent f14e96c490
commit 5856052f82
1536 changed files with 109746 additions and 2658 deletions

View File

@@ -22,8 +22,7 @@
"fetchSpec": "1.1.0"
},
"_requiredBy": [
"/",
"/react-dropzone"
"/"
],
"_resolved": "https://registry.npmjs.org/attr-accept/-/attr-accept-1.1.0.tgz",
"_spec": "1.1.0",

View File

@@ -0,0 +1 @@
webpack.config.js

View File

@@ -0,0 +1,5 @@
language: node_js
node_js:
- "8"
script:
- yarn lint && yarn test:coverage

21
goTorrentWebUI/node_modules/react-toastify/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Fadi Khadra
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1093
goTorrentWebUI/node_modules/react-toastify/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

272
goTorrentWebUI/node_modules/react-toastify/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,272 @@
import * as React from 'react';
import Transition from 'react-transition-group/Transition';
type ToastType = 'info' | 'success' | 'warning' | 'error' | 'default';
type ToastContent = React.ReactNode | { (): void };
interface styleProps {
/**
* Set the default toast width.
* Default: '320px'
*/
width?: string;
/**
* Set the toast color when no type is provided.
* Default: '#fff'
*/
colorDefault?: string;
/**
* Set the toast color when the type is INFO.
* Default: '#3498db'
*/
colorInfo?: string;
/**
* Set the toast color when the type is SUCCESS.
* Default: '#07bc0c'
*/
colorSuccess?: string;
/**
* Set the toast color when the type is WARNING.
* Default: '#f1c40f'
*/
colorWarning?: string;
/**
* Set the toast color when the type is ERROR.
* Default: '#e74c3c'
*/
colorError?: string;
/**
* Set the progress bar color when no type is provided.
* Default: 'linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)'
*/
colorProgressDefault?: string;
/**
* Media query to apply mobile style.
* Default: 'only screen and (max-width : 480px)'
*/
mobile?: string;
/**
* Set the z-index for the ToastContainer.
* Default: 9999
*/
zIndex?: string | number;
/**
* Override the default position.
* Default: {
* top: '1em',
* left: '1em'
* }
*/
TOP_LEFT?: object;
/**
* Override the default position.
* Default: {
* top: '1em',
* left: '50%'
* }
*/
TOP_CENTER?: object;
/**
* Override the default position.
* Default: {
* top: '1em',
* right: '1em'
*}
*/
TOP_RIGHT?: object;
/**
* Override the default position.
* Default: {
* bottom: '1em',
* left: '1em'
* }
*/
BOTTOM_LEFT?: object;
/**
* Override the default position.
* Default: {
* bottom: '1em',
* left: '50%'
*}
*/
BOTTOM_CENTER?: object;
/**
* Override the default position.
* Default: {
* bottom: '1em',
* right: '1em'
*}
*/
BOTTOM_RIGHT?: object;
}
interface CommonOptions {
/**
* Pause the timer when the mouse hover the toast.
*/
pauseOnHover?: boolean;
/**
* Remove the toast when clicked.
*/
closeOnClick?: boolean;
/**
* Set the delay in ms to close the toast automatically.
* Use `false` to prevent the toast from closing.
*/
autoClose?: number | false;
/**
* Set the default position to use.
* One of: 'top-right', 'top-center', 'top-left', 'bottom-right', 'bottom-center', 'bottom-left'
*/
position?: string;
/**
* Pass a custom close button.
* To remove the close button pass `false`
*/
closeButton?: React.ReactNode | false;
/**
* An optional css class to set for the progress bar. It can be a glamor rule
* or a css class name.
*/
progressClassName?: string | object;
/**
* An optional css class to set. It can be a glamor rule
* or a css class name.
*/
className?: string | object;
/**
* An optional css class to set for the toast content. It can be a glamor rule
* or a css class name.
*/
bodyClassName?: string | object;
/**
* Show or not the progress bar.
*/
hideProgressBar?: boolean;
/**
* Pass a custom transition built with react-transition-group.
*/
transition?: Transition;
}
interface ToastOptions extends CommonOptions {
/**
* Called inside componentDidMount.
*/
onOpen?: () => void;
/**
* Called inside componentWillUnMount.
*/
onClose?: () => void;
/**
* Set the toast type.
* One of: 'info', 'success', 'warning', 'error', 'default'.
*/
type?: ToastType;
}
interface UpdateOptions extends ToastOptions {
/**
* Used to update a toast.
* Pass any valid ReactNode(string, number, component)
*/
render?: ToastContent;
}
interface ToastContainerProps extends CommonOptions {
/**
* Whether or not to display the newest toast on top.
* Default: false
*/
newestOnTop?: boolean;
/**
* An optional inline style to apply.
*/
style?: object;
/**
* An optional css class to set. It can be a glamor rule
* or a css class name.
*/
toastClassName?: string | object;
}
interface Toast {
/**
* Shorthand to display toast of type 'success'.
*/
success(content: ToastContent, options?: ToastOptions): number;
/**
* Shorthand to display toast of type 'info'.
*/
info(content: ToastContent, options?: ToastOptions): number;
/**
* Shorthand to display toast of type 'warning'.
*/
warn(content: ToastContent, options?: ToastOptions): number;
/**
* Shorthand to display toast of type 'error'.
*/
error(content: ToastContent, options?: ToastOptions): number;
/**
* Check if a toast is active by passing the `toastId`.
* Each time you display a toast you receive a `toastId`.
*/
isActive(toastId: number): boolean;
/**
* Remove a toast. If no `toastId` is used, all the active toast
* will be removed.
*/
dismiss(toastId?: number): void;
/**
* Update an existing toast. By default, we keep the initial content and options of the toast.
*/
update(toastId: number, options?: UpdateOptions): number;
/**
* Display a toast without a specific type.
*/
(content: ToastContent, options?: ToastOptions): number;
}
export class ToastContainer extends React.Component<ToastContainerProps> {}
/**
* Helper to override the global style.
*/
export function style(props: styleProps): void;
export let toast: Toast;

View File

@@ -0,0 +1,56 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /* eslint react/require-default-props: 0 */
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _glamor = require('glamor');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var rule = function rule(isDefault) {
return (0, _glamor.css)({
color: isDefault ? '#000' : '#fff',
fontWeight: 'bold',
fontSize: '14px',
background: 'transparent',
outline: 'none',
border: 'none',
padding: 0,
cursor: 'pointer',
opacity: isDefault ? '0.3' : '0.7',
transition: '.3s ease',
alignSelf: 'flex-start',
':hover, :focus': {
opacity: 1
}
});
};
function DefaultCloseButton(_ref) {
var closeToast = _ref.closeToast,
type = _ref.type;
return _react2.default.createElement(
'button',
_extends({}, rule(type === 'default'), { type: 'button', onClick: closeToast }),
'\u2716'
);
}
DefaultCloseButton.propTypes = {
closeToast: _propTypes2.default.func
};
exports.default = DefaultCloseButton;

View File

@@ -0,0 +1,77 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _Transition = require('react-transition-group/Transition');
var _Transition2 = _interopRequireDefault(_Transition);
var _glamor = require('glamor');
var _animation2 = require('./animation');
var _animation3 = _interopRequireDefault(_animation2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
var animate = {
animationDuration: '0.75s',
animationFillMode: 'both'
};
var animation = function animation(pos) {
var _getAnimation = (0, _animation3.default)(pos),
enter = _getAnimation.enter,
exit = _getAnimation.exit;
var enterAnimation = _glamor.css.keyframes('enter', _extends({
'from, 60%, 75%, 90%, to': {
animationTimingFunction: 'cubic-bezier(0.215, 0.610, 0.355, 1.000)'
}
}, enter));
var exitAnimation = _glamor.css.keyframes('exit', exit);
return {
enter: (0, _glamor.css)(_extends({}, animate, { animationName: enterAnimation })),
exit: (0, _glamor.css)(_extends({}, animate, { animationName: exitAnimation }))
};
};
function DefaultTransition(_ref) {
var children = _ref.children,
position = _ref.position,
props = _objectWithoutProperties(_ref, ['children', 'position']);
var _animation = animation(position),
enter = _animation.enter,
exit = _animation.exit;
return _react2.default.createElement(
_Transition2.default,
_extends({}, props, {
timeout: 750,
onEnter: function onEnter(node) {
return node.classList.add(enter);
},
onEntered: function onEntered(node) {
return node.classList.remove(enter);
},
onExit: function onExit(node) {
return node.classList.add(exit);
}
}),
children
);
}
exports.default = DefaultTransition;

View File

@@ -0,0 +1,99 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _glamor = require('glamor');
var _constant = require('./constant');
var _style = require('./style');
var _style2 = _interopRequireDefault(_style);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var trackProgress = _glamor.css.keyframes('track-progress', {
'0%': { width: '100%' },
'100%': { width: 0 }
});
var progress = function progress(type, isRunning, hide, delay) {
return (0, _glamor.css)(_extends({
position: 'absolute',
bottom: 0,
left: 0,
width: 0,
height: '5px',
zIndex: _style2.default.zIndex,
opacity: hide ? 0 : 0.7,
animation: trackProgress + ' linear 1',
animationPlayState: isRunning ? 'running' : 'paused',
animationDuration: delay + 'ms',
backgroundColor: 'rgba(255,255,255,.7)'
}, type === 'default' ? { background: _style2.default.colorProgressDefault } : {}));
};
function ProgressBar(_ref) {
var delay = _ref.delay,
isRunning = _ref.isRunning,
closeToast = _ref.closeToast,
type = _ref.type,
hide = _ref.hide,
className = _ref.className;
return _react2.default.createElement('div', _extends({}, typeof className !== 'string' ? (0, _glamor.css)(progress(type, isRunning, hide, delay), className) : progress(type, isRunning, hide, delay), typeof className === 'string' && { className: className }, {
onAnimationEnd: closeToast
}));
}
ProgressBar.propTypes = {
/**
* The animation delay which determine when to close the toast
*/
delay: _propTypes2.default.number.isRequired,
/**
* Whether or not the animation is running or paused
*/
isRunning: _propTypes2.default.bool.isRequired,
/**
* Func to close the current toast
*/
closeToast: _propTypes2.default.func.isRequired,
/**
* Optional type : info, success ...
*/
type: _propTypes2.default.string,
/**
* Hide or not the progress bar
*/
hide: _propTypes2.default.bool,
/**
* Optionnal className
*/
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object])
};
ProgressBar.defaultProps = {
type: _constant.TYPE.DEFAULT,
hide: false,
className: ''
};
exports.default = ProgressBar;

217
goTorrentWebUI/node_modules/react-toastify/lib/Toast.js generated vendored Normal file
View File

@@ -0,0 +1,217 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _glamor = require('glamor');
var _ProgressBar = require('./ProgressBar');
var _ProgressBar2 = _interopRequireDefault(_ProgressBar);
var _constant = require('./constant');
var _style = require('./style');
var _style2 = _interopRequireDefault(_style);
var _propValidator = require('./util/propValidator');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var toast = function toast(type) {
return (0, _glamor.css)(_extends({
position: 'relative',
minHeight: '48px',
marginBottom: '1rem',
padding: '8px',
borderRadius: '1px',
boxShadow: '0 1px 10px 0 rgba(0, 0, 0, .1), 0 2px 15px 0 rgba(0, 0, 0, .05)',
display: 'flex',
justifyContent: 'space-between',
maxHeight: '800px',
overflow: 'hidden',
fontFamily: _style2.default.fontFamily,
cursor: 'pointer',
background: _style2.default['color' + type.charAt(0).toUpperCase() + type.slice(1)]
}, type === 'default' ? { color: '#aaa' } : {}, _defineProperty({}, '@media ' + _style2.default.mobile, {
marginBottom: 0
})));
};
var body = (0, _glamor.css)({
margin: 'auto 0',
flex: 1
});
var Toast = function (_Component) {
_inherits(Toast, _Component);
function Toast() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, Toast);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Toast.__proto__ || Object.getPrototypeOf(Toast)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
isRunning: true
}, _this.pauseToast = function () {
_this.setState({ isRunning: false });
}, _this.playToast = function () {
_this.setState({ isRunning: true });
}, _temp), _possibleConstructorReturn(_this, _ret);
}
_createClass(Toast, [{
key: 'componentDidMount',
value: function componentDidMount() {
this.props.onOpen !== null && this.props.onOpen(this.getChildrenProps());
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
if (this.props.isDocumentHidden !== nextProps.isDocumentHidden) {
this.setState({
isRunning: !nextProps.isDocumentHidden
});
}
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.props.onClose !== null && this.props.onClose(this.getChildrenProps());
}
}, {
key: 'getChildrenProps',
value: function getChildrenProps() {
return this.props.children.props;
}
}, {
key: 'getToastProps',
value: function getToastProps() {
var toastProps = {};
if (this.props.autoClose !== false && this.props.pauseOnHover === true) {
toastProps.onMouseEnter = this.pauseToast;
toastProps.onMouseLeave = this.playToast;
}
typeof this.props.className === 'string' && (toastProps.className = this.props.className);
this.props.closeOnClick && (toastProps.onClick = this.props.closeToast);
return toastProps;
}
}, {
key: 'render',
value: function render() {
var _props = this.props,
closeButton = _props.closeButton,
children = _props.children,
autoClose = _props.autoClose,
type = _props.type,
hideProgressBar = _props.hideProgressBar,
closeToast = _props.closeToast,
Transition = _props.transition,
position = _props.position,
onExited = _props.onExited,
className = _props.className,
bodyClassName = _props.bodyClassName,
progressClassName = _props.progressClassName,
updateId = _props.updateId;
return _react2.default.createElement(
Transition,
{
'in': this.props.in,
appear: true,
unmountOnExit: true,
onExited: onExited,
position: position
},
_react2.default.createElement(
'div',
_extends({}, typeof className !== 'string' ? (0, _glamor.css)(toast(type), className) : toast(type), this.getToastProps()),
_react2.default.createElement(
'div',
_extends({}, typeof bodyClassName !== 'string' ? (0, _glamor.css)(body, bodyClassName) : body, typeof bodyClassName === 'string' && {
className: bodyClassName
}),
children
),
closeButton !== false && closeButton,
autoClose !== false && _react2.default.createElement(_ProgressBar2.default, {
key: 'pb-' + updateId,
delay: autoClose,
isRunning: this.state.isRunning,
closeToast: closeToast,
hide: hideProgressBar,
type: type,
className: progressClassName
})
)
);
}
}]);
return Toast;
}(_react.Component);
Toast.propTypes = {
closeButton: _propValidator.falseOrElement.isRequired,
autoClose: _propValidator.falseOrDelay.isRequired,
children: _propTypes2.default.node.isRequired,
closeToast: _propTypes2.default.func.isRequired,
position: _propTypes2.default.oneOf((0, _propValidator.objectValues)(_constant.POSITION)).isRequired,
pauseOnHover: _propTypes2.default.bool.isRequired,
closeOnClick: _propTypes2.default.bool.isRequired,
transition: _propTypes2.default.func.isRequired,
isDocumentHidden: _propTypes2.default.bool.isRequired,
in: _propTypes2.default.bool,
onExited: _propTypes2.default.func,
hideProgressBar: _propTypes2.default.bool,
onOpen: _propTypes2.default.func,
onClose: _propTypes2.default.func,
type: _propTypes2.default.oneOf((0, _propValidator.objectValues)(_constant.TYPE)),
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
bodyClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
progressClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
updateId: _propTypes2.default.number
};
Toast.defaultProps = {
type: _constant.TYPE.DEFAULT,
in: true,
hideProgressBar: false,
onOpen: null,
onClose: null,
className: '',
bodyClassName: '',
progressClassName: '',
updateId: null
};
exports.default = Toast;

View File

@@ -0,0 +1,399 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _react = require('react');
var _react2 = _interopRequireDefault(_react);
var _propTypes = require('prop-types');
var _propTypes2 = _interopRequireDefault(_propTypes);
var _glamor = require('glamor');
var _TransitionGroup = require('react-transition-group/TransitionGroup');
var _TransitionGroup2 = _interopRequireDefault(_TransitionGroup);
var _Toast = require('./Toast');
var _Toast2 = _interopRequireDefault(_Toast);
var _DefaultCloseButton = require('./DefaultCloseButton');
var _DefaultCloseButton2 = _interopRequireDefault(_DefaultCloseButton);
var _DefaultTransition = require('./DefaultTransition');
var _DefaultTransition2 = _interopRequireDefault(_DefaultTransition);
var _constant = require('./constant');
var _style = require('./style');
var _style2 = _interopRequireDefault(_style);
var _EventManager = require('./util/EventManager');
var _EventManager2 = _interopRequireDefault(_EventManager);
var _propValidator = require('./util/propValidator');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
var toastPosition = function toastPosition(pos) {
var positionKey = pos.toUpperCase().replace('-', '_');
var positionRule = typeof _constant.POSITION[positionKey] !== 'undefined' ? _style2.default[positionKey] : _style2.default.TOP_RIGHT;
/** define margin for center toast based on toast witdh */
if (positionKey.indexOf('CENTER') !== -1 && typeof positionRule.marginLeft === 'undefined') {
positionRule.marginLeft = '-' + parseInt(_style2.default.width, 10) / 2 + 'px';
}
return (0, _glamor.css)(positionRule, (0, _glamor.css)(_defineProperty({}, '@media ' + _style2.default.mobile, _extends({
left: 0,
margin: 0,
position: 'fixed'
}, pos.substring(0, 3) === 'top' ? { top: 0 } : { bottom: 0 }))));
};
var container = function container(disablePointer, position) {
return (0, _glamor.css)(_extends({
zIndex: _style2.default.zIndex,
position: 'fixed',
padding: '4px',
width: _style2.default.width,
boxSizing: 'border-box',
color: '#fff'
}, disablePointer ? { pointerEvents: 'none' } : {}, _defineProperty({}, '@media ' + _style2.default.mobile, {
width: '100vw',
padding: 0
})), toastPosition(position));
};
var ToastContainer = function (_Component) {
_inherits(ToastContainer, _Component);
function ToastContainer() {
var _ref;
var _temp, _this, _ret;
_classCallCheck(this, ToastContainer);
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ToastContainer.__proto__ || Object.getPrototypeOf(ToastContainer)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
toast: [],
isDocumentHidden: false
}, _this.collection = {}, _this.isDocumentHidden = function () {
return _this.setState({ isDocumentHidden: document.hidden });
}, _this.isToastActive = function (id) {
return _this.state.toast.indexOf(parseInt(id, 10)) !== -1;
}, _temp), _possibleConstructorReturn(_this, _ret);
}
/**
* Hold toast ids
*/
/**
* Hold toast's informations:
* - what to render
* - position
* - raw content
* - options
*/
_createClass(ToastContainer, [{
key: 'componentDidMount',
value: function componentDidMount() {
var _this2 = this;
var SHOW = _constant.ACTION.SHOW,
CLEAR = _constant.ACTION.CLEAR,
MOUNTED = _constant.ACTION.MOUNTED;
_EventManager2.default.on(SHOW, function (content, options) {
return _this2.show(content, options);
}).on(CLEAR, function (id) {
return id !== null ? _this2.removeToast(id) : _this2.clear();
}).emit(MOUNTED, this);
document.addEventListener('visibilitychange', this.isDocumentHidden);
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
_EventManager2.default.off(_constant.ACTION.SHOW);
_EventManager2.default.off(_constant.ACTION.CLEAR);
document.removeEventListener('visibilitychange', this.isDocumentHidden);
}
}, {
key: 'removeToast',
value: function removeToast(id) {
this.setState({
toast: this.state.toast.filter(function (v) {
return v !== parseInt(id, 10);
})
});
}
}, {
key: 'makeCloseButton',
value: function makeCloseButton(toastClose, toastId, type) {
var _this3 = this;
var closeButton = this.props.closeButton;
if ((0, _react.isValidElement)(toastClose) || toastClose === false) {
closeButton = toastClose;
}
return closeButton === false ? false : (0, _react.cloneElement)(closeButton, {
closeToast: function closeToast() {
return _this3.removeToast(toastId);
},
type: type
});
}
}, {
key: 'getAutoCloseDelay',
value: function getAutoCloseDelay(toastAutoClose) {
return toastAutoClose === false || (0, _propValidator.isValidDelay)(toastAutoClose) ? toastAutoClose : this.props.autoClose;
}
}, {
key: 'isFunction',
value: function isFunction(object) {
return !!(object && object.constructor && object.call && object.apply);
}
}, {
key: 'canBeRendered',
value: function canBeRendered(content) {
return (0, _react.isValidElement)(content) || typeof content === 'string' || typeof content === 'number' || this.isFunction(content);
}
}, {
key: 'show',
value: function show(content, options) {
var _this4 = this;
if (!this.canBeRendered(content)) {
throw new Error('The element you provided cannot be rendered. You provided an element of type ' + (typeof content === 'undefined' ? 'undefined' : _typeof(content)));
}
var toastId = options.toastId;
var closeToast = function closeToast() {
return _this4.removeToast(toastId);
};
var toastOptions = {
id: toastId,
type: options.type,
closeToast: closeToast,
updateId: options.updateId,
position: options.position || this.props.position,
transition: options.transition || this.props.transition,
className: options.className || this.props.toastClassName,
bodyClassName: options.bodyClassName || this.props.bodyClassName,
closeButton: this.makeCloseButton(options.closeButton, toastId, options.type),
pauseOnHover: options.pauseOnHover !== null ? options.pauseOnHover : this.props.pauseOnHover,
closeOnClick: options.closeOnClick !== null ? options.closeOnClick : this.props.closeOnClick,
progressClassName: options.progressClassName || this.props.progressClassName,
autoClose: this.getAutoCloseDelay(options.autoClose !== false ? parseInt(options.autoClose, 10) : options.autoClose),
hideProgressBar: typeof options.hideProgressBar === 'boolean' ? options.hideProgressBar : this.props.hideProgressBar
};
this.isFunction(options.onOpen) && (toastOptions.onOpen = options.onOpen);
this.isFunction(options.onClose) && (toastOptions.onClose = options.onClose);
/**
* add closeToast function to react component only
*/
if ((0, _react.isValidElement)(content) && typeof content.type !== 'string' && typeof content.type !== 'number') {
content = (0, _react.cloneElement)(content, {
closeToast: closeToast
});
} else if (this.isFunction(content)) {
content = content({ closeToast: closeToast });
}
this.collection = _extends({}, this.collection, _defineProperty({}, toastId, {
position: toastOptions.position,
options: toastOptions,
content: content
}));
this.setState({
toast: toastOptions.updateId !== null ? [].concat(_toConsumableArray(this.state.toast)) : [].concat(_toConsumableArray(this.state.toast), [toastId])
});
}
}, {
key: 'makeToast',
value: function makeToast(content, options) {
return _react2.default.createElement(
_Toast2.default,
_extends({}, options, {
isDocumentHidden: this.state.isDocumentHidden,
key: 'toast-' + options.id
}),
content
);
}
}, {
key: 'clear',
value: function clear() {
this.setState({ toast: [] });
}
}, {
key: 'renderToast',
value: function renderToast() {
var _this5 = this;
var toastToRender = {};
var _props = this.props,
className = _props.className,
style = _props.style,
newestOnTop = _props.newestOnTop;
var collection = newestOnTop ? Object.keys(this.collection).reverse() : Object.keys(this.collection);
collection.forEach(function (toastId) {
var item = _this5.collection[toastId];
toastToRender[item.position] || (toastToRender[item.position] = []);
if (_this5.state.toast.indexOf(parseInt(toastId, 10)) !== -1) {
toastToRender[item.position].push(_this5.makeToast(item.content, item.options));
} else {
toastToRender[item.position].push(null);
delete _this5.collection[toastId];
}
});
return Object.keys(toastToRender).map(function (position) {
var disablePointer = toastToRender[position].length === 1 && toastToRender[position][0] === null;
return _react2.default.createElement(
_TransitionGroup2.default,
_extends({}, typeof className !== 'string' ? (0, _glamor.css)(container(disablePointer, position), className) : container(disablePointer, position), typeof className === 'string' && { className: className }, style !== null && { style: style }, {
key: 'container-' + position
}),
toastToRender[position]
);
});
}
}, {
key: 'render',
value: function render() {
return _react2.default.createElement(
'div',
null,
this.renderToast()
);
}
}]);
return ToastContainer;
}(_react.Component);
ToastContainer.propTypes = {
/**
* Set toast position
*/
position: _propTypes2.default.oneOf((0, _propValidator.objectValues)(_constant.POSITION)),
/**
* Disable or set autoClose delay
*/
autoClose: _propValidator.falseOrDelay,
/**
* Disable or set a custom react element for the close button
*/
closeButton: _propValidator.falseOrElement,
/**
* Hide or not progress bar when autoClose is enabled
*/
hideProgressBar: _propTypes2.default.bool,
/**
* Pause toast duration on hover
*/
pauseOnHover: _propTypes2.default.bool,
/**
* Dismiss toast on click
*/
closeOnClick: _propTypes2.default.bool,
/**
* Newest on top
*/
newestOnTop: _propTypes2.default.bool,
/**
* An optional className
*/
className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
/**
* An optional style
*/
style: _propTypes2.default.object,
/**
* An optional className for the toast
*/
toastClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
/**
* An optional className for the toast body
*/
bodyClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
/**
* An optional className for the toast progress bar
*/
progressClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
/**
* Define enter and exit transition using react-transition-group
*/
transition: _propTypes2.default.func
};
ToastContainer.defaultProps = {
position: _constant.POSITION.TOP_RIGHT,
transition: _DefaultTransition2.default,
autoClose: 5000,
hideProgressBar: false,
closeButton: _react2.default.createElement(_DefaultCloseButton2.default, null),
pauseOnHover: true,
closeOnClick: true,
newestOnTop: false,
className: null,
style: null,
toastClassName: '',
bodyClassName: '',
progressClassName: ''
};
exports.default = ToastContainer;

View File

@@ -0,0 +1,150 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getAnimation;
var _constant = require('./constant');
function getAnimation(pos) {
switch (pos) {
case _constant.POSITION.TOP_RIGHT:
case _constant.POSITION.BOTTOM_RIGHT:
default:
return {
enter: {
from: {
opacity: 0,
transform: 'translate3d(3000px, 0, 0)'
},
'60%': {
opacity: 1,
transform: 'translate3d(-25px, 0, 0)'
},
'75%': {
transform: 'translate3d(10px, 0, 0)'
},
'90%': {
transform: 'translate3d(-5px, 0, 0)'
},
to: {
transform: 'none'
}
},
exit: {
'20%': {
opacity: 1,
transform: 'translate3d(-20px, 0, 0)'
},
to: {
opacity: 0,
transform: 'translate3d(2000px, 0, 0)'
}
}
};
case _constant.POSITION.TOP_LEFT:
case _constant.POSITION.BOTTOM_LEFT:
return {
enter: {
'0%': {
opacity: 0,
transform: 'translate3d(-3000px, 0, 0)'
},
'60%': {
opacity: 1,
transform: 'translate3d(25px, 0, 0)'
},
'75%': {
transform: 'translate3d(-10px, 0, 0)'
},
'90%': {
transform: 'translate3d(5px, 0, 0)'
},
to: {
transform: 'none'
}
},
exit: {
'20%': {
opacity: 1,
transform: 'translate3d(20px, 0, 0)'
},
to: {
opacity: 0,
transform: 'translate3d(-2000px, 0, 0)'
}
}
};
case _constant.POSITION.BOTTOM_CENTER:
return {
enter: {
from: {
opacity: 0,
transform: 'translate3d(0, 3000px, 0)'
},
'60%': {
opacity: 1,
transform: 'translate3d(0, -20px, 0)'
},
'75%': {
transform: 'translate3d(0, 10px, 0)'
},
'90%': {
transform: 'translate3d(0, -5px, 0)'
},
to: {
transform: 'translate3d(0, 0, 0)'
}
},
exit: {
'20%': {
transform: 'translate3d(0, 10px, 0)'
},
'40%, 45%': {
opacity: 1,
transform: 'translate3d(0, -20px, 0)'
},
to: {
opacity: 0,
transform: 'translate3d(0, 2000px, 0)'
}
}
};
case _constant.POSITION.TOP_CENTER:
return {
enter: {
'0%': {
opacity: 0,
transform: 'translate3d(0, -3000px, 0)'
},
'60%': {
opacity: 1,
transform: 'translate3d(0, 25px, 0)'
},
'75%': {
transform: 'translate3d(0, -10px, 0)'
},
'90%': {
transform: 'translate3d(0, 5px, 0)'
},
to: {
transform: 'none'
}
},
exit: {
'20%': {
transform: 'translate3d(0, -10px, 0)'
},
'40%, 45%': {
opacity: 1,
transform: 'translate3d(0, 20px, 0)'
},
to: {
opacity: 0,
transform: 'translate3d(0, -2000px, 0)'
}
}
};
}
}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
width: "320px",
background: "#ffffff",
fontColor: "#999",
fontSize: "13px",
colorDefault: "#fff",
colorInfo: "#3498db",
colorSuccess: "#07bc0c",
colorWarning: "#f1c40f",
colorError: "#e74c3c",
colorProgressDefault: "linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)",
smartphonePortrait: "only screen and (max-width : 480px)"
};

View File

@@ -0,0 +1,26 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var POSITION = exports.POSITION = {
TOP_LEFT: 'top-left',
TOP_RIGHT: 'top-right',
TOP_CENTER: 'top-center',
BOTTOM_LEFT: 'bottom-left',
BOTTOM_RIGHT: 'bottom-right',
BOTTOM_CENTER: 'bottom-center'
};
var TYPE = exports.TYPE = {
INFO: 'info',
SUCCESS: 'success',
WARNING: 'warning',
ERROR: 'error',
DEFAULT: 'default'
};
var ACTION = exports.ACTION = {
SHOW: 'SHOW_TOAST',
CLEAR: 'CLEAR_TOAST',
MOUNTED: 'CONTAINER_MOUNTED'
};

View File

@@ -0,0 +1,22 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.style = exports.toast = exports.ToastContainer = undefined;
var _ToastContainer = require('./ToastContainer');
var _ToastContainer2 = _interopRequireDefault(_ToastContainer);
var _toaster = require('./toaster');
var _toaster2 = _interopRequireDefault(_toaster);
var _style = require('./style');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.ToastContainer = _ToastContainer2.default;
exports.toast = _toaster2.default;
exports.style = _style.defineStyle;

View File

@@ -0,0 +1,50 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.defineStyle = defineStyle;
var style = {
width: '320px',
colorDefault: '#fff',
colorInfo: '#3498db',
colorSuccess: '#07bc0c',
colorWarning: '#f1c40f',
colorError: '#e74c3c',
colorProgressDefault: 'linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55)',
mobile: 'only screen and (max-width : 480px)',
fontFamily: 'sans-serif',
zIndex: 9999,
TOP_LEFT: {
top: '1em',
left: '1em'
},
TOP_CENTER: {
top: '1em',
left: '50%'
},
TOP_RIGHT: {
top: '1em',
right: '1em'
},
BOTTOM_LEFT: {
bottom: '1em',
left: '1em'
},
BOTTOM_CENTER: {
bottom: '1em',
left: '50%'
},
BOTTOM_RIGHT: {
bottom: '1em',
right: '1em'
}
};
function defineStyle(props) {
for (var prop in props) {
style[prop] = props[prop];
}
}
exports.default = style;

View File

@@ -0,0 +1,129 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _EventManager = require('./util/EventManager');
var _EventManager2 = _interopRequireDefault(_EventManager);
var _constant = require('./constant');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var defaultOptions = {
type: _constant.TYPE.DEFAULT,
autoClose: null,
closeButton: null,
hideProgressBar: null,
position: null,
pauseOnHover: null,
closeOnClick: null,
className: null,
bodyClassName: null,
progressClassName: null,
transition: null,
updateId: null
};
var container = null;
var queue = [];
var toastId = 0;
/**
* Merge provided options with the defaults settings and generate the toastId
* @param {*} options
*/
function mergeOptions(options, type) {
return _extends({}, defaultOptions, options, {
type: type,
toastId: ++toastId
});
}
/**
* Dispatch toast. If the container is not mounted, the toast is enqueued
* @param {*} content
* @param {*} options
*/
function emitEvent(content, options) {
if (container !== null) {
_EventManager2.default.emit(_constant.ACTION.SHOW, content, options);
} else {
queue.push({ action: _constant.ACTION.SHOW, content: content, options: options });
}
return options.toastId;
}
var toaster = _extends(function (content, options) {
return emitEvent(content, mergeOptions(options, options && options.type || _constant.TYPE.DEFAULT));
}, {
success: function success(content, options) {
return emitEvent(content, mergeOptions(options, _constant.TYPE.SUCCESS));
},
info: function info(content, options) {
return emitEvent(content, mergeOptions(options, _constant.TYPE.INFO));
},
warn: function warn(content, options) {
return emitEvent(content, mergeOptions(options, _constant.TYPE.WARNING));
},
warning: function warning(content, options) {
return emitEvent(content, mergeOptions(options, _constant.TYPE.WARNING));
},
error: function error(content, options) {
return emitEvent(content, mergeOptions(options, _constant.TYPE.ERROR));
},
dismiss: function dismiss() {
var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
return container && _EventManager2.default.emit(_constant.ACTION.CLEAR, id);
},
isActive: function isActive() {
return false;
},
update: function update(id, options) {
if (container && typeof container.collection[id] !== 'undefined') {
var _container$collection = container.collection[id],
oldOptions = _container$collection.options,
oldContent = _container$collection.content;
var updateId = oldOptions.updateId !== null ? oldOptions.updateId + 1 : 1;
var nextOptions = _extends({}, oldOptions, options, {
toastId: id,
updateId: updateId
});
var content = typeof nextOptions.render !== 'undefined' ? nextOptions.render : oldContent;
delete nextOptions.render;
return emitEvent(content, nextOptions);
}
return false;
}
}, {
POSITION: _constant.POSITION,
TYPE: _constant.TYPE
});
/**
* Wait until the ToastContainer is mounted to dispatch the toast
* and attach isActive method
*/
_EventManager2.default.on(_constant.ACTION.MOUNTED, function (containerInstance) {
container = containerInstance;
toaster.isActive = function (id) {
return container.isToastActive(id);
};
queue.forEach(function (item) {
_EventManager2.default.emit(item.action, item.content, item.options);
});
queue = [];
});
exports.default = toaster;

View File

@@ -0,0 +1,47 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
var eventManager = {
eventList: new Map(),
on: function on(event, callback) {
this.eventList.has(event) || this.eventList.set(event, []);
this.eventList.get(event).push(callback);
return this;
},
off: function off() {
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
return this.eventList.delete(event);
},
emit: function emit(event) {
var _this = this;
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (!this.eventList.has(event)) {
/* eslint no-console: 0 */
console.warn("<" + event + "> Event is not registered. Did you forgot to bind the event ?");
return false;
}
this.eventList.get(event).forEach(function (callback) {
return setTimeout(function () {
return callback.call.apply(callback, [_this].concat(_toConsumableArray(args)));
}, 0);
});
return true;
}
};
exports.default = eventManager;

View File

@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
};

View File

@@ -0,0 +1,53 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.falseOrElement = exports.falseOrDelay = undefined;
exports.isValidDelay = isValidDelay;
exports.objectValues = objectValues;
var _react = require('react');
function isValidDelay(val) {
return typeof val === 'number' && !isNaN(val) && val > 0;
}
function objectValues(obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
}
function withRequired(fn) {
fn.isRequired = function (props, propName, componentName) {
var prop = props[propName];
if (typeof prop === 'undefined') {
return new Error('The prop ' + propName + ' is marked as required in \n ' + componentName + ', but its value is undefined.');
}
fn(props, propName, componentName);
};
return fn;
}
var falseOrDelay = exports.falseOrDelay = withRequired(function (props, propName, componentName) {
var prop = props[propName];
if (prop !== false && !isValidDelay(prop)) {
return new Error(componentName + ' expect ' + propName + ' \n to be a valid Number > 0 or equal to false. ' + prop + ' given.');
}
return null;
});
var falseOrElement = exports.falseOrElement = withRequired(function (props, propName, componentName) {
var prop = props[propName];
if (prop !== false && !(0, _react.isValidElement)(prop)) {
return new Error(componentName + ' expect ' + propName + ' \n to be a valid react element or equal to false. ' + prop + ' given.');
}
return null;
});

View File

@@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../loose-envify/cli.js" "$@"
ret=$?
else
node "$basedir/../loose-envify/cli.js" "$@"
ret=$?
fi
exit $ret

View File

@@ -0,0 +1,7 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\loose-envify\cli.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\loose-envify\cli.js" %*
)

View File

@@ -0,0 +1,70 @@
## 2.0.6
Version 2.0.4 adds support for React Native by clarifying in package.json that
the browser environment does not support Node.js domains.
Why this is necessary, we leave as an exercise for the user.
## 2.0.3
Version 2.0.3 fixes a bug when adjusting the capacity of the task queue.
## 2.0.1-2.02
Version 2.0.1 fixes a bug in the way redirects were expressed that affected the
function of Browserify, but which Mr would tolerate.
## 2.0.0
Version 2 of ASAP is a full rewrite with a few salient changes.
First, the ASAP source is CommonJS only and designed with [Browserify][] and
[Browserify-compatible][Mr] module loaders in mind.
[Browserify]: https://github.com/substack/node-browserify
[Mr]: https://github.com/montagejs/mr
The new version has been refactored in two dimensions.
Support for Node.js and browsers have been separated, using Browserify
redirects and ASAP has been divided into two modules.
The "raw" layer depends on the tasks to catch thrown exceptions and unravel
Node.js domains.
The full implementation of ASAP is loadable as `require("asap")` in both Node.js
and browsers.
The raw layer that lacks exception handling overhead is loadable as
`require("asap/raw")`.
The interface is the same for both layers.
Tasks are no longer required to be functions, but can rather be any object that
implements `task.call()`.
With this feature you can recycle task objects to avoid garbage collector churn
and avoid closures in general.
The implementation has been rigorously documented so that our successors can
understand the scope of the problem that this module solves and all of its
nuances, ensuring that the next generation of implementations know what details
are essential.
- [asap.js](https://github.com/kriskowal/asap/blob/master/asap.js)
- [raw.js](https://github.com/kriskowal/asap/blob/master/raw.js)
- [browser-asap.js](https://github.com/kriskowal/asap/blob/master/browser-asap.js)
- [browser-raw.js](https://github.com/kriskowal/asap/blob/master/browser-raw.js)
The new version has also been rigorously tested across a broad spectrum of
browsers, in both the window and worker context.
The following charts capture the browser test results for the most recent
release.
The first chart shows test results for ASAP running in the main window context.
The second chart shows test results for ASAP running in a web worker context.
Test results are inconclusive (grey) on browsers that do not support web
workers.
These data are captured automatically by [Continuous
Integration][].
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md

View File

@@ -0,0 +1,21 @@
Copyright 20092014 Contributors. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

View File

@@ -0,0 +1,237 @@
# ASAP
[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)
Promise and asynchronous observer libraries, as well as hand-rolled callback
programs and libraries, often need a mechanism to postpone the execution of a
callback until the next available event.
(See [Designing APIs for Asynchrony][Zalgo].)
The `asap` function executes a task **as soon as possible** but not before it
returns, waiting only for the completion of the current event and previously
scheduled tasks.
```javascript
asap(function () {
// ...
});
```
[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony
This CommonJS package provides an `asap` module that exports a function that
executes a task function *as soon as possible*.
ASAP strives to schedule events to occur before yielding for IO, reflow,
or redrawing.
Each event receives an independent stack, with only platform code in parent
frames and the events run in the order they are scheduled.
ASAP provides a fast event queue that will execute tasks until it is
empty before yielding to the JavaScript engine's underlying event-loop.
When a task gets added to a previously empty event queue, ASAP schedules a flush
event, preferring for that event to occur before the JavaScript engine has an
opportunity to perform IO tasks or rendering, thus making the first task and
subsequent tasks semantically indistinguishable.
ASAP uses a variety of techniques to preserve this invariant on different
versions of browsers and Node.js.
By design, ASAP prevents input events from being handled until the task
queue is empty.
If the process is busy enough, this may cause incoming connection requests to be
dropped, and may cause existing connections to inform the sender to reduce the
transmission rate or stall.
ASAP allows this on the theory that, if there is enough work to do, there is no
sense in looking for trouble.
As a consequence, ASAP can interfere with smooth animation.
If your task should be tied to the rendering loop, consider using
`requestAnimationFrame` instead.
A long sequence of tasks can also effect the long running script dialog.
If this is a problem, you may be able to use ASAPs cousin `setImmediate` to
break long processes into shorter intervals and periodically allow the browser
to breathe.
`setImmediate` will yield for IO, reflow, and repaint events.
It also returns a handler and can be canceled.
For a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].
[setImmediate]: https://github.com/YuzuJS/setImmediate
Take care.
ASAP can sustain infinite recursive calls without warning.
It will not halt from a stack overflow, and it will not consume unbounded
memory.
This is behaviorally equivalent to an infinite loop.
Just as with infinite loops, you can monitor a Node.js process for this behavior
with a heart-beat signal.
As with infinite loops, a very small amount of caution goes a long way to
avoiding problems.
```javascript
function loop() {
asap(loop);
}
loop();
```
In browsers, if a task throws an exception, it will not interrupt the flushing
of high-priority tasks.
The exception will be postponed to a later, low-priority event to avoid
slow-downs.
In Node.js, if a task throws an exception, ASAP will resume flushing only if—and
only after—the error is handled by `domain.on("error")` or
`process.on("uncaughtException")`.
## Raw ASAP
Checking for exceptions comes at a cost.
The package also provides an `asap/raw` module that exports the underlying
implementation which is faster but stalls if a task throws an exception.
This internal version of the ASAP function does not check for errors.
If a task does throw an error, it will stall the event queue unless you manually
call `rawAsap.requestFlush()` before throwing the error, or any time after.
In Node.js, `asap/raw` also runs all tasks outside any domain.
If you need a task to be bound to your domain, you will have to do it manually.
```js
if (process.domain) {
task = process.domain.bind(task);
}
rawAsap(task);
```
## Tasks
A task may be any object that implements `call()`.
A function will suffice, but closures tend not to be reusable and can cause
garbage collector churn.
Both `asap` and `rawAsap` accept task objects to give you the option of
recycling task objects or using higher callable object abstractions.
See the `asap` source for an illustration.
## Compatibility
ASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.
The following charts capture the browser test results for the most recent
release.
The first chart shows test results for ASAP running in the main window context.
The second chart shows test results for ASAP running in a web worker context.
Test results are inconclusive (grey) on browsers that do not support web
workers.
These data are captured automatically by [Continuous
Integration][].
[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md
![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)
![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)
## Caveats
When a task is added to an empty event queue, it is not always possible to
guarantee that the task queue will begin flushing immediately after the current
event.
However, once the task queue begins flushing, it will not yield until the queue
is empty, even if the queue grows while executing tasks.
The following browsers allow the use of [DOM mutation observers][] to access
the HTML [microtask queue][], and thus begin flushing ASAP's task queue
immediately at the end of the current event loop turn, before any rendering or
IO:
[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue
[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers
- Android 44.3
- Chrome 2634
- Firefox 1429
- Internet Explorer 11
- iPad Safari 67.1
- iPhone Safari 77.1
- Safari 67
In the absense of mutation observers, there are a few browsers, and situations
like web workers in some of the above browsers, where [message channels][]
would be a useful way to avoid falling back to timers.
Message channels give direct access to the HTML [task queue][], so the ASAP
task queue would flush after any already queued rendering and IO tasks, but
without having the minimum delay imposed by timers.
However, among these browsers, Internet Explorer 10 and Safari do not reliably
dispatch messages, so they are not worth the trouble to implement.
[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels
[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task
- Internet Explorer 10
- Safair 5.0-1
- Opera 11-12
In the absense of mutation observers, these browsers and the following browsers
all fall back to using `setTimeout` and `setInterval` to ensure that a `flush`
occurs.
The implementation uses both and cancels whatever handler loses the race, since
`setTimeout` tends to occasionally skip tasks in unisolated circumstances.
Timers generally delay the flushing of ASAP's task queue for four milliseconds.
- Firefox 313
- Internet Explorer 610
- iPad Safari 4.3
- Lynx 2.8.7
## Heritage
ASAP has been factored out of the [Q][] asynchronous promise library.
It originally had a naïve implementation in terms of `setTimeout`, but
[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be
useful for creating a high-priority, no-delay event dispatch hack.
Since then, Internet Explorer proposed and implemented `setImmediate`.
Robert Katić began contributing to Q by measuring the performance of
the internal implementation of `asap`, paying particular attention to
error recovery.
Domenic, Robert, and Kris Kowal collectively settled on the current strategy of
unrolling the high-priority event queue internally regardless of what strategy
we used to dispatch the potentially lower-priority flush event.
Domenic went on to make ASAP cooperate with Node.js domains.
[Q]: https://github.com/kriskowal/q
[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html
For further reading, Nicholas Zakas provided a thorough article on [The
Case for setImmediate][NCZ].
[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/
Embers RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but
further developed the implentation.
Particularly, The `MessagePort` implementation was abandoned due to interaction
[problems with Mobile Internet Explorer][IE Problems] in favor of an
implementation backed on the newer and more reliable DOM `MutationObserver`
interface.
These changes were back-ported into this library.
[IE Problems]: https://github.com/cujojs/when/issues/197
[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js
In addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained
exception-safe, but `asap/raw` provided a tight kernel that could be used for
tasks that guaranteed that they would not throw exceptions.
This core is useful for promise implementations that capture thrown errors in
rejected promises and do not need a second safety net.
At the same time, the exception handling in `asap` was factored into separate
implementations for Node.js and browsers, using the the [Browserify][Browser
Config] `browser` property in `package.json` to instruct browser module loaders
and bundlers, including [Browserify][], [Mr][], and [Mop][], to use the
browser-only implementation.
[Browser Config]: https://gist.github.com/defunctzombie/4339901
[Browserify]: https://github.com/substack/node-browserify
[Mr]: https://github.com/montagejs/mr
[Mop]: https://github.com/montagejs/mop
## License
Copyright 2009-2014 by Contributors
MIT License (enclosed)

View File

@@ -0,0 +1,65 @@
"use strict";
var rawAsap = require("./raw");
var freeTasks = [];
/**
* Calls a task as soon as possible after returning, in its own event, with
* priority over IO events. An exception thrown in a task can be handled by
* `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
* crash the process. If the error is handled, all subsequent tasks will
* resume.
*
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
module.exports = asap;
function asap(task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawTask.domain = process.domain;
rawAsap(rawTask);
}
function RawTask() {
this.task = null;
this.domain = null;
}
RawTask.prototype.call = function () {
if (this.domain) {
this.domain.enter();
}
var threw = true;
try {
this.task.call();
threw = false;
// If the task throws an exception (presumably) Node.js restores the
// domain stack for the next event.
if (this.domain) {
this.domain.exit();
}
} finally {
// We use try/finally and a threw flag to avoid messing up stack traces
// when we catch and release errors.
if (threw) {
// In Node.js, uncaught exceptions are considered fatal errors.
// Re-throw them to interrupt flushing!
// Ensure that flushing continues if an uncaught exception is
// suppressed listening process.on("uncaughtException") or
// domain.on("error").
rawAsap.requestFlush();
}
// If the task threw an error, we do not want to exit the domain here.
// Exiting the domain would prevent the domain from catching the error.
this.task = null;
this.domain = null;
freeTasks.push(this);
}
};

View File

@@ -0,0 +1,66 @@
"use strict";
// rawAsap provides everything we need except exception management.
var rawAsap = require("./raw");
// RawTasks are recycled to reduce GC churn.
var freeTasks = [];
// We queue errors to ensure they are thrown in right order (FIFO).
// Array-as-queue is good enough here, since we are just dealing with exceptions.
var pendingErrors = [];
var requestErrorThrow = rawAsap.makeRequestCallFromTimer(throwFirstError);
function throwFirstError() {
if (pendingErrors.length) {
throw pendingErrors.shift();
}
}
/**
* Calls a task as soon as possible after returning, in its own event, with priority
* over other events like animation, reflow, and repaint. An error thrown from an
* event will not interrupt, nor even substantially slow down the processing of
* other events, but will be rather postponed to a lower priority event.
* @param {{call}} task A callable object, typically a function that takes no
* arguments.
*/
module.exports = asap;
function asap(task) {
var rawTask;
if (freeTasks.length) {
rawTask = freeTasks.pop();
} else {
rawTask = new RawTask();
}
rawTask.task = task;
rawAsap(rawTask);
}
// We wrap tasks with recyclable task objects. A task object implements
// `call`, just like a function.
function RawTask() {
this.task = null;
}
// The sole purpose of wrapping the task is to catch the exception and recycle
// the task object after its single use.
RawTask.prototype.call = function () {
try {
this.task.call();
} catch (error) {
if (asap.onerror) {
// This hook exists purely for testing purposes.
// Its name will be periodically randomized to break any code that
// depends on its existence.
asap.onerror(error);
} else {
// In a web browser, exceptions are not fatal. However, to avoid
// slowing down the queue of pending tasks, we rethrow the error in a
// lower priority turn.
pendingErrors.push(error);
requestErrorThrow();
}
} finally {
this.task = null;
freeTasks[freeTasks.length] = this;
}
};

View File

@@ -0,0 +1,223 @@
"use strict";
// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including IO, animation, reflow, and redraw
// events in browsers.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Equivalent to push, but avoids a function call.
queue[queue.length] = task;
}
var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// `requestFlush` is an implementation-specific method that attempts to kick
// off a `flush` event as quickly as possible. `flush` will attempt to exhaust
// the event queue before yielding to the browser's own event loop.
var requestFlush;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory exhaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;
// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
while (index < queue.length) {
var currentIndex = index;
// Advance the index before calling the task. This ensures that we will
// begin flushing on the next task the task throws an error.
index = index + 1;
queue[currentIndex].call();
// Prevent leaking memory for long chains of recursive calls to `asap`.
// If we call `asap` within tasks scheduled by `asap`, the queue will
// grow, but to avoid an O(n) walk for every task we execute, we don't
// shift tasks off the queue after they have been executed.
// Instead, we periodically shift 1024 tasks off the queue.
if (index > capacity) {
// Manually shift all values starting at the index back to the
// beginning of the queue.
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
queue[scan] = queue[scan + index];
}
queue.length -= index;
index = 0;
}
}
queue.length = 0;
index = 0;
flushing = false;
}
// `requestFlush` is implemented using a strategy based on data collected from
// every available SauceLabs Selenium web driver worker at time of writing.
// https://docs.google.com/spreadsheets/d/1mG-5UYGup5qxGdEMWkhP6BWCz053NUb2E1QoUTU16uA/edit#gid=783724593
// Safari 6 and 6.1 for desktop, iPad, and iPhone are the only browsers that
// have WebKitMutationObserver but not un-prefixed MutationObserver.
// Must use `global` or `self` instead of `window` to work in both frames and web
// workers. `global` is a provision of Browserify, Mr, Mrs, or Mop.
/* globals self */
var scope = typeof global !== "undefined" ? global : self;
var BrowserMutationObserver = scope.MutationObserver || scope.WebKitMutationObserver;
// MutationObservers are desirable because they have high priority and work
// reliably everywhere they are implemented.
// They are implemented in all modern browsers.
//
// - Android 4-4.3
// - Chrome 26-34
// - Firefox 14-29
// - Internet Explorer 11
// - iPad Safari 6-7.1
// - iPhone Safari 7-7.1
// - Safari 6-7
if (typeof BrowserMutationObserver === "function") {
requestFlush = makeRequestCallFromMutationObserver(flush);
// MessageChannels are desirable because they give direct access to the HTML
// task queue, are implemented in Internet Explorer 10, Safari 5.0-1, and Opera
// 11-12, and in web workers in many engines.
// Although message channels yield to any queued rendering and IO tasks, they
// would be better than imposing the 4ms delay of timers.
// However, they do not work reliably in Internet Explorer or Safari.
// Internet Explorer 10 is the only browser that has setImmediate but does
// not have MutationObservers.
// Although setImmediate yields to the browser's renderer, it would be
// preferrable to falling back to setTimeout since it does not have
// the minimum 4ms penalty.
// Unfortunately there appears to be a bug in Internet Explorer 10 Mobile (and
// Desktop to a lesser extent) that renders both setImmediate and
// MessageChannel useless for the purposes of ASAP.
// https://github.com/kriskowal/q/issues/396
// Timers are implemented universally.
// We fall back to timers in workers in most engines, and in foreground
// contexts in the following browsers.
// However, note that even this simple case requires nuances to operate in a
// broad spectrum of browsers.
//
// - Firefox 3-13
// - Internet Explorer 6-9
// - iPad Safari 4.3
// - Lynx 2.8.7
} else {
requestFlush = makeRequestCallFromTimer(flush);
}
// `requestFlush` requests that the high priority event queue be flushed as
// soon as possible.
// This is useful to prevent an error thrown in a task from stalling the event
// queue if the exception handled by Node.jss
// `process.on("uncaughtException")` or by a domain.
rawAsap.requestFlush = requestFlush;
// To request a high priority event, we induce a mutation observer by toggling
// the text of a text node between "1" and "-1".
function makeRequestCallFromMutationObserver(callback) {
var toggle = 1;
var observer = new BrowserMutationObserver(callback);
var node = document.createTextNode("");
observer.observe(node, {characterData: true});
return function requestCall() {
toggle = -toggle;
node.data = toggle;
};
}
// The message channel technique was discovered by Malte Ubl and was the
// original foundation for this library.
// http://www.nonblocking.io/2011/06/windownexttick.html
// Safari 6.0.5 (at least) intermittently fails to create message ports on a
// page's first load. Thankfully, this version of Safari supports
// MutationObservers, so we don't need to fall back in that case.
// function makeRequestCallFromMessageChannel(callback) {
// var channel = new MessageChannel();
// channel.port1.onmessage = callback;
// return function requestCall() {
// channel.port2.postMessage(0);
// };
// }
// For reasons explained above, we are also unable to use `setImmediate`
// under any circumstances.
// Even if we were, there is another bug in Internet Explorer 10.
// It is not sufficient to assign `setImmediate` to `requestFlush` because
// `setImmediate` must be called *by name* and therefore must be wrapped in a
// closure.
// Never forget.
// function makeRequestCallFromSetImmediate(callback) {
// return function requestCall() {
// setImmediate(callback);
// };
// }
// Safari 6.0 has a problem where timers will get lost while the user is
// scrolling. This problem does not impact ASAP because Safari 6.0 supports
// mutation observers, so that implementation is used instead.
// However, if we ever elect to use timers in Safari, the prevalent work-around
// is to add a scroll event listener that calls for a flush.
// `setTimeout` does not call the passed callback if the delay is less than
// approximately 7 in web workers in Firefox 8 through 18, and sometimes not
// even then.
function makeRequestCallFromTimer(callback) {
return function requestCall() {
// We dispatch a timeout with a specified delay of 0 for engines that
// can reliably accommodate that request. This will usually be snapped
// to a 4 milisecond delay, but once we're flushing, there's no delay
// between events.
var timeoutHandle = setTimeout(handleTimer, 0);
// However, since this timer gets frequently dropped in Firefox
// workers, we enlist an interval handle that will try to fire
// an event 20 times per second until it succeeds.
var intervalHandle = setInterval(handleTimer, 50);
function handleTimer() {
// Whichever timer succeeds will cancel both timers and
// execute the callback.
clearTimeout(timeoutHandle);
clearInterval(intervalHandle);
callback();
}
};
}
// This is for `asap.js` only.
// Its name will be periodically randomized to break any code that depends on
// its existence.
rawAsap.makeRequestCallFromTimer = makeRequestCallFromTimer;
// ASAP was originally a nextTick shim included in Q. This was factored out
// into this ASAP package. It was later adapted to RSVP which made further
// amendments. These decisions, particularly to marginalize MessageChannel and
// to capture the MutationObserver implementation in a closure, were integrated
// back into ASAP proper.
// https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js

View File

@@ -0,0 +1,87 @@
{
"_from": "asap@~2.0.3",
"_id": "asap@2.0.6",
"_inBundle": false,
"_integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"_location": "/react-toastify/asap",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "asap@~2.0.3",
"name": "asap",
"escapedName": "asap",
"rawSpec": "~2.0.3",
"saveSpec": null,
"fetchSpec": "~2.0.3"
},
"_requiredBy": [
"/react-toastify/promise"
],
"_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"_shasum": "e50347611d7e690943208bbdafebcbc2fb866d46",
"_spec": "asap@~2.0.3",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-toastify\\node_modules\\promise",
"browser": {
"./asap": "./browser-asap.js",
"./asap.js": "./browser-asap.js",
"./raw": "./browser-raw.js",
"./raw.js": "./browser-raw.js",
"./test/domain.js": "./test/browser-domain.js"
},
"bugs": {
"url": "https://github.com/kriskowal/asap/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "High-priority task queue for Node.js and browsers",
"devDependencies": {
"benchmark": "^1.0.0",
"events": "^1.0.1",
"jshint": "^2.5.1",
"knox": "^0.8.10",
"mr": "^2.0.5",
"opener": "^1.3.0",
"q": "^2.0.3",
"q-io": "^2.0.3",
"saucelabs": "^0.1.1",
"wd": "^0.2.21",
"weak-map": "^1.0.5"
},
"files": [
"raw.js",
"asap.js",
"browser-raw.js",
"browser-asap.js"
],
"homepage": "https://github.com/kriskowal/asap#readme",
"keywords": [
"event",
"task",
"queue"
],
"license": "MIT",
"main": "./asap.js",
"name": "asap",
"react-native": {
"domain": false
},
"repository": {
"type": "git",
"url": "git+https://github.com/kriskowal/asap.git"
},
"scripts": {
"benchmarks": "node benchmarks",
"lint": "jshint raw.js asap.js browser-raw.js browser-asap.js $(find scripts -name '*.js' | grep -v gauntlet)",
"test": "npm run lint && npm run test-node",
"test-browser": "node scripts/publish-bundle.js test/asap-test.js | xargs opener",
"test-node": "node test/asap-test.js",
"test-publish": "node scripts/publish-bundle.js test/asap-test.js | pbcopy",
"test-saucelabs": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-spot-configurations.json",
"test-saucelabs-all": "node scripts/saucelabs.js test/asap-test.js scripts/saucelabs-all-configurations.json",
"test-saucelabs-worker": "node scripts/saucelabs-worker-test.js scripts/saucelabs-spot-configurations.json",
"test-saucelabs-worker-all": "node scripts/saucelabs-worker-test.js scripts/saucelabs-all-configurations.json",
"test-travis": "npm run lint && npm run test-node && npm run test-saucelabs && npm run test-saucelabs-worker"
},
"version": "2.0.6"
}

View File

@@ -0,0 +1,101 @@
"use strict";
var domain; // The domain module is executed on demand
var hasSetImmediate = typeof setImmediate === "function";
// Use the fastest means possible to execute a task in its own turn, with
// priority over other events including network IO events in Node.js.
//
// An exception thrown by a task will permanently interrupt the processing of
// subsequent tasks. The higher level `asap` function ensures that if an
// exception is thrown by a task, that the task queue will continue flushing as
// soon as possible, but if you use `rawAsap` directly, you are responsible to
// either ensure that no exceptions are thrown from your task, or to manually
// call `rawAsap.requestFlush` if an exception is thrown.
module.exports = rawAsap;
function rawAsap(task) {
if (!queue.length) {
requestFlush();
flushing = true;
}
// Avoids a function call
queue[queue.length] = task;
}
var queue = [];
// Once a flush has been requested, no further calls to `requestFlush` are
// necessary until the next `flush` completes.
var flushing = false;
// The position of the next task to execute in the task queue. This is
// preserved between calls to `flush` so that it can be resumed if
// a task throws an exception.
var index = 0;
// If a task schedules additional tasks recursively, the task queue can grow
// unbounded. To prevent memory excaustion, the task queue will periodically
// truncate already-completed tasks.
var capacity = 1024;
// The flush function processes all tasks that have been scheduled with
// `rawAsap` unless and until one of those tasks throws an exception.
// If a task throws an exception, `flush` ensures that its state will remain
// consistent and will resume where it left off when called again.
// However, `flush` does not make any arrangements to be called again if an
// exception is thrown.
function flush() {
while (index < queue.length) {
var currentIndex = index;
// Advance the index before calling the task. This ensures that we will
// begin flushing on the next task the task throws an error.
index = index + 1;
queue[currentIndex].call();
// Prevent leaking memory for long chains of recursive calls to `asap`.
// If we call `asap` within tasks scheduled by `asap`, the queue will
// grow, but to avoid an O(n) walk for every task we execute, we don't
// shift tasks off the queue after they have been executed.
// Instead, we periodically shift 1024 tasks off the queue.
if (index > capacity) {
// Manually shift all values starting at the index back to the
// beginning of the queue.
for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
queue[scan] = queue[scan + index];
}
queue.length -= index;
index = 0;
}
}
queue.length = 0;
index = 0;
flushing = false;
}
rawAsap.requestFlush = requestFlush;
function requestFlush() {
// Ensure flushing is not bound to any domain.
// It is not sufficient to exit the domain, because domains exist on a stack.
// To execute code outside of any domain, the following dance is necessary.
var parentDomain = process.domain;
if (parentDomain) {
if (!domain) {
// Lazy execute the domain module.
// Only employed if the user elects to use domains.
domain = require("domain");
}
domain.active = process.domain = null;
}
// `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
// cannot handle recursion.
// `requestFlush` will only be called recursively from `asap.js`, to resume
// flushing after an error is thrown into a domain.
// Conveniently, `setImmediate` was introduced in the same version
// `process.nextTick` started throwing recursion errors.
if (flushing && hasSetImmediate) {
setImmediate(flush);
} else {
process.nextTick(flush);
}
if (parentDomain) {
domain.active = process.domain = parentDomain;
}
}

View File

@@ -0,0 +1,17 @@
root = true
[*]
end_of_line = lf
insert_final_newline = true
[{*.js,*.md}]
charset = utf-8
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2

View File

@@ -0,0 +1 @@
bowser

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="Eslint" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="ECMAScript 6" />
<excludedPredefinedLibrary name="HTML" />
<excludedPredefinedLibrary name="bowser/node_modules" />
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownExportedFiles">
<htmlFiles />
<imageFiles />
<otherFiles />
</component>
</project>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="MarkdownProjectSettings">
<PreviewSettings splitEditorLayout="FIRST" splitEditorPreview="NONE" useGrayscaleRendering="false" zoomFactor="1.0" maxImageWidth="0" showGitHubPageIfSynced="false" allowBrowsingInPreview="false" synchronizePreviewPosition="true" highlightPreviewType="LINE" highlightFadeOut="5" highlightOnTyping="true" synchronizeSourcePosition="true">
<PanelProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.panel" providerName="JavaFX WebView" />
</PanelProvider>
</PreviewSettings>
<ParserSettings>
<PegdownExtensions>
<option name="ABBREVIATIONS" value="false" />
<option name="ANCHORLINKS" value="true" />
<option name="ATXHEADERSPACE" value="false" />
<option name="AUTOLINKS" value="true" />
<option name="DEFINITIONS" value="true" />
<option name="FENCED_CODE_BLOCKS" value="true" />
<option name="FOOTNOTES" value="false" />
<option name="FORCELISTITEMPARA" value="false" />
<option name="HARDWRAPS" value="true" />
<option name="QUOTES" value="false" />
<option name="RELAXEDHRULES" value="true" />
<option name="SMARTS" value="false" />
<option name="STRIKETHROUGH" value="true" />
<option name="SUPPRESS_HTML_BLOCKS" value="false" />
<option name="SUPPRESS_INLINE_HTML" value="false" />
<option name="TABLES" value="true" />
<option name="TASKLISTITEMS" value="true" />
<option name="TOC" value="false" />
<option name="TRACE_PARSER" value="false" />
<option name="WIKILINKS" value="true" />
</PegdownExtensions>
<ParserOptions>
<option name="COMMONMARK_LISTS" value="false" />
<option name="DUMMY" value="false" />
<option name="EMOJI_SHORTCUTS" value="false" />
<option name="FLEXMARK_FRONT_MATTER" value="false" />
<option name="GFM_TABLE_RENDERING" value="true" />
<option name="GITBOOK_URL_ENCODING" value="false" />
<option name="GITHUB_EMOJI_URL" value="false" />
<option name="GITHUB_LISTS" value="false" />
<option name="GITHUB_WIKI_LINKS" value="true" />
<option name="JEKYLL_FRONT_MATTER" value="false" />
<option name="SIM_TOC_BLANK_LINE_SPACER" value="false" />
</ParserOptions>
</ParserSettings>
<HtmlSettings headerTopEnabled="false" headerBottomEnabled="false" bodyTopEnabled="false" bodyBottomEnabled="false" embedUrlContent="false" addPageHeader="true">
<GeneratorProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.generator" providerName="JavaFx HTML Generator" />
</GeneratorProvider>
<headerTop />
<headerBottom />
<bodyTop />
<bodyBottom />
</HtmlSettings>
<CssSettings previewScheme="UI_SCHEME" cssUri="" isCssUriEnabled="false" isCssTextEnabled="false" isDynamicPageWidth="true">
<StylesheetProvider>
<provider providerId="com.vladsch.idea.multimarkdown.editor.javafx.html.css" providerName="Default JavaFx Stylesheet" />
</StylesheetProvider>
<ScriptProviders />
<cssText />
</CssSettings>
<HtmlExportSettings updateOnSave="false" parentDir="$ProjectFileDir$" targetDir="$ProjectFileDir$" cssDir="" scriptDir="" plainHtml="false" imageDir="" copyLinkedImages="false" imageUniquifyType="0" targetExt="" useTargetExt="false" noCssNoScripts="false" linkToExportedHtml="true" exportOnSettingsChange="true" regenerateOnProjectOpen="false" />
<LinkMapSettings>
<textMaps />
</LinkMapSettings>
</component>
</project>

View File

@@ -0,0 +1,3 @@
<component name="MarkdownNavigator.ProfileManager">
<settings default="" pdf-export="" />
</component>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
</project>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/bowser.iml" filepath="$PROJECT_DIR$/.idea/bowser.iml" />
</modules>
</component>
</project>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="Babel" />
</project>

View File

@@ -0,0 +1,745 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e5d5968a-8f20-496e-9038-3ca60f9ade67" name="Default" comment="" />
<ignored path="bowser.iws" />
<ignored path=".idea/workspace.xml" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="CreatePatchCommitExecutor">
<option name="PATCH_PATH" value="" />
</component>
<component name="FavoritesManager">
<favorites_list name="bowser" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="package.json" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/package.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="51">
<caret line="3" column="61" lean-forward="false" selection-start-line="3" selection-start-column="61" selection-end-line="3" selection-end-column="61" />
<folding />
</first_editor>
<second_editor>
<js_state />
</second_editor>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>amazon Silk</find>
<find>load</find>
<find>parseFile</find>
<find>default</find>
<find>Windows Phone</find>
<find>Webos</find>
<find>Mozilla/5.0 (Linux; U; Android 4.4.2; de-de; Nexus 7 Build/KOT49H) AppleWebKit/537.16 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.16</find>
<find>like</find>
<find>Mozilla/5.0 (Maemo; Linux; U; Jolla; Sailfish; Mobile; rv:26.0) Gecko/26.0 Firefox/26.0 SailfishBrowser/1.0 like Safari/538.1</find>
<find>Sa</find>
<find>Sailfish</find>
<find>Firefox</find>
<find>sailfish</find>
<find>boos</find>
<find>opera m</find>
<find>Mozilla/5.0 (Linux; U; Android 6.0; R1 HD Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/52.0.2743.98 Mobile Safari/537.36 OPR/18.0.2254.106542</find>
<find>isUnsup</find>
<find>name: '[a-zA-Z ]+'\s+,</find>
<find>Chrome</find>
<find>OPR</find>
<find>ios</find>
<find>safari</find>
<find>iphone</find>
<find>chromium: true</find>
<find>flag</find>
<find>msedge</find>
<find>edge</find>
<find>Mozilla/5.0 (Linux; Android 8.0; Pixel XL Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.0 Mobile Safari/537.36 EdgA/41.1.35.1</find>
<find>version: &quot;&quot;</find>
<find>Mozilla/5.0 (iPod touch; CPU iPhone OS 9_3_4 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) OPiOS/14.0.0.104835 Mobile/13G35 Safari/9537.53</find>
</findStrings>
<replaceStrings>
<replace>descript</replace>
<replace>describe</replace>
<replace>(\d+(\.?_?\d+)+)</replace>
</replaceStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/.editorconfig" />
<option value="$PROJECT_DIR$/.npmignore" />
<option value="$PROJECT_DIR$/src/copyright.js" />
<option value="$PROJECT_DIR$/make/build.js" />
<option value="$PROJECT_DIR$/ISSUE_TEMPLATE.md" />
<option value="$PROJECT_DIR$/.babelrc" />
<option value="$PROJECT_DIR$/test/unit/utils.js" />
<option value="$PROJECT_DIR$/src/utils.js" />
<option value="$PROJECT_DIR$/.testem.json" />
<option value="$PROJECT_DIR$/transpile-json-to-yaml.js" />
<option value="$PROJECT_DIR$/.gitignore" />
<option value="$PROJECT_DIR$/src/parser-enignes.js" />
<option value="$PROJECT_DIR$/src/parser-engines.js" />
<option value="$PROJECT_DIR$/convert-old-json-to-yaml.js" />
<option value="$PROJECT_DIR$/src/bowser.js" />
<option value="$PROJECT_DIR$/src/parsed-object.js" />
<option value="$PROJECT_DIR$/useragentstrings.yml" />
<option value="$PROJECT_DIR$/helpers/convert-old-json-to-yaml.js" />
<option value="$PROJECT_DIR$/test/unit/parser.js" />
<option value="$PROJECT_DIR$/.travis.yml" />
<option value="$PROJECT_DIR$/test/test.js" />
<option value="$PROJECT_DIR$/test/acceptance/test-list-of-ua.js" />
<option value="$PROJECT_DIR$/src/useragents.js" />
<option value="$PROJECT_DIR$/typings.d.ts" />
<option value="$PROJECT_DIR$/README.md" />
<option value="$PROJECT_DIR$/bower.json" />
<option value="$PROJECT_DIR$/test/acceptance/useragentstrings.yml" />
<option value="$PROJECT_DIR$/src/parser-platforms.js" />
<option value="$PROJECT_DIR$/.eslintignore" />
<option value="$PROJECT_DIR$/.eslintrc.yml" />
<option value="$PROJECT_DIR$/src/parser-browsers.js" />
<option value="$PROJECT_DIR$/src/parser.js" />
<option value="$PROJECT_DIR$/src/parser-os.js" />
<option value="$PROJECT_DIR$/src/new-bowser.js" />
<option value="$PROJECT_DIR$/package.json" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
</list>
</option>
</component>
<component name="JsBuildToolGruntFileManager" detection-done="true" sorting="DEFINITION_ORDER" />
<component name="JsBuildToolPackageJson" detection-done="true" sorting="DEFINITION_ORDER">
<package-json value="$PROJECT_DIR$/package.json" />
</component>
<component name="JsFlowSettings">
<service-enabled>false</service-enabled>
<exe-path />
<annotation-enable>false</annotation-enable>
<other-services-enabled>false</other-services-enabled>
<auto-save>true</auto-save>
</component>
<component name="JsGulpfileManager">
<detection-done>true</detection-done>
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="NodeModulesDirectoryManager">
<handled-path value="$PROJECT_DIR$/node_modules" />
</component>
<component name="ProjectFrameBounds">
<option name="y" value="22" />
<option name="width" value="1920" />
<option name="height" value="1054" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
<flattenPackages />
<showMembers />
<showModules />
<showLibraryContents />
<hideEmptyPackages />
<abbreviatePackageNames />
<autoscrollToSource />
<autoscrollFromSource />
<sortByType />
<manualOrder />
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="bowser" type="b2602c69:ProjectViewProjectNode" />
<item name="bowser" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="Scope" />
<pane id="Scratches" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="HbShouldOpenHtmlAsHb" value="" />
<property name="js-jscs-nodeInterpreter" value="$USER_HOME$/.nvm/versions/node/v4.2.4/bin/node" />
<property name="editor.config.accepted" value="true" />
<property name="nodejs_interpreter_path" value="$USER_HOME$/.nvm/versions/node/v4.4.7/bin/node" />
<property name="nodejs.mocha.mocha_node_package_dir" value="$PROJECT_DIR$/node_modules/mocha" />
<property name="settings.editor.selected.configurable" value="settings.javascript.linters.eslint" />
<property name="javascript.nodejs.core.library.configured.version" value="4.4.7" />
<property name="JavaScriptWeakerCompletionTypeGuess" value="true" />
<property name="SearchEverywhereHistoryKey" value="plat&#9;FILE&#9;file:///Users/lancedikson/Projects/github/bowser/src/parser-platforms.js" />
<property name="node.js.path.for.package.eslint" value="node" />
<property name="node.js.detected.package.eslint" value="true" />
<property name="node.js.selected.package.eslint" value="$PROJECT_DIR$/node_modules/eslint" />
<property name="node.js.path.for.package.standard" value="node" />
<property name="node.js.detected.package.standard" value="true" />
<property name="node.js.selected.package.standard" value="$PROJECT_DIR$/node_modules/eslint" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/test/acceptance" />
<recent name="$PROJECT_DIR$/helpers" />
<recent name="$PROJECT_DIR$" />
</key>
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Node.js.watch tests">
<configuration name="Unnamed" type="ChromiumRemoteDebugType" factoryName="Chromium Remote" port="9229" isV8Legacy="true" />
<configuration name="watch tests" type="NodeJSConfigurationType" factoryName="Node.js" application-parameters="--verbose" path-to-node="/usr/local/Cellar/node/7.8.0/bin/node" path-to-js-file="node_modules/.bin/ava" working-dir="$PROJECT_DIR$">
<EXTENSION ID="com.jetbrains.nodejs.run.NodeJSProfilingRunConfigurationExtension">
<profiling v8-profiler-path="$USER_HOME$/.nvm/versions/node/v4.4.7/lib/node_modules/v8-profiler" />
</EXTENSION>
</configuration>
<configuration default="true" type="BashConfigurationType" factoryName="Bash">
<option name="INTERPRETER_OPTIONS" value="" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="WORKING_DIRECTORY" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SCRIPT_NAME" value="" />
<option name="PARAMETERS" value="" />
<module name="" />
<envs />
<method />
</configuration>
<configuration default="true" type="DartCommandLineRunConfigurationType" factoryName="Dart Command Line Application">
<method />
</configuration>
<configuration default="true" type="DartTestRunConfigurationType" factoryName="Dart Test">
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerJest" factoryName="Jest">
<node-interpreter value="project" />
<working-dir value="" />
<envs />
<scope-kind value="ALL" />
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerKarma" factoryName="Karma">
<config-file value="" />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="JavaScriptTestRunnerProtractor" factoryName="Protractor">
<config-file value="" />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
<method />
</configuration>
<configuration default="true" type="NodeJSConfigurationType" factoryName="Node.js" path-to-node="project" working-dir="">
<method />
</configuration>
<configuration default="true" type="cucumber.js" factoryName="Cucumber.js">
<option name="cucumberJsArguments" value="" />
<option name="executablePath" />
<option name="filePath" />
<method />
</configuration>
<configuration default="true" type="js.build_tools.npm" factoryName="npm">
<command value="run" />
<scripts />
<node-interpreter value="project" />
<envs />
<method />
</configuration>
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
<node-interpreter>project</node-interpreter>
<node-options />
<gulpfile />
<tasks />
<arguments />
<envs />
</configuration>
<configuration name="test" type="js.build_tools.npm" factoryName="npm">
<package-json value="$PROJECT_DIR$/package.json" />
<command value="run" />
<scripts>
<script value="test" />
</scripts>
<arguments value="--inspect-brk" />
<node-interpreter value="/usr/local/Cellar/node/7.8.0/bin/node" />
<envs />
</configuration>
<configuration default="true" type="mocha-javascript-test-runner" factoryName="Mocha">
<node-interpreter>$USER_HOME$/.nvm/versions/node/v4.2.4/bin/node</node-interpreter>
<node-options />
<working-directory>$PROJECT_DIR$</working-directory>
<pass-parent-env>true</pass-parent-env>
<envs />
<ui>bdd</ui>
<extra-mocha-options />
<test-kind>DIRECTORY</test-kind>
<test-directory />
<recursive>false</recursive>
</configuration>
<list size="3">
<item index="0" class="java.lang.String" itemvalue="Attach to Node.js/Chrome.Unnamed" />
<item index="1" class="java.lang.String" itemvalue="Node.js.watch tests" />
<item index="2" class="java.lang.String" itemvalue="npm.test" />
</list>
</component>
<component name="ShelveChangesManager" show_recycled="false">
<option name="remove_strategy" value="false" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="e5d5968a-8f20-496e-9038-3ca60f9ade67" name="Default" comment="" />
<created>1460663203148</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1460663203148</updated>
<workItem from="1467903205339" duration="2348000" />
<workItem from="1469530933856" duration="577000" />
<workItem from="1469613736440" duration="843000" />
<workItem from="1470856356825" duration="1760000" />
<workItem from="1471694116386" duration="3831000" />
<workItem from="1472504254866" duration="2038000" />
<workItem from="1472506362075" duration="69000" />
<workItem from="1472594666841" duration="2699000" />
<workItem from="1472640870661" duration="1938000" />
<workItem from="1472806795867" duration="910000" />
<workItem from="1474185796367" duration="13000" />
<workItem from="1474188003327" duration="3018000" />
<workItem from="1474314087540" duration="1938000" />
<workItem from="1474359763987" duration="11000" />
<workItem from="1474916352416" duration="284000" />
<workItem from="1475653755459" duration="30000" />
<workItem from="1477903203162" duration="2196000" />
<workItem from="1478186752996" duration="320000" />
<workItem from="1478187077648" duration="1126000" />
<workItem from="1478298430363" duration="2567000" />
<workItem from="1480969963547" duration="957000" />
<workItem from="1482500551547" duration="211000" />
<workItem from="1482503774910" duration="735000" />
<workItem from="1483826622613" duration="503000" />
<workItem from="1485119874288" duration="3226000" />
<workItem from="1490357099078" duration="447000" />
<workItem from="1490993891079" duration="6576000" />
<workItem from="1491136107895" duration="7722000" />
<workItem from="1491239706765" duration="714000" />
<workItem from="1491249803179" duration="1984000" />
<workItem from="1491336207678" duration="1618000" />
<workItem from="1491674896468" duration="1676000" />
<workItem from="1491725583169" duration="20809000" />
<workItem from="1491825357873" duration="935000" />
<workItem from="1491858641932" duration="606000" />
<workItem from="1491933288606" duration="2000" />
<workItem from="1491935322145" duration="643000" />
<workItem from="1491936995311" duration="2957000" />
<workItem from="1492110236327" duration="1850000" />
<workItem from="1492272289300" duration="985000" />
<workItem from="1492276168333" duration="10503000" />
<workItem from="1493559521213" duration="367000" />
<workItem from="1493573087749" duration="12000" />
<workItem from="1493573143412" duration="671000" />
<workItem from="1493712648190" duration="26000" />
<workItem from="1493983048502" duration="1970000" />
<workItem from="1495133393210" duration="7807000" />
<workItem from="1495175490141" duration="467000" />
<workItem from="1496943656498" duration="13955000" />
<workItem from="1497033788132" duration="7107000" />
<workItem from="1497164175401" duration="1361000" />
<workItem from="1497703951161" duration="3005000" />
<workItem from="1497790692911" duration="606000" />
<workItem from="1498335998463" duration="1814000" />
<workItem from="1499200847143" duration="5483000" />
<workItem from="1499934318349" duration="520000" />
<workItem from="1502996571785" duration="7286000" />
<workItem from="1503159696902" duration="5078000" />
<workItem from="1503238622588" duration="190000" />
<workItem from="1503238828060" duration="6025000" />
<workItem from="1503300520953" duration="12000" />
<workItem from="1504072300165" duration="742000" />
<workItem from="1506347153317" duration="355000" />
<workItem from="1507364593075" duration="2743000" />
<workItem from="1508265469020" duration="6002000" />
<workItem from="1508501174027" duration="352000" />
<workItem from="1509979153403" duration="605000" />
<workItem from="1513332788354" duration="2020000" />
<workItem from="1513798033267" duration="6864000" />
<workItem from="1513956669871" duration="130000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="177750000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
<is-autoscroll-to-source value="true" />
</todo-panel>
<todo-panel id="all">
<are-packages-shown value="true" />
<is-autoscroll-to-source value="true" />
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="0" y="22" width="1920" height="1054" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.12796208" sideWeight="0.4957265" order="0" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.35449734" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="npm" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.26923078" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.23412699" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.1790416" sideWeight="0.50427353" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="TypeScript" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="1" />
</component>
<component name="Vcs.Log.UiProperties">
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="2" />
</breakpoint-manager>
<watches-manager>
<configuration name="NodeJSConfigurationType">
<watch expression="browsersList" language="JavaScript" />
</configuration>
</watches-manager>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/old.bowser.js" />
<entry file="file://$PROJECT_DIR$/.editorconfig">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="14" column="28" lean-forward="false" selection-start-line="14" selection-start-column="28" selection-end-line="14" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/useragents.js" />
<entry file="file://$PROJECT_DIR$/test.old.js" />
<entry file="file://$PROJECT_DIR$/.editorconfig">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="6" column="7" lean-forward="false" selection-start-line="6" selection-start-column="7" selection-end-line="6" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.npmignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="3" column="0" lean-forward="false" selection-start-line="3" selection-start-column="0" selection-end-line="3" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavaScriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/EcmaScript.js" />
<entry file="file://$PROJECT_DIR$/npm-debug.log" />
<entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavaScriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/HTML5.js" />
<entry file="file://$PROJECT_DIR$/node_modules/smoosh/lib/smoosh/index.js" />
<entry file="file://$PROJECT_DIR$/node_modules/smoosh/index.js" />
<entry file="file://$PROJECT_DIR$/make/build.js" />
<entry file="file://$PROJECT_DIR$/test/unit/bowser.js" />
<entry file="file://$PROJECT_DIR$/node_modules/sinon/lib/sinon.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="285">
<caret line="19" column="9" lean-forward="true" selection-start-line="19" selection-start-column="9" selection-end-line="19" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/LICENSE">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="45">
<caret line="3" column="11" lean-forward="true" selection-start-line="3" selection-start-column="11" selection-end-line="3" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/parser.js" />
<entry file="file://$PROJECT_DIR$/lib/parser-os.js" />
<entry file="file://$PROJECT_DIR$/ISSUE_TEMPLATE.md">
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="85">
<caret line="5" column="0" lean-forward="true" selection-start-line="5" selection-start-column="0" selection-end-line="5" selection-end-column="0" />
</first_editor>
<second_editor>
<js_state />
</second_editor>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.gitignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="68">
<caret line="4" column="5" lean-forward="false" selection-start-line="4" selection-start-column="5" selection-end-line="4" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parsed-object.js" />
<entry file="file://$PROJECT_DIR$/.testem.json" />
<entry file="file://$PROJECT_DIR$/src/utils.js" />
<entry file="file://$PROJECT_DIR$/node_modules/yaml2json/index.js" />
<entry file="file://$PROJECT_DIR$/node_modules/yamljs/lib/Yaml.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="542">
<caret line="76" column="27" lean-forward="false" selection-start-line="76" selection-start-column="23" selection-end-line="76" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Makefile">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="15" column="19" lean-forward="true" selection-start-line="15" selection-start-column="19" selection-end-line="15" selection-end-column="19" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.travis.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/helpers/convert-old-json-to-yaml.js" />
<entry file="file://$PROJECT_DIR$/test/test.js" />
<entry file="file://$PROJECT_DIR$/typings.d.ts">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="505">
<caret line="54" column="0" lean-forward="false" selection-start-line="54" selection-start-column="0" selection-end-line="54" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="54" column="43" lean-forward="false" selection-start-line="54" selection-start-column="43" selection-end-line="54" selection-end-column="43" />
</state>
</provider>
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="1688">
<caret line="199" column="25" lean-forward="false" selection-start-line="199" selection-start-column="25" selection-end-line="199" selection-end-column="25" />
<folding />
</first_editor>
<second_editor>
<js_state />
</second_editor>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bowser.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="216">
<caret line="466" column="13" lean-forward="true" selection-start-line="466" selection-start-column="13" selection-end-line="466" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/bower.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="17" lean-forward="false" selection-start-line="13" selection-start-column="17" selection-end-line="13" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test.old.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="32" column="9" lean-forward="true" selection-start-line="32" selection-start-column="9" selection-end-line="32" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/package-lock.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="384">
<caret line="382" column="34" lean-forward="false" selection-start-line="382" selection-start-column="34" selection-end-line="382" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.babelrc">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/acceptance/test-list-of-ua.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="16" column="0" lean-forward="true" selection-start-line="16" selection-start-column="0" selection-end-line="16" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/unit/utils.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="102">
<caret line="7" column="0" lean-forward="true" selection-start-line="7" selection-start-column="0" selection-end-line="7" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/useragents.js" />
<entry file="file://$PROJECT_DIR$/src/old.bowser.js" />
<entry file="file://$PROJECT_DIR$/test/unit/parser.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-311">
<caret line="0" column="7" lean-forward="false" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/acceptance/useragentstrings.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="9299">
<caret line="547" column="18" lean-forward="false" selection-start-line="547" selection-start-column="18" selection-end-line="547" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.eslintignore">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="4" lean-forward="false" selection-start-line="0" selection-start-column="4" selection-end-line="0" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parser-platforms.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="4" column="18" lean-forward="false" selection-start-line="4" selection-start-column="18" selection-end-line="4" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/.eslintrc.yml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="3" column="9" lean-forward="false" selection-start-line="3" selection-start-column="9" selection-end-line="3" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parser-browsers.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="6681">
<caret line="419" column="52" lean-forward="false" selection-start-line="419" selection-start-column="52" selection-end-line="419" selection-end-column="52" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parser-os.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2227">
<caret line="133" column="43" lean-forward="true" selection-start-line="133" selection-start-column="43" selection-end-line="133" selection-end-column="43" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parser-engines.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="7" lean-forward="false" selection-start-line="0" selection-start-column="7" selection-end-line="0" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/parser.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2635">
<caret line="158" column="33" lean-forward="false" selection-start-line="158" selection-start-column="33" selection-end-line="158" selection-end-column="33" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/new-bowser.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="311">
<caret line="32" column="20" lean-forward="true" selection-start-line="32" selection-start-column="20" selection-end-line="32" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/package.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="34">
<caret line="2" column="19" lean-forward="false" selection-start-line="2" selection-start-column="19" selection-end-line="2" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="0" lean-forward="false" selection-start-line="2" selection-start-column="0" selection-end-line="4" selection-end-column="57" />
</state>
</provider>
<provider selected="true" editor-type-id="split-provider[text-editor;MarkdownPreviewEditor]">
<state split_layout="FIRST">
<first_editor relative-caret-position="51">
<caret line="3" column="61" lean-forward="false" selection-start-line="3" selection-start-column="61" selection-end-line="3" selection-end-column="61" />
<folding />
</first_editor>
<second_editor>
<js_state />
</second_editor>
</state>
</provider>
</entry>
</component>
</project>

View File

@@ -0,0 +1,8 @@
language: node_js
node_js:
- "4.4.7"
notifications:
email:
- dustin@dustindiaz.com
script: NODE_ENV=test ./node_modules/.bin/mocha --reporter spec

View File

@@ -0,0 +1,73 @@
# Bowser Changelog
### 1.9.1 (December 22, 2017)
- [FIX] Fix `typings.d.ts` — add `chromium` flag to interface
### 1.9.0 (December 20, 2017)
- [ADD] Add a public method `.detect()` (#205)
- [DOCS] Fix description of `chromium` flag in docs (#206)
### 1.8.1 (October 7, 2017)
- [FIX] Fix detection of MS Edge on Android and iOS (#201)
### 1.8.0 (October 7, 2017)
- [ADD] Add `osname` into result object (#200)
### 1.7.3 (August 30, 2017)
- [FIX] Fix detection of Chrome on Android 8 OPR6 (#193)
### 1.7.2 (August 17, 2017)
- [FIX] Fix typings.d.ts according to #185
### 1.7.1 (July 13, 2017)
- [ADD] Fix detecting of Tablet PC as tablet (#183)
### 1.7.0 (May 18, 2017)
- [ADD] Add OS version support for Windows and macOS (#178)
### 1.6.0 (December 5, 2016)
- [ADD] Add some tests for Windows devices (#89)
- [ADD] Add `root` to initialization process (#170)
- [FIX] Upgrade .travis.yml config
### 1.5.0 (October 31, 2016)
- [ADD] Throw an error when `minVersion` map has not a string as a version and fix readme (#165)
- [FIX] Fix truly detection of Windows Phones (#167)
### 1.4.6 (September 19, 2016)
- [FIX] Fix mobile Opera's version detection on Android
- [FIX] Fix typescript typings — add `mobile` and `tablet` flags
- [DOC] Fix description of `bowser.check`
### 1.4.5 (August 30, 2016)
- [FIX] Add support of Samsung Internet for Android
- [FIX] Fix case when `navigator.userAgent` is `undefined`
- [DOC] Add information about `strictMode` in `check` function
- [DOC] Consistent use of `bowser` variable in the README
### 1.4.4 (August 10, 2016)
- [FIX] Fix AMD `define` call — pass name to the function
### 1.4.3 (July 27, 2016)
- [FIX] Fix error `Object doesn't support this property or method` on IE8
### 1.4.2 (July 26, 2016)
- [FIX] Fix missing `isUnsupportedBrowser` in typings description
- [DOC] Fix `check`'s declaration in README
### 1.4.1 (July 7, 2016)
- [FIX] Fix `strictMode` logic for `isUnsupportedBrowser`
### 1.4.0 (June 28, 2016)
- [FEATURE] Add `bowser.compareVersions` method
- [FEATURE] Add `bowser.isUnsupportedBrowser` method
- [FEATURE] Add `bowser.check` method
- [DOC] Changelog started
- [DOC] Add API section to README
- [FIX] Fix detection of browser type (A/C/X) for Chromium

View File

@@ -0,0 +1,5 @@
Template to report about browser detection issue
`window.navigator.userAgent` of the browser is: ...
And it's detected like a ...
But real name of the browser is ...

View File

@@ -0,0 +1,39 @@
Copyright 2015, Dustin Diaz (the "Original Author")
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Distributions of all or part of the Software intended to be used
by the recipients as they would use the unmodified Software,
containing modifications that substantially alter, remove, or
disable functionality of the Software, outside of the documented
configuration mechanisms provided by the Software, shall be
modified such that the Original Author's bug reporting email
addresses and urls are either replaced with the contact information
of the parties responsible for the changes, or removed entirely.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except where noted, this license applies to any and all software
programs and associated documentation files created by the
Original Author, when distributed with the Software.

View File

@@ -0,0 +1,210 @@
## Bowser
A Browser detector. Because sometimes, there is no other way, and not even good modern browsers always provide good feature detection mechanisms.
[![Build Status](https://travis-ci.org/lancedikson/bowser.svg?branch=master)](https://travis-ci.org/lancedikson/bowser)
So... it works like this:
``` js
if (bowser.msie && bowser.version <= 6) {
alert('Hello China');
}
```
## 1.1.0 breaking changes
We don't save built script in the repo anymore. The main file (`src/bowser.js`) is available through NPM or Bower.
Also you can download minified file from [the release page](https://github.com/ded/bowser/releases).
## 1.0.0 breaking changes
`browser = require('bowser').browser;` becomes `bowser = require('bowser');`
---
## API
### bowser`:Object`
Use it to get object with detected flags of your current browser.
### bowser._detect(ua `:String`)`:Object`
Use it to get object with detected flags from User Agent string.
### bowser.check(minVersions`:Object`, strictMode`:Boolean`, [ua]`:String`)`:Boolean`
Use it to check if browser is supported. In default non-strict mode any browser family not present in `minVersions` will pass the check (like Chrome in the third call in the sample bellow). When strict mode is enabled then any not specified browser family in `minVersions` will cause `check` to return `false` (in the sample it is the fourth call, the last one).
``` js
/**
* in case of using IE10
*/
bowser.check({msie: "11"}); // true
bowser.check({msie: "9.0"}); // false
/**
* specific user agent
*/
bowser.check({chrome: "45"}, window.navigator.userAgent); // true
/**
* but false in strict mode
*/
bowser.check({chrome: "45"}, true, window.navigator.userAgent); // false
```
### bowser.compareVersions(versions`:Array<String>`)`:Number`
Use it to compare two versions.
``` js
bowser.compareVersions(['9.0', '10']);
// -1
```
### bowser.isUnsupportedBrowser(minVersions`:Object`, [strictMode]`:Boolean`, [ua]`:string`)`:Boolean`
Use it to check if browser is unsupported.
``` js
bowser.isUnsupportedBrowser({msie: "10"}, window.navigator.userAgent);
// true / false
```
See more examples in [tests](test/test.js).
---
## Bowser Flags
Your mileage may vary, but these flags should be set. See Contributing below.
``` js
alert('Hello ' + bowser.name + ' ' + bowser.version);
```
### All detected browsers
These flags are set for all detected browsers:
* `name` - A human readable name for this browser. E.g. 'Chrome', ''
* `version` - Version number for the browser. E.g. '32.0'
For unknown browsers, Bowser makes a best guess from the UA string. So, these may not be set.
### Rendering engine flags
If detected, one of these flags may be set to true:
* `webkit` - Chrome 0-27, Android <4.4, iOs, BB, etc.
* `blink` - Chrome >=28, Android >=4.4, Opera, etc.
* `gecko` - Firefox, etc.
* `msie` - IE <= 11
* `msedge` - IE > 11
Safari, Chrome and some other minor browsers will report that they have `webkit` engines.
Firefox and Seamonkey will report that they have `gecko` engines.
``` js
if (bowser.webkit) {
// do stuff with safari & chrome & opera & android & blackberry & webos & silk
}
```
### Device flags
If detected, one of these flags may be set to true:
* `mobile` - All detected mobile OSes are additionally flagged `mobile`, **unless it's a tablet**
* `tablet` - If a tablet device is detected, the flag `tablet` is **set instead of `mobile`**.
### Browser flags
If detected, one of these flags may be set to true. The rendering engine flag is shown in []'s:
* `chrome` - [`webkit`|`blink`]
* `chromium` - [`webkit`|`blink`]
* `firefox` - [`gecko`]
* `msie`
* `msedge`
* `safari` - [`webkit`]
* `android` - native browser - [`webkit`|`blink`]
* `ios` - native browser - [`webkit`]
* `opera` - [`blink` if >=15]
* `samsungBrowser` - [`blink`]
* `phantom` - [`webkit`]
* `blackberry` - native browser - [`webkit`]
* `webos` - native browser - [`webkit`]
* `silk` - Amazon Kindle browser - [`webkit`]
* `bada` - [`webkit`]
* `tizen` - [`webkit`]
* `seamonkey` - [`gecko`]
* `sailfish` - [`gecko`]
* `ucbrowser` — [`webkit`]
* `qupzilla` — [`webkit`]
* `vivaldi` — [`blink`]
* `sleipnir` — [`blink`]
* `kMeleon` — [`gecko`]
For all detected browsers the browser version is set in the `version` field.
### OS Flags
If detected, one of these flags may be set to true:
* `mac`
* `windows` - other than Windows Phone
* `windowsphone`
* `linux` - other than `android`, `chromeos`, `webos`, `tizen`, and `sailfish`
* `chromeos`
* `android`
* `ios` - also sets one of `iphone`/`ipad`/`ipod`
* `blackberry`
* `firefoxos`
* `webos` - may also set `touchpad`
* `bada`
* `tizen`
* `sailfish`
`osname` and `osversion` may also be set:
* `osname` - for the OS flags detected above: macOS, Windows, Windows Phone, Linux, Chrome OS, Android, iOS, Blackberry OS, Firefox OS, WebOS, Bada, Tizen, Sailfish OS, and Xbox
* `osversion` - for Android, iOS, MacOS, Windows, Windows Phone, WebOS, Bada, and Tizen. If included in UA string.
iOS is always reported as `ios` and additionally as `iphone`/`ipad`/`ipod`, whichever one matches best.
If WebOS device is an HP TouchPad the flag `touchpad` is additionally set.
### Browser capability grading
One of these flags may be set:
* `a` - This browser has full capabilities
* `c` - This browser has degraded capabilities. Serve simpler version
* `x` - This browser has minimal capabilities and is probably not well detected.
There is no `b`. For unknown browsers, none of these flags may be set.
### Ender Support
`package.json`
``` json
"dependencies": {
"bowser": "x.x.x"
}
```
``` js
if (require('bowser').chrome) {
alert('Hello Silicon Valley')
}
```
### Contributing
If you'd like to contribute a change to bowser, modify the files in `src/`, then run the following (you'll need node + npm installed):
``` sh
$ npm install
$ make test
```
Please do not check-in the built files `bowser.js` and `bowser.min.js` in pull requests.
### Adding tests
See the list in `src/useragents.js` with example user agents and their expected bowser object.
Whenever you add support for new browsers or notice a bug / mismatch, please update the list and
check if all tests are still passing.
### Similar Projects
* [Kong](https://github.com/BigBadBleuCheese/Kong) - A C# port of Bowser.
### License
Licensed as MIT. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

View File

@@ -0,0 +1,33 @@
{
"name": "bowser",
"description": "Lightweight browser detector",
"keywords": [
"browser",
"useragent",
"user-agent",
"parser",
"ua",
"detection",
"ender",
"sniff"
],
"version": "1.9.0",
"homepage": "https://github.com/lancedikson/bowser",
"scripts": [
"src/bowser.js"
],
"authors": [
"Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)",
"Denis Demchenko <lance@dikson.me>"
],
"moduleType": [],
"license": "MIT",
"main": "src/bowser.js",
"ignore": [
"node_modules",
"test",
"make",
"**/.*",
"Makefile"
]
}

View File

@@ -0,0 +1,620 @@
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2015
*/
!function (root, name, definition) {
if (typeof module != 'undefined' && module.exports) module.exports = definition()
else if (typeof define == 'function' && define.amd) define(name, definition)
else root[name] = definition()
}(this, 'bowser', function () {
/**
* See useragents.js for examples of navigator.userAgent
*/
var t = true
function detect(ua) {
function getFirstMatch(regex) {
var match = ua.match(regex);
return (match && match.length > 1 && match[1]) || '';
}
function getSecondMatch(regex) {
var match = ua.match(regex);
return (match && match.length > 1 && match[2]) || '';
}
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
, likeAndroid = /like android/i.test(ua)
, android = !likeAndroid && /android/i.test(ua)
, nexusMobile = /nexus\s*[0-6]\s*/i.test(ua)
, nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua)
, chromeos = /CrOS/.test(ua)
, silk = /silk/i.test(ua)
, sailfish = /sailfish/i.test(ua)
, tizen = /tizen/i.test(ua)
, webos = /(web|hpw)os/i.test(ua)
, windowsphone = /windows phone/i.test(ua)
, samsungBrowser = /SamsungBrowser/i.test(ua)
, windows = !windowsphone && /windows/i.test(ua)
, mac = !iosdevice && !silk && /macintosh/i.test(ua)
, linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua)
, edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i)
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
, tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua)
, mobile = !tablet && /[^-]mobi/i.test(ua)
, xbox = /xbox/i.test(ua)
, result
if (/opera/i.test(ua)) {
// an old Opera
result = {
name: 'Opera'
, opera: t
, version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
}
} else if (/opr\/|opios/i.test(ua)) {
// a new Opera
result = {
name: 'Opera'
, opera: t
, version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (/SamsungBrowser/i.test(ua)) {
result = {
name: 'Samsung Internet for Android'
, samsungBrowser: t
, version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/coast/i.test(ua)) {
result = {
name: 'Opera Coast'
, coast: t
, version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/yabrowser/i.test(ua)) {
result = {
name: 'Yandex Browser'
, yandexbrowser: t
, version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/ucbrowser/i.test(ua)) {
result = {
name: 'UC Browser'
, ucbrowser: t
, version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/mxios/i.test(ua)) {
result = {
name: 'Maxthon'
, maxthon: t
, version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/epiphany/i.test(ua)) {
result = {
name: 'Epiphany'
, epiphany: t
, version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/puffin/i.test(ua)) {
result = {
name: 'Puffin'
, puffin: t
, version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)
}
}
else if (/sleipnir/i.test(ua)) {
result = {
name: 'Sleipnir'
, sleipnir: t
, version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/k-meleon/i.test(ua)) {
result = {
name: 'K-Meleon'
, kMeleon: t
, version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (windowsphone) {
result = {
name: 'Windows Phone'
, osname: 'Windows Phone'
, windowsphone: t
}
if (edgeVersion) {
result.msedge = t
result.version = edgeVersion
}
else {
result.msie = t
result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i)
}
}
else if (/msie|trident/i.test(ua)) {
result = {
name: 'Internet Explorer'
, msie: t
, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
}
} else if (chromeos) {
result = {
name: 'Chrome'
, osname: 'Chrome OS'
, chromeos: t
, chromeBook: t
, chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
}
} else if (/edg([ea]|ios)/i.test(ua)) {
result = {
name: 'Microsoft Edge'
, msedge: t
, version: edgeVersion
}
}
else if (/vivaldi/i.test(ua)) {
result = {
name: 'Vivaldi'
, vivaldi: t
, version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (sailfish) {
result = {
name: 'Sailfish'
, osname: 'Sailfish OS'
, sailfish: t
, version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i)
}
}
else if (/seamonkey\//i.test(ua)) {
result = {
name: 'SeaMonkey'
, seamonkey: t
, version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i)
}
}
else if (/firefox|iceweasel|fxios/i.test(ua)) {
result = {
name: 'Firefox'
, firefox: t
, version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)
}
if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) {
result.firefoxos = t
result.osname = 'Firefox OS'
}
}
else if (silk) {
result = {
name: 'Amazon Silk'
, silk: t
, version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
}
}
else if (/phantom/i.test(ua)) {
result = {
name: 'PhantomJS'
, phantom: t
, version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i)
}
}
else if (/slimerjs/i.test(ua)) {
result = {
name: 'SlimerJS'
, slimer: t
, version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i)
}
}
else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) {
result = {
name: 'BlackBerry'
, osname: 'BlackBerry OS'
, blackberry: t
, version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
}
}
else if (webos) {
result = {
name: 'WebOS'
, osname: 'WebOS'
, webos: t
, version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
};
/touchpad\//i.test(ua) && (result.touchpad = t)
}
else if (/bada/i.test(ua)) {
result = {
name: 'Bada'
, osname: 'Bada'
, bada: t
, version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i)
};
}
else if (tizen) {
result = {
name: 'Tizen'
, osname: 'Tizen'
, tizen: t
, version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier
};
}
else if (/qupzilla/i.test(ua)) {
result = {
name: 'QupZilla'
, qupzilla: t
, version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
}
}
else if (/chromium/i.test(ua)) {
result = {
name: 'Chromium'
, chromium: t
, version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier
}
}
else if (/chrome|crios|crmo/i.test(ua)) {
result = {
name: 'Chrome'
, chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
}
}
else if (android) {
result = {
name: 'Android'
, version: versionIdentifier
}
}
else if (/safari|applewebkit/i.test(ua)) {
result = {
name: 'Safari'
, safari: t
}
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if (iosdevice) {
result = {
name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'
}
// WTF: version is not part of user agent in web apps
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if(/googlebot/i.test(ua)) {
result = {
name: 'Googlebot'
, googlebot: t
, version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier
}
}
else {
result = {
name: getFirstMatch(/^(.*)\/(.*) /),
version: getSecondMatch(/^(.*)\/(.*) /)
};
}
// set webkit or gecko flag for browsers based on these engines
if (!result.msedge && /(apple)?webkit/i.test(ua)) {
if (/(apple)?webkit\/537\.36/i.test(ua)) {
result.name = result.name || "Blink"
result.blink = t
} else {
result.name = result.name || "Webkit"
result.webkit = t
}
if (!result.version && versionIdentifier) {
result.version = versionIdentifier
}
} else if (!result.opera && /gecko\//i.test(ua)) {
result.name = result.name || "Gecko"
result.gecko = t
result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i)
}
// set OS flags for platforms that have multiple browsers
if (!result.windowsphone && (android || result.silk)) {
result.android = t
result.osname = 'Android'
} else if (!result.windowsphone && iosdevice) {
result[iosdevice] = t
result.ios = t
result.osname = 'iOS'
} else if (mac) {
result.mac = t
result.osname = 'macOS'
} else if (xbox) {
result.xbox = t
result.osname = 'Xbox'
} else if (windows) {
result.windows = t
result.osname = 'Windows'
} else if (linux) {
result.linux = t
result.osname = 'Linux'
}
function getWindowsVersion (s) {
switch (s) {
case 'NT': return 'NT'
case 'XP': return 'XP'
case 'NT 5.0': return '2000'
case 'NT 5.1': return 'XP'
case 'NT 5.2': return '2003'
case 'NT 6.0': return 'Vista'
case 'NT 6.1': return '7'
case 'NT 6.2': return '8'
case 'NT 6.3': return '8.1'
case 'NT 10.0': return '10'
default: return undefined
}
}
// OS version extraction
var osVersion = '';
if (result.windows) {
osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i))
} else if (result.windowsphone) {
osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i);
} else if (result.mac) {
osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i);
osVersion = osVersion.replace(/[_\s]/g, '.');
} else if (iosdevice) {
osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i);
osVersion = osVersion.replace(/[_\s]/g, '.');
} else if (android) {
osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i);
} else if (result.webos) {
osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i);
} else if (result.blackberry) {
osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i);
} else if (result.bada) {
osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i);
} else if (result.tizen) {
osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i);
}
if (osVersion) {
result.osversion = osVersion;
}
// device type extraction
var osMajorVersion = !result.windows && osVersion.split('.')[0];
if (
tablet
|| nexusTablet
|| iosdevice == 'ipad'
|| (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile)))
|| result.silk
) {
result.tablet = t
} else if (
mobile
|| iosdevice == 'iphone'
|| iosdevice == 'ipod'
|| android
|| nexusMobile
|| result.blackberry
|| result.webos
|| result.bada
) {
result.mobile = t
}
// Graded Browser Support
// http://developer.yahoo.com/yui/articles/gbs
if (result.msedge ||
(result.msie && result.version >= 10) ||
(result.yandexbrowser && result.version >= 15) ||
(result.vivaldi && result.version >= 1.0) ||
(result.chrome && result.version >= 20) ||
(result.samsungBrowser && result.version >= 4) ||
(result.firefox && result.version >= 20.0) ||
(result.safari && result.version >= 6) ||
(result.opera && result.version >= 10.0) ||
(result.ios && result.osversion && result.osversion.split(".")[0] >= 6) ||
(result.blackberry && result.version >= 10.1)
|| (result.chromium && result.version >= 20)
) {
result.a = t;
}
else if ((result.msie && result.version < 10) ||
(result.chrome && result.version < 20) ||
(result.firefox && result.version < 20.0) ||
(result.safari && result.version < 6) ||
(result.opera && result.version < 10.0) ||
(result.ios && result.osversion && result.osversion.split(".")[0] < 6)
|| (result.chromium && result.version < 20)
) {
result.c = t
} else result.x = t
return result
}
var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '')
bowser.test = function (browserList) {
for (var i = 0; i < browserList.length; ++i) {
var browserItem = browserList[i];
if (typeof browserItem=== 'string') {
if (browserItem in bowser) {
return true;
}
}
}
return false;
}
/**
* Get version precisions count
*
* @example
* getVersionPrecision("1.10.3") // 3
*
* @param {string} version
* @return {number}
*/
function getVersionPrecision(version) {
return version.split(".").length;
}
/**
* Array::map polyfill
*
* @param {Array} arr
* @param {Function} iterator
* @return {Array}
*/
function map(arr, iterator) {
var result = [], i;
if (Array.prototype.map) {
return Array.prototype.map.call(arr, iterator);
}
for (i = 0; i < arr.length; i++) {
result.push(iterator(arr[i]));
}
return result;
}
/**
* Calculate browser version weight
*
* @example
* compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1
* compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1
* compareVersions(['1.10.2.1', '1.10.2.1']); // 0
* compareVersions(['1.10.2.1', '1.0800.2']); // -1
*
* @param {Array<String>} versions versions to compare
* @return {Number} comparison result
*/
function compareVersions(versions) {
// 1) get common precision for both versions, for example for "10.0" and "9" it should be 2
var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));
var chunks = map(versions, function (version) {
var delta = precision - getVersionPrecision(version);
// 2) "9" -> "9.0" (for precision = 2)
version = version + new Array(delta + 1).join(".0");
// 3) "9.0" -> ["000000000"", "000000009"]
return map(version.split("."), function (chunk) {
return new Array(20 - chunk.length).join("0") + chunk;
}).reverse();
});
// iterate in reverse order by reversed chunks array
while (--precision >= 0) {
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
if (chunks[0][precision] > chunks[1][precision]) {
return 1;
}
else if (chunks[0][precision] === chunks[1][precision]) {
if (precision === 0) {
// all version chunks are same
return 0;
}
}
else {
return -1;
}
}
}
/**
* Check if browser is unsupported
*
* @example
* bowser.isUnsupportedBrowser({
* msie: "10",
* firefox: "23",
* chrome: "29",
* safari: "5.1",
* opera: "16",
* phantom: "534"
* });
*
* @param {Object} minVersions map of minimal version to browser
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map
* @param {String} [ua] user agent string
* @return {Boolean}
*/
function isUnsupportedBrowser(minVersions, strictMode, ua) {
var _bowser = bowser;
// make strictMode param optional with ua param usage
if (typeof strictMode === 'string') {
ua = strictMode;
strictMode = void(0);
}
if (strictMode === void(0)) {
strictMode = false;
}
if (ua) {
_bowser = detect(ua);
}
var version = "" + _bowser.version;
for (var browser in minVersions) {
if (minVersions.hasOwnProperty(browser)) {
if (_bowser[browser]) {
if (typeof minVersions[browser] !== 'string') {
throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions));
}
// browser version and min supported version.
return compareVersions([version, minVersions[browser]]) < 0;
}
}
}
return strictMode; // not found
}
/**
* Check if browser is supported
*
* @param {Object} minVersions map of minimal version to browser
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map
* @param {String} [ua] user agent string
* @return {Boolean}
*/
function check(minVersions, strictMode, ua) {
return !isUnsupportedBrowser(minVersions, strictMode, ua);
}
bowser.isUnsupportedBrowser = isUnsupportedBrowser;
bowser.compareVersions = compareVersions;
bowser.check = check;
/*
* Set our detect method to the main bowser object so we can
* reuse it to test other user agents.
* This is needed to implement future tests.
*/
bowser._detect = detect;
/*
* Set our detect public method to the main bowser object
* This is needed to implement bowser in server side
*/
bowser.detect = detect;
return bowser
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,67 @@
{
"_from": "bowser@^1.7.3",
"_id": "bowser@1.9.1",
"_inBundle": false,
"_integrity": "sha512-UXti1JB6oK8hO983AImunnV6j/fqAEeDlPXh99zhsP5g32oLbxJJ6qcOaUesR+tqqhnUVQHlRJyD0dfiV0Hxaw==",
"_location": "/react-toastify/bowser",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "bowser@^1.7.3",
"name": "bowser",
"escapedName": "bowser",
"rawSpec": "^1.7.3",
"saveSpec": null,
"fetchSpec": "^1.7.3"
},
"_requiredBy": [
"/react-toastify/inline-style-prefixer"
],
"_resolved": "https://registry.npmjs.org/bowser/-/bowser-1.9.1.tgz",
"_shasum": "f86ef2132e8cb10b3eb6ea5af018758c587020db",
"_spec": "bowser@^1.7.3",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-toastify\\node_modules\\inline-style-prefixer",
"author": {
"name": "Dustin Diaz",
"email": "dustin@dustindiaz.com",
"url": "http://dustindiaz.com"
},
"bugs": {
"url": "https://github.com/ded/bowser/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Lightweight browser detector",
"devDependencies": {
"mocha": "*",
"smoosh": "*"
},
"directories": {
"test": "test"
},
"homepage": "https://github.com/lancedikson/bowser",
"keywords": [
"browser",
"useragent",
"user-agent",
"parser",
"ua",
"detection",
"ender",
"sniff"
],
"license": "MIT",
"main": "./src/bowser.js",
"name": "bowser",
"repository": {
"type": "git",
"url": "git+https://github.com/ded/bowser.git"
},
"scripts": {
"prepublish": "make boosh",
"test": "make test"
},
"typings": "./typings.d.ts",
"version": "1.9.1"
}

View File

@@ -0,0 +1,620 @@
/*!
* Bowser - a browser detector
* https://github.com/ded/bowser
* MIT License | (c) Dustin Diaz 2015
*/
!function (root, name, definition) {
if (typeof module != 'undefined' && module.exports) module.exports = definition()
else if (typeof define == 'function' && define.amd) define(name, definition)
else root[name] = definition()
}(this, 'bowser', function () {
/**
* See useragents.js for examples of navigator.userAgent
*/
var t = true
function detect(ua) {
function getFirstMatch(regex) {
var match = ua.match(regex);
return (match && match.length > 1 && match[1]) || '';
}
function getSecondMatch(regex) {
var match = ua.match(regex);
return (match && match.length > 1 && match[2]) || '';
}
var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
, likeAndroid = /like android/i.test(ua)
, android = !likeAndroid && /android/i.test(ua)
, nexusMobile = /nexus\s*[0-6]\s*/i.test(ua)
, nexusTablet = !nexusMobile && /nexus\s*[0-9]+/i.test(ua)
, chromeos = /CrOS/.test(ua)
, silk = /silk/i.test(ua)
, sailfish = /sailfish/i.test(ua)
, tizen = /tizen/i.test(ua)
, webos = /(web|hpw)os/i.test(ua)
, windowsphone = /windows phone/i.test(ua)
, samsungBrowser = /SamsungBrowser/i.test(ua)
, windows = !windowsphone && /windows/i.test(ua)
, mac = !iosdevice && !silk && /macintosh/i.test(ua)
, linux = !android && !sailfish && !tizen && !webos && /linux/i.test(ua)
, edgeVersion = getSecondMatch(/edg([ea]|ios)\/(\d+(\.\d+)?)/i)
, versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
, tablet = /tablet/i.test(ua) && !/tablet pc/i.test(ua)
, mobile = !tablet && /[^-]mobi/i.test(ua)
, xbox = /xbox/i.test(ua)
, result
if (/opera/i.test(ua)) {
// an old Opera
result = {
name: 'Opera'
, opera: t
, version: versionIdentifier || getFirstMatch(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)
}
} else if (/opr\/|opios/i.test(ua)) {
// a new Opera
result = {
name: 'Opera'
, opera: t
, version: getFirstMatch(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (/SamsungBrowser/i.test(ua)) {
result = {
name: 'Samsung Internet for Android'
, samsungBrowser: t
, version: versionIdentifier || getFirstMatch(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/coast/i.test(ua)) {
result = {
name: 'Opera Coast'
, coast: t
, version: versionIdentifier || getFirstMatch(/(?:coast)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/yabrowser/i.test(ua)) {
result = {
name: 'Yandex Browser'
, yandexbrowser: t
, version: versionIdentifier || getFirstMatch(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)
}
}
else if (/ucbrowser/i.test(ua)) {
result = {
name: 'UC Browser'
, ucbrowser: t
, version: getFirstMatch(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/mxios/i.test(ua)) {
result = {
name: 'Maxthon'
, maxthon: t
, version: getFirstMatch(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/epiphany/i.test(ua)) {
result = {
name: 'Epiphany'
, epiphany: t
, version: getFirstMatch(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/puffin/i.test(ua)) {
result = {
name: 'Puffin'
, puffin: t
, version: getFirstMatch(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)
}
}
else if (/sleipnir/i.test(ua)) {
result = {
name: 'Sleipnir'
, sleipnir: t
, version: getFirstMatch(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (/k-meleon/i.test(ua)) {
result = {
name: 'K-Meleon'
, kMeleon: t
, version: getFirstMatch(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)
}
}
else if (windowsphone) {
result = {
name: 'Windows Phone'
, osname: 'Windows Phone'
, windowsphone: t
}
if (edgeVersion) {
result.msedge = t
result.version = edgeVersion
}
else {
result.msie = t
result.version = getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i)
}
}
else if (/msie|trident/i.test(ua)) {
result = {
name: 'Internet Explorer'
, msie: t
, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
}
} else if (chromeos) {
result = {
name: 'Chrome'
, osname: 'Chrome OS'
, chromeos: t
, chromeBook: t
, chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
}
} else if (/edg([ea]|ios)/i.test(ua)) {
result = {
name: 'Microsoft Edge'
, msedge: t
, version: edgeVersion
}
}
else if (/vivaldi/i.test(ua)) {
result = {
name: 'Vivaldi'
, vivaldi: t
, version: getFirstMatch(/vivaldi\/(\d+(\.\d+)?)/i) || versionIdentifier
}
}
else if (sailfish) {
result = {
name: 'Sailfish'
, osname: 'Sailfish OS'
, sailfish: t
, version: getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i)
}
}
else if (/seamonkey\//i.test(ua)) {
result = {
name: 'SeaMonkey'
, seamonkey: t
, version: getFirstMatch(/seamonkey\/(\d+(\.\d+)?)/i)
}
}
else if (/firefox|iceweasel|fxios/i.test(ua)) {
result = {
name: 'Firefox'
, firefox: t
, version: getFirstMatch(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)
}
if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) {
result.firefoxos = t
result.osname = 'Firefox OS'
}
}
else if (silk) {
result = {
name: 'Amazon Silk'
, silk: t
, version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
}
}
else if (/phantom/i.test(ua)) {
result = {
name: 'PhantomJS'
, phantom: t
, version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i)
}
}
else if (/slimerjs/i.test(ua)) {
result = {
name: 'SlimerJS'
, slimer: t
, version: getFirstMatch(/slimerjs\/(\d+(\.\d+)?)/i)
}
}
else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) {
result = {
name: 'BlackBerry'
, osname: 'BlackBerry OS'
, blackberry: t
, version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
}
}
else if (webos) {
result = {
name: 'WebOS'
, osname: 'WebOS'
, webos: t
, version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
};
/touchpad\//i.test(ua) && (result.touchpad = t)
}
else if (/bada/i.test(ua)) {
result = {
name: 'Bada'
, osname: 'Bada'
, bada: t
, version: getFirstMatch(/dolfin\/(\d+(\.\d+)?)/i)
};
}
else if (tizen) {
result = {
name: 'Tizen'
, osname: 'Tizen'
, tizen: t
, version: getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i) || versionIdentifier
};
}
else if (/qupzilla/i.test(ua)) {
result = {
name: 'QupZilla'
, qupzilla: t
, version: getFirstMatch(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i) || versionIdentifier
}
}
else if (/chromium/i.test(ua)) {
result = {
name: 'Chromium'
, chromium: t
, version: getFirstMatch(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i) || versionIdentifier
}
}
else if (/chrome|crios|crmo/i.test(ua)) {
result = {
name: 'Chrome'
, chrome: t
, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
}
}
else if (android) {
result = {
name: 'Android'
, version: versionIdentifier
}
}
else if (/safari|applewebkit/i.test(ua)) {
result = {
name: 'Safari'
, safari: t
}
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if (iosdevice) {
result = {
name : iosdevice == 'iphone' ? 'iPhone' : iosdevice == 'ipad' ? 'iPad' : 'iPod'
}
// WTF: version is not part of user agent in web apps
if (versionIdentifier) {
result.version = versionIdentifier
}
}
else if(/googlebot/i.test(ua)) {
result = {
name: 'Googlebot'
, googlebot: t
, version: getFirstMatch(/googlebot\/(\d+(\.\d+))/i) || versionIdentifier
}
}
else {
result = {
name: getFirstMatch(/^(.*)\/(.*) /),
version: getSecondMatch(/^(.*)\/(.*) /)
};
}
// set webkit or gecko flag for browsers based on these engines
if (!result.msedge && /(apple)?webkit/i.test(ua)) {
if (/(apple)?webkit\/537\.36/i.test(ua)) {
result.name = result.name || "Blink"
result.blink = t
} else {
result.name = result.name || "Webkit"
result.webkit = t
}
if (!result.version && versionIdentifier) {
result.version = versionIdentifier
}
} else if (!result.opera && /gecko\//i.test(ua)) {
result.name = result.name || "Gecko"
result.gecko = t
result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i)
}
// set OS flags for platforms that have multiple browsers
if (!result.windowsphone && (android || result.silk)) {
result.android = t
result.osname = 'Android'
} else if (!result.windowsphone && iosdevice) {
result[iosdevice] = t
result.ios = t
result.osname = 'iOS'
} else if (mac) {
result.mac = t
result.osname = 'macOS'
} else if (xbox) {
result.xbox = t
result.osname = 'Xbox'
} else if (windows) {
result.windows = t
result.osname = 'Windows'
} else if (linux) {
result.linux = t
result.osname = 'Linux'
}
function getWindowsVersion (s) {
switch (s) {
case 'NT': return 'NT'
case 'XP': return 'XP'
case 'NT 5.0': return '2000'
case 'NT 5.1': return 'XP'
case 'NT 5.2': return '2003'
case 'NT 6.0': return 'Vista'
case 'NT 6.1': return '7'
case 'NT 6.2': return '8'
case 'NT 6.3': return '8.1'
case 'NT 10.0': return '10'
default: return undefined
}
}
// OS version extraction
var osVersion = '';
if (result.windows) {
osVersion = getWindowsVersion(getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i))
} else if (result.windowsphone) {
osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i);
} else if (result.mac) {
osVersion = getFirstMatch(/Mac OS X (\d+([_\.\s]\d+)*)/i);
osVersion = osVersion.replace(/[_\s]/g, '.');
} else if (iosdevice) {
osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i);
osVersion = osVersion.replace(/[_\s]/g, '.');
} else if (android) {
osVersion = getFirstMatch(/android[ \/-](\d+(\.\d+)*)/i);
} else if (result.webos) {
osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i);
} else if (result.blackberry) {
osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i);
} else if (result.bada) {
osVersion = getFirstMatch(/bada\/(\d+(\.\d+)*)/i);
} else if (result.tizen) {
osVersion = getFirstMatch(/tizen[\/\s](\d+(\.\d+)*)/i);
}
if (osVersion) {
result.osversion = osVersion;
}
// device type extraction
var osMajorVersion = !result.windows && osVersion.split('.')[0];
if (
tablet
|| nexusTablet
|| iosdevice == 'ipad'
|| (android && (osMajorVersion == 3 || (osMajorVersion >= 4 && !mobile)))
|| result.silk
) {
result.tablet = t
} else if (
mobile
|| iosdevice == 'iphone'
|| iosdevice == 'ipod'
|| android
|| nexusMobile
|| result.blackberry
|| result.webos
|| result.bada
) {
result.mobile = t
}
// Graded Browser Support
// http://developer.yahoo.com/yui/articles/gbs
if (result.msedge ||
(result.msie && result.version >= 10) ||
(result.yandexbrowser && result.version >= 15) ||
(result.vivaldi && result.version >= 1.0) ||
(result.chrome && result.version >= 20) ||
(result.samsungBrowser && result.version >= 4) ||
(result.firefox && result.version >= 20.0) ||
(result.safari && result.version >= 6) ||
(result.opera && result.version >= 10.0) ||
(result.ios && result.osversion && result.osversion.split(".")[0] >= 6) ||
(result.blackberry && result.version >= 10.1)
|| (result.chromium && result.version >= 20)
) {
result.a = t;
}
else if ((result.msie && result.version < 10) ||
(result.chrome && result.version < 20) ||
(result.firefox && result.version < 20.0) ||
(result.safari && result.version < 6) ||
(result.opera && result.version < 10.0) ||
(result.ios && result.osversion && result.osversion.split(".")[0] < 6)
|| (result.chromium && result.version < 20)
) {
result.c = t
} else result.x = t
return result
}
var bowser = detect(typeof navigator !== 'undefined' ? navigator.userAgent || '' : '')
bowser.test = function (browserList) {
for (var i = 0; i < browserList.length; ++i) {
var browserItem = browserList[i];
if (typeof browserItem=== 'string') {
if (browserItem in bowser) {
return true;
}
}
}
return false;
}
/**
* Get version precisions count
*
* @example
* getVersionPrecision("1.10.3") // 3
*
* @param {string} version
* @return {number}
*/
function getVersionPrecision(version) {
return version.split(".").length;
}
/**
* Array::map polyfill
*
* @param {Array} arr
* @param {Function} iterator
* @return {Array}
*/
function map(arr, iterator) {
var result = [], i;
if (Array.prototype.map) {
return Array.prototype.map.call(arr, iterator);
}
for (i = 0; i < arr.length; i++) {
result.push(iterator(arr[i]));
}
return result;
}
/**
* Calculate browser version weight
*
* @example
* compareVersions(['1.10.2.1', '1.8.2.1.90']) // 1
* compareVersions(['1.010.2.1', '1.09.2.1.90']); // 1
* compareVersions(['1.10.2.1', '1.10.2.1']); // 0
* compareVersions(['1.10.2.1', '1.0800.2']); // -1
*
* @param {Array<String>} versions versions to compare
* @return {Number} comparison result
*/
function compareVersions(versions) {
// 1) get common precision for both versions, for example for "10.0" and "9" it should be 2
var precision = Math.max(getVersionPrecision(versions[0]), getVersionPrecision(versions[1]));
var chunks = map(versions, function (version) {
var delta = precision - getVersionPrecision(version);
// 2) "9" -> "9.0" (for precision = 2)
version = version + new Array(delta + 1).join(".0");
// 3) "9.0" -> ["000000000"", "000000009"]
return map(version.split("."), function (chunk) {
return new Array(20 - chunk.length).join("0") + chunk;
}).reverse();
});
// iterate in reverse order by reversed chunks array
while (--precision >= 0) {
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
if (chunks[0][precision] > chunks[1][precision]) {
return 1;
}
else if (chunks[0][precision] === chunks[1][precision]) {
if (precision === 0) {
// all version chunks are same
return 0;
}
}
else {
return -1;
}
}
}
/**
* Check if browser is unsupported
*
* @example
* bowser.isUnsupportedBrowser({
* msie: "10",
* firefox: "23",
* chrome: "29",
* safari: "5.1",
* opera: "16",
* phantom: "534"
* });
*
* @param {Object} minVersions map of minimal version to browser
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map
* @param {String} [ua] user agent string
* @return {Boolean}
*/
function isUnsupportedBrowser(minVersions, strictMode, ua) {
var _bowser = bowser;
// make strictMode param optional with ua param usage
if (typeof strictMode === 'string') {
ua = strictMode;
strictMode = void(0);
}
if (strictMode === void(0)) {
strictMode = false;
}
if (ua) {
_bowser = detect(ua);
}
var version = "" + _bowser.version;
for (var browser in minVersions) {
if (minVersions.hasOwnProperty(browser)) {
if (_bowser[browser]) {
if (typeof minVersions[browser] !== 'string') {
throw new Error('Browser version in the minVersion map should be a string: ' + browser + ': ' + String(minVersions));
}
// browser version and min supported version.
return compareVersions([version, minVersions[browser]]) < 0;
}
}
}
return strictMode; // not found
}
/**
* Check if browser is supported
*
* @param {Object} minVersions map of minimal version to browser
* @param {Boolean} [strictMode = false] flag to return false if browser wasn't found in map
* @param {String} [ua] user agent string
* @return {Boolean}
*/
function check(minVersions, strictMode, ua) {
return !isUnsupportedBrowser(minVersions, strictMode, ua);
}
bowser.isUnsupportedBrowser = isUnsupportedBrowser;
bowser.compareVersions = compareVersions;
bowser.check = check;
/*
* Set our detect method to the main bowser object so we can
* reuse it to test other user agents.
* This is needed to implement future tests.
*/
bowser._detect = detect;
/*
* Set our detect public method to the main bowser object
* This is needed to implement bowser in server side
*/
bowser.detect = detect;
return bowser
});

View File

@@ -0,0 +1,151 @@
/**
* Loop through all entries in our user agents object and test everything.
*
* @see src/useragents.js
* @author hannes.diercks@jimdo.com
*/
var g
, ua
, p
, assert = require('assert')
, browser = require('../src/bowser')
, allUserAgents = require('../src/useragents').useragents
/**
* Get the length of an object.
* http://stackoverflow.com/questions/5223/length-of-javascript-object-ie-associative-array
*
* @param {Object} obj
* @return {Number}
*/
function objLength(obj) {
var size = 0
, key
for (key in obj) {
if (obj.hasOwnProperty(key)) size++
}
return size
}
function objKeys(obj) {
var keys = []
, key
for (key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key)
}
}
keys.sort();
return keys.join(', ')
}
/* Groups */
for (g in allUserAgents) { (function(group, userAgents) {
describe(group, function() {
/* User Agents */
for (ua in userAgents) { (function(userAgent, expections) {
describe('user agent "' + userAgent + '"', function() {
expections.name = group
/* Get the result from bowser. */
var result = browser._detect(userAgent)
/* At first, check if the result has the correct length. */
it('should have ' + objLength(expections) + ' properties', function() {
assert.equal(objKeys(result), objKeys(expections))
})
/* Properties */
for (p in expections) { (function(property, value, resultValue) {
/* Now ensure correctness of every property. */
it('\'s Property "' + property + '" should be ' + value, function() {
assert.equal(resultValue, value)
})
})(p, expections[p], result[p])}
})
})(ua, userAgents[ua])}
})
})(g, allUserAgents[g])}
var comparisionsTasks = [
['9.0', '10', -1],
['11', '10', 1],
['1.10.2.1', '1.8.2.1.90', 1],
['1.010.2.1', '1.08.2.1.90', 1],
['1.10.2.1', '1.10.2.1', 0],
['1.10.2.1', '1.0800.2', -1],
['1.0.0-alpha', '1.0.0-alpha.1', -1],
['1.0.0-alpha.1', '1.0.0-alpha.beta', -1],
['1.0.0-alpha.beta', '1.0.0-beta', -1],
['1.0.0-beta', '1.0.0-beta.2', -1],
['1.0.0-beta.11', '1.0.0-rc.1', -1],
['1.0.0-rc.1', '1.0.0', -1]
];
describe('Browser versions comparision', function() {
for(g in comparisionsTasks) {
var task = comparisionsTasks[g],
version = task[0],
version2 = task[1],
matching = task[2] === 0 ? ' == ' : (task[2] > 0) ? ' > ' : ' < ';
it('version ' + version + ' should be' + matching + 'version ' + version2, function(){
assert.equal(browser.compareVersions([version, version2]), task[2]);
});
}
});
describe('Unsupported browser check', function() {
before(function() {
this.ie10_6 = "Mozilla/5.0 (compatible; MSIE 10.6; Windows NT 6.1; Trident/5.0; InfoPath.2; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 2.0.50727) 3gpp-gba UNTRUSTED/1.0";
});
it('should be passed by #isUnsupportedBrowser for IE10.6 and for IE10 miminal version specified', function() {
var unsupported = browser.isUnsupportedBrowser({msie: "10"}, this.ie10_6);
assert.equal(unsupported, false);
});
it('should be passed by #isUnsupportedBrowser for IE10.6 and for IE10 miminal version specified in strict mode', function() {
var unsupported = browser.isUnsupportedBrowser({msie: "10"}, true, this.ie10_6);
assert.equal(unsupported, false);
});
it('should NOT be passed by #isUnsupportedBrowser for IE10.6 and for IE10 miminal version specified in strict mode', function() {
var isUnsupported = browser.isUnsupportedBrowser({msie: "11"}, true, this.ie10_6);
assert.equal(isUnsupported, true);
});
it('should NOT be passed by #check for IE10.6 and for IE11 miminal version specified', function() {
var supported = browser.check({msie: "11"}, this.ie10_6);
assert.equal(supported, false);
});
it('should NOT be passed by #check for IE10.6 and for IE11 miminal version specified in strict mode', function() {
var supported = browser.check({msie: "11"}, true, this.ie10_6);
assert.equal(supported, false);
});
it('should throw an error when minVersion map has a number, but not a string', function() {
assert.throws(() => {
browser.check({msie: 11}, this.ie10_6);
}, /Browser version in the minVersion map should be a string/);
});
it('should be passed by #check for IE10.6 when version was not specified', function() {
var supported = browser.check({}, this.ie10_6);
assert.equal(supported, true);
});
it('should NOT be passed by #check for IE10.6 when version was not specified in strict mode', function() {
var supported = browser.check({}, true, this.ie10_6);
assert.equal(supported, false);
});
})

View File

@@ -0,0 +1,106 @@
// Type definitions for Bowser 1.x
// Project: https://github.com/lancedikson/bowser
// Definitions by: Paulo Cesar <https://github.com/pocesar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const bowser: bowser.IBowser;
export = bowser;
export as namespace bowser;
declare namespace bowser {
export interface IBowserOS {
mac: boolean;
/**other than Windows Phone */
windows: boolean;
windowsphone: boolean;
/**other than android, chromeos, webos, tizen, and sailfish */
linux: boolean;
chromeos: boolean;
android: boolean;
/** also sets one of iphone/ipad/ipod */
ios: boolean;
blackberry: boolean;
firefoxos: boolean;
/** may also set touchpad */
webos: boolean;
bada: boolean;
tizen: boolean;
sailfish: boolean;
}
export interface IBowserVersions {
chrome: boolean;
chromium: boolean;
firefox: boolean;
msie: boolean;
msedge: boolean;
safari: boolean;
android: boolean;
ios: boolean;
opera: boolean;
phantom: boolean;
blackberry: boolean;
webos: boolean;
silk: boolean;
bada: boolean;
tizen: boolean;
seamonkey: boolean;
sailfish: boolean;
ucbrowser: boolean;
qupzilla: boolean;
vivaldi: boolean;
sleipnir: boolean;
kMeleon: boolean;
}
export interface IBowserEngines {
/** IE <= 11 */
msie: boolean;
/**Chrome 0-27, Android <4.4, iOs, BB, etc. */
webkit: boolean;
/**Chrome >=28, Android >=4.4, Opera, etc. */
blink: boolean;
/**Firefox, etc. */
gecko: boolean;
/** IE > 11 */
msedge: boolean;
/** If a tablet device is detected, the flag tablet is set instead of mobile. */
tablet: boolean;
/** All detected mobile OSes are additionally flagged mobile, unless it's a tablet */
mobile: boolean;
}
export interface IBowserGrade {
/** Grade A browser */
a: boolean;
/** Grade C browser */
c: boolean;
/** Grade X browser */
x: boolean;
/**A human readable name for this browser. E.g. 'Chrome', '' */
name: string;
/**Version number for the browser. E.g. '32.0' */
version: string|number;
osversion: string|number;
}
export interface IBowserDetection extends IBowserGrade, IBowserEngines, IBowserOS, IBowserVersions { }
export interface IBowserMinVersions {
// { msie: "11", "firefox": "4" }
[index: string]: string;
}
export interface IBowser extends IBowserDetection {
(): IBowserDetection;
test(browserList: string[]): boolean;
_detect(ua: string): IBowser;
detect(ua: string): IBowser;
compareVersions(versions: string[]): number;
check(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): Boolean;
isUnsupportedBrowser(minVersions: IBowserMinVersions, strictMode?: boolean|string, ua?: string): boolean;
}
}

View File

@@ -0,0 +1,17 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

View File

@@ -0,0 +1,75 @@
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules
# Users Environment Variables
.lock-wscript
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# Windows
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -0,0 +1,20 @@
module.exports = function chain(){
var len = arguments.length
var args = [];
for (var i = 0; i < len; i++)
args[i] = arguments[i]
args = args.filter(function(fn){ return fn != null })
if (args.length === 0) return undefined
if (args.length === 1) return args[0]
return args.reduce(function(current, next){
return function chainedFunction() {
current.apply(this, arguments);
next.apply(this, arguments);
};
})
}

View File

@@ -0,0 +1,51 @@
{
"_from": "chain-function@^1.0.0",
"_id": "chain-function@1.0.0",
"_inBundle": false,
"_integrity": "sha1-DUqzfn4Y6tC9xHuSB2QRjOWHM9w=",
"_location": "/react-toastify/chain-function",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "chain-function@^1.0.0",
"name": "chain-function",
"escapedName": "chain-function",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/react-toastify/react-transition-group"
],
"_resolved": "https://registry.npmjs.org/chain-function/-/chain-function-1.0.0.tgz",
"_shasum": "0d4ab37e7e18ead0bdc47b920764118ce58733dc",
"_spec": "chain-function@^1.0.0",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-toastify\\node_modules\\react-transition-group",
"author": {
"name": "jquense"
},
"bugs": {
"url": "https://github.com/jquense/chain-function/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "chain a bunch of functions together into a single call",
"homepage": "https://github.com/jquense/chain-function#readme",
"keywords": [
"chain",
"compose",
"function"
],
"license": "MIT",
"main": "index.js",
"name": "chain-function",
"repository": {
"type": "git",
"url": "git+https://github.com/jquense/chain-function.git"
},
"scripts": {
"test": "node ./test.js"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,29 @@
var assert = require('assert')
var chain = require('./index')
console.log('testing...')
var count = 0;
chain(
function(step){ count += step },
function(step){ count += step },
function(step){ count += step }
)(1)
assert.equal(count, 3, 'should chain calls')
count = 0;
chain(
function(step){ count += step },
null, undefined,
function(step){ count += step }
)(1)
assert.equal(count, 2, 'should filter out null and undefined arguments')
var fn = function(){}
assert.equal(chain(fn, null), fn, 'should return the only function argument')
console.log('done. tests pass!')

View File

@@ -0,0 +1,21 @@
# Contributing
Thanks for your interest in classNames. Issues, PRs and suggestions welcome :)
Before working on a PR, please consider the following:
* Speed is a serious concern for this package as it is likely to be called a
significant number of times in any project that uses it. As such, new features
will only be accepted if they improve (or at least do not negatively impact)
performance.
* To demonstrate performance differences please set up a
[JSPerf](http://jsperf.com) test and link to it from your issue / PR.
* Tests must be added for any change or new feature before it will be accepted.
A benchmark utilitiy is included so that changes may be tested against the
current published version. To run the benchmarks, `npm install` in the
`./benchmarks` directory then run `npm run benchmarks` in the package root.
Please be aware though that local benchmarks are just a smoke-signal; they will
run in the v8 version that your node/iojs uses, while classNames is _most_
often run across a wide variety of browsers and browser versions.

View File

@@ -0,0 +1,81 @@
# Changelog
## v2.2.5 / 2016-05-02
* Improved performance of `dedupe` variant even further, thanks [Andres Suarez](https://github.com/zertosh)
## v2.2.4 / 2016-04-25
* Improved performance of `dedupe` variant by about 2x, thanks [Bartosz Gościński](https://github.com/bgoscinski)
## v2.2.3 / 2016-01-05
* Updated `bind` variant to use `[].join(' ')` as per the main script in 2.2.2
## v2.2.2 / 2016-01-04
* Switched from string concatenation to `[].join(' ')` for a slight performance gain in the main function.
## v2.2.1 / 2015-11-26
* Add deps parameter to the AMD module, fixes an issue using the Dojo loader, thanks [Chris Jordan](https://github.com/flipperkid)
## v2.2.0 / 2015-10-18
* added a new `bind` variant for use with [css-modules](https://github.com/css-modules/css-modules) and similar abstractions, thanks to [Kirill Yakovenko](https://github.com/blia)
## v2.1.5 / 2015-09-30
* reverted a new usage of `Object.keys` in `dedupe.js` that slipped through in the last release
## v2.1.4 / 2015-09-30
* new case added to benchmarks
* safer `hasOwnProperty` check
* AMD module is now named, so you can do the following:
```
define(["classnames"], function (classNames) {
var style = classNames("foo", "bar");
// ...
});
```
## v2.1.3 / 2015-07-02
* updated UMD wrapper to support AMD and CommonJS on the same pacge
## v2.1.2 / 2015-05-28
* added a proper UMD wrapper
## v2.1.1 / 2015-05-06
* minor performance improvement thanks to type caching
* improved benchmarking and results output
## v2.1.0 / 2015-05-05
* added alternate `dedupe` version of classNames, which is slower (10x) but ensures that if a class is added then overridden by a falsy value in a subsequent argument, it is excluded from the result.
## v2.0.0 / 2015-05-03
* performance improvement; switched to `Array.isArray` for type detection, which is much faster in modern browsers. A polyfill is now required for IE8 support, see the Readme for details.
## v1.2.2 / 2015-04-28
* license comment updates to simiplify certain build scenarios
## v1.2.1 / 2015-04-22
* added safe exporting for requireJS usage
* clarified Bower usage and instructions
## v1.2.0 / 2015-03-17
* added comprehensive support for array arguments, including nested arrays
* simplified code slightly
## Previous
Please see the git history for the details of previous versions.

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Jed Watson
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,188 @@
Classnames
===========
[![Version](http://img.shields.io/npm/v/classnames.svg)](https://www.npmjs.org/package/classnames)
[![Build Status](https://travis-ci.org/JedWatson/classnames.svg?branch=master)](https://travis-ci.org/JedWatson/classnames)
A simple javascript utility for conditionally joining classNames together.
Install with npm or Bower.
```sh
npm install classnames
```
Use with node.js, browserify or webpack:
```js
var classNames = require('classnames');
classNames('foo', 'bar'); // => 'foo bar'
```
Alternatively, you can simply include `index.js` on your page with a standalone `<script>` tag and it will export a global `classNames` method, or define the module if you are using RequireJS.
### Project philosophy
We take the stability and performance of this package seriously, because it is run millions of times a day in browsers all around the world. Updates are thoroughly reviewed for performance impacts before being released, and we have a comprehensive test suite.
Classnames follows the [SemVer](http://semver.org/) standard for versioning.
There is also a [Changelog](https://github.com/JedWatson/classnames/blob/master/HISTORY.md).
## Usage
The `classNames` function takes any number of arguments which can be a string or object.
The argument `'foo'` is short for `{ foo: true }`. If the value of the key is falsy, it won't be included in the output.
```js
classNames('foo', 'bar'); // => 'foo bar'
classNames('foo', { bar: true }); // => 'foo bar'
classNames({ 'foo-bar': true }); // => 'foo-bar'
classNames({ 'foo-bar': false }); // => ''
classNames({ foo: true }, { bar: true }); // => 'foo bar'
classNames({ foo: true, bar: true }); // => 'foo bar'
// lots of arguments of various types
classNames('foo', { bar: true, duck: false }, 'baz', { quux: true }); // => 'foo bar baz quux'
// other falsy values are just ignored
classNames(null, false, 'bar', undefined, 0, 1, { baz: null }, ''); // => 'bar 1'
```
Arrays will be recursively flattened as per the rules above:
```js
var arr = ['b', { c: true, d: false }];
classNames('a', arr); // => 'a b c'
```
### Dynamic class names with ES2015
If you're in an environment that supports [computed keys](http://www.ecma-international.org/ecma-262/6.0/#sec-object-initializer) (available in ES2015 and Babel) you can use dynamic class names:
```js
let buttonType = 'primary';
classNames({ [`btn-${buttonType}`]: true });
```
### Usage with React.js
This package is the official replacement for `classSet`, which was originally shipped in the React.js Addons bundle.
One of its primary use cases is to make dynamic and conditional className props simpler to work with (especially more so than conditional string manipulation). So where you may have the following code to generate a `className` prop for a `<button>` in React:
```js
var Button = React.createClass({
// ...
render () {
var btnClass = 'btn';
if (this.state.isPressed) btnClass += ' btn-pressed';
else if (this.state.isHovered) btnClass += ' btn-over';
return <button className={btnClass}>{this.props.label}</button>;
}
});
```
You can express the conditional classes more simply as an object:
```js
var classNames = require('classnames');
var Button = React.createClass({
// ...
render () {
var btnClass = classNames({
'btn': true,
'btn-pressed': this.state.isPressed,
'btn-over': !this.state.isPressed && this.state.isHovered
});
return <button className={btnClass}>{this.props.label}</button>;
}
});
```
Because you can mix together object, array and string arguments, supporting optional className props is also simpler as only truthy arguments get included in the result:
```js
var btnClass = classNames('btn', this.props.className, {
'btn-pressed': this.state.isPressed,
'btn-over': !this.state.isPressed && this.state.isHovered
});
```
### Alternate `dedupe` version
There is an alternate version of `classNames` available which correctly dedupes classes and ensures that falsy classes specified in later arguments are excluded from the result set.
This version is slower (about 5x) so it is offered as an opt-in.
To use the dedupe version with node, browserify or webpack:
```js
var classNames = require('classnames/dedupe');
classNames('foo', 'foo', 'bar'); // => 'foo bar'
classNames('foo', { foo: false, bar: true }); // => 'bar'
```
For standalone (global / AMD) use, include `dedupe.js` in a `<script>` tag on your page.
### Alternate `bind` version (for [css-modules](https://github.com/css-modules/css-modules))
If you are using [css-modules](https://github.com/css-modules/css-modules), or a similar approach to abstract class "names" and the real `className` values that are actually output to the DOM, you may want to use the `bind` variant.
_Note that in ES2015 environments, it may be better to use the "dynamic class names" approach documented above._
```js
var classNames = require('classnames/bind');
var styles = {
foo: 'abc',
bar: 'def',
baz: 'xyz'
};
var cx = classNames.bind(styles);
var className = cx('foo', ['bar'], { baz: true }); // => "abc def xyz"
```
Real-world example:
```js
/* components/submit-button.js */
import { Component } from 'react';
import classNames from 'classnames/bind';
import styles from './submit-button.css';
let cx = classNames.bind(styles);
export default class SubmitButton extends Component {
render () {
let text = this.props.store.submissionInProgress ? 'Processing...' : 'Submit';
let className = cx({
base: true,
inProgress: this.props.store.submissionInProgress,
error: this.props.store.errorOccurred,
disabled: this.props.form.valid,
});
return <button className={className}>{text}</button>;
}
};
```
## Polyfills needed to support older browsers
#### `classNames >=2.0.0`
`Array.isArray`: see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) for details about unsupported older browsers (e.g. <= IE8) and a simple polyfill.
`Object.keys`: see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) for details about unsupported older browsers (e.g. <= IE8) and a simple polyfill. This is only used in `dedupe.js`.
## License
[MIT](LICENSE). Copyright (c) 2016 Jed Watson.

View File

@@ -0,0 +1,48 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(this && this[arg] || arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(this, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(this && this[key] || key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,37 @@
{
"name": "classnames",
"version": "2.2.5",
"description": "A simple utility for conditionally joining classNames together",
"main": [
"index.js",
"bind.js",
"dedupe.js"
],
"homepage": "https://github.com/JedWatson/classnames",
"authors": [
"Jed Watson"
],
"moduleType": [
"amd",
"globals",
"node"
],
"keywords": [
"react",
"css",
"classes",
"classname",
"classnames",
"util",
"utility"
],
"license": "MIT",
"ignore": [
".editorconfig",
".gitignore",
"gulpfile.js",
"package.json",
"node_modules",
"tests.js"
]
}

View File

@@ -0,0 +1,109 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var classNames = (function () {
// don't inherit from Object so we can skip hasOwnProperty check later
// http://stackoverflow.com/questions/15518328/creating-js-object-with-object-createnull#answer-21079232
function StorageObject() {}
StorageObject.prototype = Object.create(null);
function _parseArray (resultSet, array) {
var length = array.length;
for (var i = 0; i < length; ++i) {
_parse(resultSet, array[i]);
}
}
var hasOwn = {}.hasOwnProperty;
function _parseNumber (resultSet, num) {
resultSet[num] = true;
}
function _parseObject (resultSet, object) {
for (var k in object) {
if (hasOwn.call(object, k)) {
// set value to false instead of deleting it to avoid changing object structure
// https://www.smashingmagazine.com/2012/11/writing-fast-memory-efficient-javascript/#de-referencing-misconceptions
resultSet[k] = !!object[k];
}
}
}
var SPACE = /\s+/;
function _parseString (resultSet, str) {
var array = str.split(SPACE);
var length = array.length;
for (var i = 0; i < length; ++i) {
resultSet[array[i]] = true;
}
}
function _parse (resultSet, arg) {
if (!arg) return;
var argType = typeof arg;
// 'foo bar'
if (argType === 'string') {
_parseString(resultSet, arg);
// ['foo', 'bar', ...]
} else if (Array.isArray(arg)) {
_parseArray(resultSet, arg);
// { 'foo': true, ... }
} else if (argType === 'object') {
_parseObject(resultSet, arg);
// '130'
} else if (argType === 'number') {
_parseNumber(resultSet, arg);
}
}
function _classNames () {
// don't leak arguments
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers#32-leaking-arguments
var len = arguments.length;
var args = Array(len);
for (var i = 0; i < len; i++) {
args[i] = arguments[i];
}
var classSet = new StorageObject();
_parseArray(classSet, args);
var list = [];
for (var k in classSet) {
if (classSet[k]) {
list.push(k)
}
}
return list.join(' ');
}
return _classNames;
})();
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,48 @@
/*!
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/
/* global define */
(function () {
'use strict';
var hasOwn = {}.hasOwnProperty;
function classNames () {
var classes = [];
for (var i = 0; i < arguments.length; i++) {
var arg = arguments[i];
if (!arg) continue;
var argType = typeof arg;
if (argType === 'string' || argType === 'number') {
classes.push(arg);
} else if (Array.isArray(arg)) {
classes.push(classNames.apply(null, arg));
} else if (argType === 'object') {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key);
}
}
}
}
return classes.join(' ');
}
if (typeof module !== 'undefined' && module.exports) {
module.exports = classNames;
} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
// register as 'classnames', consistent with npm package name
define('classnames', [], function () {
return classNames;
});
} else {
window.classNames = classNames;
}
}());

View File

@@ -0,0 +1,61 @@
{
"_from": "classnames@^2.2.5",
"_id": "classnames@2.2.5",
"_inBundle": false,
"_integrity": "sha1-+zgB1FNGdknvNgPH1hoCvRKb3m0=",
"_location": "/react-toastify/classnames",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "classnames@^2.2.5",
"name": "classnames",
"escapedName": "classnames",
"rawSpec": "^2.2.5",
"saveSpec": null,
"fetchSpec": "^2.2.5"
},
"_requiredBy": [
"/react-toastify/react-transition-group"
],
"_resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.5.tgz",
"_shasum": "fb3801d453467649ef3603c7d61a02bd129bde6d",
"_spec": "classnames@^2.2.5",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\goTorrentWebUI\\node_modules\\react-toastify\\node_modules\\react-transition-group",
"author": {
"name": "Jed Watson"
},
"bugs": {
"url": "https://github.com/JedWatson/classnames/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A simple utility for conditionally joining classNames together",
"devDependencies": {
"benchmark": "^1.0.0",
"mocha": "^2.1.0"
},
"homepage": "https://github.com/JedWatson/classnames#readme",
"keywords": [
"react",
"css",
"classes",
"classname",
"classnames",
"util",
"utility"
],
"license": "MIT",
"main": "index.js",
"name": "classnames",
"repository": {
"type": "git",
"url": "git+https://github.com/JedWatson/classnames.git"
},
"scripts": {
"benchmarks": "node ./benchmarks/run",
"test": "npm run unit",
"unit": "mocha tests/*.js"
},
"version": "2.2.5"
}

View File

@@ -0,0 +1,409 @@
## Changelog
##### 1.2.7 [LEGACY] - 2016.07.18
* some fixes for issues like #159, #186, #194, #207
##### 1.2.6 - 2015.11.09
* reject with `TypeError` on attempt resolve promise itself
* correct behavior with broken `Promise` subclass constructors / methods
* added `Promise`-based fallback for microtask
* fixed V8 and FF `Array#{values, @@iterator}.name`
* fixed IE7- `[1, 2].join(undefined) -> '1,2'`
* some other fixes / improvements / optimizations
##### 1.2.5 - 2015.11.02
* some more `Number` constructor fixes:
* fixed V8 ~ Node 0.8 bug: `Number('+0x1')` should be `NaN`
* fixed `Number(' 0b1\n')` case, should be `1`
* fixed `Number()` case, should be `0`
##### 1.2.4 - 2015.11.01
* fixed `Number('0b12') -> NaN` case in the shim
* fixed V8 ~ Chromium 40- bug - `Weak(Map|Set)#{delete, get, has}` should not throw errors [#124](https://github.com/zloirock/core-js/issues/124)
* some other fixes and optimizations
##### 1.2.3 - 2015.10.23
* fixed some problems related old V8 bug `Object('a').propertyIsEnumerable(0) // => false`, for example, `Object.assign({}, 'qwe')` from the last release
* fixed `.name` property and `Function#toString` conversion some polyfilled methods
* fixed `Math.imul` arity in Safari 8-
##### 1.2.2 - 2015.10.18
* improved optimisations for V8
* fixed build process from external packages, [#120](https://github.com/zloirock/core-js/pull/120)
* one more `Object.{assign, values, entries}` fix for [**very** specific case](https://github.com/ljharb/proposal-object-values-entries/issues/5)
##### 1.2.1 - 2015.10.02
* replaced fix `JSON.stringify` + `Symbol` behavior from `.toJSON` method to wrapping `JSON.stringify` - little more correct, [compat-table/642](https://github.com/kangax/compat-table/pull/642)
* fixed typo which broke tasks scheduler in WebWorkers in old FF, [#114](https://github.com/zloirock/core-js/pull/114)
##### 1.2.0 - 2015.09.27
* added browser [`Promise` rejection hook](#unhandled-rejection-tracking), [#106](https://github.com/zloirock/core-js/issues/106)
* added correct [`IsRegExp`](http://www.ecma-international.org/ecma-262/6.0/#sec-isregexp) logic to [`String#{includes, startsWith, endsWith}`](https://github.com/zloirock/core-js/#ecmascript-6-string) and [`RegExp` constructor](https://github.com/zloirock/core-js/#ecmascript-6-regexp), `@@match` case, [example](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/match#Disabling_the_isRegExp_check)
* updated [`String#leftPad`](https://github.com/zloirock/core-js/#ecmascript-7) [with proposal](https://github.com/ljharb/proposal-string-pad-left-right/issues/6): string filler truncated from the right side
* replaced V8 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object) - its properties order not only [incorrect](https://github.com/sindresorhus/object-assign/issues/22), it is non-deterministic and it causes some problems
* fixed behavior with deleted in getters properties for `Object.{`[`assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)`, `[`entries, values`](https://github.com/zloirock/core-js/#ecmascript-7)`}`, [example](http://goo.gl/iQE01c)
* fixed [`Math.sinh`](https://github.com/zloirock/core-js/#ecmascript-6-math) with very small numbers in V8 near Chromium 38
* some other fixes and optimizations
##### 1.1.4 - 2015.09.05
* fixed support symbols in FF34-35 [`Object.assign`](https://github.com/zloirock/core-js/#ecmascript-6-object)
* fixed [collections iterators](https://github.com/zloirock/core-js/#ecmascript-6-iterators) in FF25-26
* fixed non-generic WebKit [`Array.of`](https://github.com/zloirock/core-js/#ecmascript-6-array)
* some other fixes and optimizations
##### 1.1.3 - 2015.08.29
* fixed support Node.js domains in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise), [#103](https://github.com/zloirock/core-js/issues/103)
##### 1.1.2 - 2015.08.28
* added `toJSON` method to [`Symbol`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill and to MS Edge implementation for expected `JSON.stringify` result w/o patching this method
* replaced [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) implementations w/o correct support third argument
* fixed `global` detection with changed `document.domain` in ~IE8, [#100](https://github.com/zloirock/core-js/issues/100)
##### 1.1.1 - 2015.08.20
* added more correct microtask implementation for [`Promise`](#ecmascript-6-promise)
##### 1.1.0 - 2015.08.17
* updated [string padding](https://github.com/zloirock/core-js/#ecmascript-7) to [actual proposal](https://github.com/ljharb/proposal-string-pad-left-right) - renamed, minor internal changes:
* `String#lpad` -> `String#padLeft`
* `String#rpad` -> `String#padRight`
* added [string trim functions](#ecmascript-7) - [proposal](https://github.com/sebmarkbage/ecmascript-string-left-right-trim), defacto standard - required only for IE11- and fixed for some old engines:
* `String#trimLeft`
* `String#trimRight`
* [`String#trim`](https://github.com/zloirock/core-js/#ecmascript-6-string) fixed for some engines by es6 spec and moved from `es5` to single `es6` module
* splitted [`es6.object.statics-accept-primitives`](https://github.com/zloirock/core-js/#ecmascript-6-object)
* caps for `freeze`-family `Object` methods moved from `es5` to `es6` namespace and joined with [es6 wrappers](https://github.com/zloirock/core-js/#ecmascript-6-object)
* `es5` [namespace](https://github.com/zloirock/core-js/#commonjs) also includes modules, moved to `es6` namespace - you can use it as before
* increased `MessageChannel` priority in `$.task`, [#95](https://github.com/zloirock/core-js/issues/95)
* does not get `global.Symbol` on each getting iterator, if you wanna use alternative `Symbol` shim - add it before `core-js`
* [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) optimized and fixed for some cases
* simplified [`Reflect.enumerate`](https://github.com/zloirock/core-js/#ecmascript-6-reflect), see [this question](https://esdiscuss.org/topic/question-about-enumerate-and-property-decision-timing)
* some corrections in [`Math.acosh`](https://github.com/zloirock/core-js/#ecmascript-6-math)
* fixed [`Math.imul`](https://github.com/zloirock/core-js/#ecmascript-6-math) for old WebKit
* some fixes in string / RegExp [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp) logic
* some other fixes and optimizations
##### 1.0.1 - 2015.07.31
* some fixes for final MS Edge, replaced broken native `Reflect.defineProperty`
* some minor fixes and optimizations
* changed compression `client/*.min.js` options for safe `Function#name` and `Function#length`, should be fixed [#92](https://github.com/zloirock/core-js/issues/92)
##### 1.0.0 - 2015.07.22
* added logic for [well-known symbols](https://github.com/zloirock/core-js/#ecmascript-6-regexp):
* `Symbol.match`
* `Symbol.replace`
* `Symbol.split`
* `Symbol.search`
* actualized and optimized work with iterables:
* optimized [`Map`, `Set`, `WeakMap`, `WeakSet` constructors](https://github.com/zloirock/core-js/#ecmascript-6-collections), [`Promise.all`, `Promise.race`](https://github.com/zloirock/core-js/#ecmascript-6-promise) for default `Array Iterator`
* optimized [`Array.from`](https://github.com/zloirock/core-js/#ecmascript-6-array) for default `Array Iterator`
* added [`core.getIteratorMethod`](https://github.com/zloirock/core-js/#ecmascript-6-iterators) helper
* uses enumerable properties in shimmed instances - collections, iterators, etc for optimize performance
* added support native constructors to [`Reflect.construct`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) with 2 arguments
* added support native constructors to [`Function#bind`](https://github.com/zloirock/core-js/#ecmascript-5) shim with `new`
* removed obsolete `.clear` methods native [`Weak`-collections](https://github.com/zloirock/core-js/#ecmascript-6-collections)
* maximum modularity, reduced minimal custom build size, separated into submodules:
* [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect)
* [`es6.regexp`](https://github.com/zloirock/core-js/#ecmascript-6-regexp)
* [`es6.math`](https://github.com/zloirock/core-js/#ecmascript-6-math)
* [`es6.number`](https://github.com/zloirock/core-js/#ecmascript-6-number)
* [`es7.object.to-array`](https://github.com/zloirock/core-js/#ecmascript-7)
* [`core.object`](https://github.com/zloirock/core-js/#object)
* [`core.string`](https://github.com/zloirock/core-js/#escaping-html)
* [`core.iter-helpers`](https://github.com/zloirock/core-js/#ecmascript-6-iterators)
* internal modules (`$`, `$.iter`, etc)
* many other optimizations
* final cleaning non-standard features
* moved `$for` to [separate library](https://github.com/zloirock/forof). This work for syntax - `for-of` loop and comprehensions
* moved `Date#{format, formatUTC}` to [separate library](https://github.com/zloirock/dtf). Standard way for this - `ECMA-402`
* removed `Math` methods from `Number.prototype`. Slight sugar for simple `Math` methods calling
* removed `{Array#, Array, Dict}.turn`
* removed `core.global`
* uses `ToNumber` instead of `ToLength` in [`Number Iterator`](https://github.com/zloirock/core-js/#number-iterator), `Array.from(2.5)` will be `[0, 1, 2]` instead of `[0, 1]`
* fixed [#85](https://github.com/zloirock/core-js/issues/85) - invalid `Promise` unhandled rejection message in nested `setTimeout`
* fixed [#86](https://github.com/zloirock/core-js/issues/86) - support FF extensions
* fixed [#89](https://github.com/zloirock/core-js/issues/89) - behavior `Number` constructor in strange case
##### 0.9.18 - 2015.06.17
* removed `/` from [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) escaped characters
##### 0.9.17 - 2015.06.14
* updated [`RegExp.escape`](https://github.com/zloirock/core-js/#ecmascript-7) to the [latest proposal](https://github.com/benjamingr/RexExp.escape)
* fixed conflict with webpack dev server + IE buggy behavior
##### 0.9.16 - 2015.06.11
* more correct order resolving thenable in [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) polyfill
* uses polyfill instead of [buggy V8 `Promise`](https://github.com/zloirock/core-js/issues/78)
##### 0.9.15 - 2015.06.09
* [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) from `library` version return wrapped native instances
* fixed collections prototype methods in `library` version
* optimized [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math)
##### 0.9.14 - 2015.06.04
* updated [`Promise.resolve` behavior](https://esdiscuss.org/topic/fixing-promise-resolve)
* added fallback for IE11 buggy `Object.getOwnPropertyNames` + iframe
* some other fixes
##### 0.9.13 - 2015.05.25
* added fallback for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol) for old Android
* some other fixes
##### 0.9.12 - 2015.05.24
* different instances `core-js` should use / recognize the same symbols
* some fixes
##### 0.9.11 - 2015.05.18
* simplified [custom build](https://github.com/zloirock/core-js/#custom-build)
* add custom build js api
* added `grunt-cli` to `devDependencies` for `npm run grunt`
* some fixes
##### 0.9.10 - 2015.05.16
* wrapped `Function#toString` for correct work wrapped methods / constructors with methods similar to the [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197)
* added proto versions of methods to export object in `default` version for consistency with `library` version
##### 0.9.9 - 2015.05.14
* wrapped `Object#propertyIsEnumerable` for [`Symbol` polyfill](https://github.com/zloirock/core-js/#ecmascript-6-symbol)
* [added proto versions of methods to `library` for ES7 bind syntax](https://github.com/zloirock/core-js/issues/65)
* some other fixes
##### 0.9.8 - 2015.05.12
* fixed [`Math.hypot`](https://github.com/zloirock/core-js/#ecmascript-6-math) with negative arguments
* added `Object#toString.toString` as fallback for [`lodash` `isNative`](https://github.com/lodash/lodash/issues/1197)
##### 0.9.7 - 2015.05.07
* added [support DOM collections](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice#Streamlining_cross-browser_behavior) to IE8- `Array#slice`
##### 0.9.6 - 2015.05.01
* added [`String#lpad`, `String#rpad`](https://github.com/zloirock/core-js/#ecmascript-7)
##### 0.9.5 - 2015.04.30
* added cap for `Function#@@hasInstance`
* some fixes and optimizations
##### 0.9.4 - 2015.04.27
* fixed `RegExp` constructor
##### 0.9.3 - 2015.04.26
* some fixes and optimizations
##### 0.9.2 - 2015.04.25
* more correct [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking and resolving / rejection priority
##### 0.9.1 - 2015.04.25
* fixed `__proto__`-based [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) subclassing in some environments
##### 0.9.0 - 2015.04.24
* added correct [symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol) descriptors
* fixed behavior `Object.{assign, create, defineProperty, defineProperties, getOwnPropertyDescriptor, getOwnPropertyDescriptors}` with symbols
* added [single entry points](https://github.com/zloirock/core-js/#commonjs) for `Object.{create, defineProperty, defineProperties}`
* added [`Map#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7)
* removed non-standard methods `Object#[_]` and `Function#only` - they solves syntax problems, but now in compilers available arrows and ~~in near future will be available~~ [available](http://babeljs.io/blog/2015/05/14/function-bind/) [bind syntax](https://github.com/zenparsing/es-function-bind)
* removed non-standard undocumented methods `Symbol.{pure, set}`
* some fixes and internal changes
##### 0.8.4 - 2015.04.18
* uses `webpack` instead of `browserify` for browser builds - more compression-friendly result
##### 0.8.3 - 2015.04.14
* fixed `Array` statics with single entry points
##### 0.8.2 - 2015.04.13
* [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) now also works in IE9-
* added [`Set#toJSON`](https://github.com/zloirock/core-js/#ecmascript-7)
* some optimizations and fixes
##### 0.8.1 - 2015.04.03
* fixed `Symbol.keyFor`
##### 0.8.0 - 2015.04.02
* changed [CommonJS API](https://github.com/zloirock/core-js/#commonjs)
* splitted and renamed some modules
* added support ES3 environment (ES5 polyfill) to **all** default versions - size increases slightly (+ ~4kb w/o gzip), many issues disappear, if you don't need it - [simply include only required namespaces / features / modules](https://github.com/zloirock/core-js/#commonjs)
* removed [abstract references](https://github.com/zenparsing/es-abstract-refs) support - proposal has been superseded =\
* [`$for.isIterable` -> `core.isIterable`, `$for.getIterator` -> `core.getIterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), temporary available in old namespace
* fixed iterators support in v8 `Promise.all` and `Promise.race`
* many other fixes
##### 0.7.2 - 2015.03.09
* some fixes
##### 0.7.1 - 2015.03.07
* some fixes
##### 0.7.0 - 2015.03.06
* rewritten and splitted into [CommonJS modules](https://github.com/zloirock/core-js/#commonjs)
##### 0.6.1 - 2015.02.24
* fixed support [`Object.defineProperty`](https://github.com/zloirock/core-js/#ecmascript-5) with accessors on DOM elements on IE8
##### 0.6.0 - 2015.02.23
* added support safe closing iteration - calling `iterator.return` on abort iteration, if it exists
* added basic support [`Promise`](https://github.com/zloirock/core-js/#ecmascript-6-promise) unhandled rejection tracking in shim
* added [`Object.getOwnPropertyDescriptors`](https://github.com/zloirock/core-js/#ecmascript-7)
* removed `console` cap - creates too many problems - you can use [`core.log`](https://github.com/zloirock/core-js/#console) module as that
* restructuring [namespaces](https://github.com/zloirock/core-js/#custom-build)
* some fixes
##### 0.5.4 - 2015.02.15
* some fixes
##### 0.5.3 - 2015.02.14
* added [support binary and octal literals](https://github.com/zloirock/core-js/#ecmascript-6-number) to `Number` constructor
* added [`Date#toISOString`](https://github.com/zloirock/core-js/#ecmascript-5)
##### 0.5.2 - 2015.02.10
* some fixes
##### 0.5.1 - 2015.02.09
* some fixes
##### 0.5.0 - 2015.02.08
* systematization of modules
* splitted [`es6` module](https://github.com/zloirock/core-js/#ecmascript-6)
* splitted [`console` module](https://github.com/zloirock/core-js/#console): `web.console` - only cap for missing methods, `core.log` - bound methods & additional features
* added [`delay` method](https://github.com/zloirock/core-js/#delay)
* some fixes
##### 0.4.10 - 2015.01.28
* [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol) polyfill returns array of wrapped keys
##### 0.4.9 - 2015.01.27
* FF20-24 fix
##### 0.4.8 - 2015.01.25
* some [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) fixes
##### 0.4.7 - 2015.01.25
* added support frozen objects as [collections](https://github.com/zloirock/core-js/#ecmascript-6-collections) keys
##### 0.4.6 - 2015.01.21
* added [`Object.getOwnPropertySymbols`](https://github.com/zloirock/core-js/#ecmascript-6-symbol)
* added [`NodeList.prototype[@@iterator]`](https://github.com/zloirock/core-js/#ecmascript-6-iterators)
* added basic `@@species` logic - getter in native constructors
* removed `Function#by`
* some fixes
##### 0.4.5 - 2015.01.16
* some fixes
##### 0.4.4 - 2015.01.11
* enabled CSP support
##### 0.4.3 - 2015.01.10
* added `Function` instances `name` property for IE9+
##### 0.4.2 - 2015.01.10
* `Object` static methods accept primitives
* `RegExp` constructor can alter flags (IE9+)
* added `Array.prototype[Symbol.unscopables]`
##### 0.4.1 - 2015.01.05
* some fixes
##### 0.4.0 - 2015.01.03
* added [`es6.reflect`](https://github.com/zloirock/core-js/#ecmascript-6-reflect) module:
* added `Reflect.apply`
* added `Reflect.construct`
* added `Reflect.defineProperty`
* added `Reflect.deleteProperty`
* added `Reflect.enumerate`
* added `Reflect.get`
* added `Reflect.getOwnPropertyDescriptor`
* added `Reflect.getPrototypeOf`
* added `Reflect.has`
* added `Reflect.isExtensible`
* added `Reflect.preventExtensions`
* added `Reflect.set`
* added `Reflect.setPrototypeOf`
* `core-js` methods now can use external `Symbol.iterator` polyfill
* some fixes
##### 0.3.3 - 2014.12.28
* [console cap](https://github.com/zloirock/core-js/#console) excluded from node.js default builds
##### 0.3.2 - 2014.12.25
* added cap for [ES5](https://github.com/zloirock/core-js/#ecmascript-5) freeze-family methods
* fixed `console` bug
##### 0.3.1 - 2014.12.23
* some fixes
##### 0.3.0 - 2014.12.23
* Optimize [`Map` & `Set`](https://github.com/zloirock/core-js/#ecmascript-6-collections):
* use entries chain on hash table
* fast & correct iteration
* iterators moved to [`es6`](https://github.com/zloirock/core-js/#ecmascript-6) and [`es6.collections`](https://github.com/zloirock/core-js/#ecmascript-6-collections) modules
##### 0.2.5 - 2014.12.20
* `console` no longer shortcut for `console.log` (compatibility problems)
* some fixes
##### 0.2.4 - 2014.12.17
* better compliance of ES6
* added [`Math.fround`](https://github.com/zloirock/core-js/#ecmascript-6-math) (IE10+)
* some fixes
##### 0.2.3 - 2014.12.15
* [Symbols](https://github.com/zloirock/core-js/#ecmascript-6-symbol):
* added option to disable addition setter to `Object.prototype` for Symbol polyfill:
* added `Symbol.useSimple`
* added `Symbol.useSetter`
* added cap for well-known Symbols:
* added `Symbol.hasInstance`
* added `Symbol.isConcatSpreadable`
* added `Symbol.match`
* added `Symbol.replace`
* added `Symbol.search`
* added `Symbol.species`
* added `Symbol.split`
* added `Symbol.toPrimitive`
* added `Symbol.unscopables`
##### 0.2.2 - 2014.12.13
* added [`RegExp#flags`](https://github.com/zloirock/core-js/#ecmascript-6-regexp) ([December 2014 Draft Rev 29](http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts#december_6_2014_draft_rev_29))
* added [`String.raw`](https://github.com/zloirock/core-js/#ecmascript-6-string)
##### 0.2.1 - 2014.12.12
* repair converting -0 to +0 in [native collections](https://github.com/zloirock/core-js/#ecmascript-6-collections)
##### 0.2.0 - 2014.12.06
* added [`es7.proposals`](https://github.com/zloirock/core-js/#ecmascript-7) and [`es7.abstract-refs`](https://github.com/zenparsing/es-abstract-refs) modules
* added [`String#at`](https://github.com/zloirock/core-js/#ecmascript-7)
* added real [`String Iterator`](https://github.com/zloirock/core-js/#ecmascript-6-iterators), older versions used Array Iterator
* added abstract references support:
* added `Symbol.referenceGet`
* added `Symbol.referenceSet`
* added `Symbol.referenceDelete`
* added `Function#@@referenceGet`
* added `Map#@@referenceGet`
* added `Map#@@referenceSet`
* added `Map#@@referenceDelete`
* added `WeakMap#@@referenceGet`
* added `WeakMap#@@referenceSet`
* added `WeakMap#@@referenceDelete`
* added `Dict.{...methods}[@@referenceGet]`
* removed deprecated `.contains` methods
* some fixes
##### 0.1.5 - 2014.12.01
* added [`Array#copyWithin`](https://github.com/zloirock/core-js/#ecmascript-6-array)
* added [`String#codePointAt`](https://github.com/zloirock/core-js/#ecmascript-6-string)
* added [`String.fromCodePoint`](https://github.com/zloirock/core-js/#ecmascript-6-string)
##### 0.1.4 - 2014.11.27
* added [`Dict.mapPairs`](https://github.com/zloirock/core-js/#dict)
##### 0.1.3 - 2014.11.20
* [TC39 November meeting](https://github.com/rwaldron/tc39-notes/tree/master/es6/2014-11):
* [`.contains` -> `.includes`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-18.md#51--44-arrayprototypecontains-and-stringprototypecontains)
* `String#contains` -> [`String#includes`](https://github.com/zloirock/core-js/#ecmascript-6-string)
* `Array#contains` -> [`Array#includes`](https://github.com/zloirock/core-js/#ecmascript-7)
* `Dict.contains` -> [`Dict.includes`](https://github.com/zloirock/core-js/#dict)
* [removed `WeakMap#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm)
* [removed `WeakSet#clear`](https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-11/nov-19.md#412-should-weakmapweakset-have-a-clear-method-markm)
##### 0.1.2 - 2014.11.19
* `Map` & `Set` bug fix
##### 0.1.1 - 2014.11.18
* public release

View File

@@ -0,0 +1,2 @@
require('LiveScript');
module.exports = require('./build/Gruntfile');

View File

@@ -0,0 +1,19 @@
Copyright (c) 2015 Denis Pushkarev
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -0,0 +1,34 @@
{
"name": "core.js",
"main": "client/core.js",
"version": "1.2.7",
"description": "Standard Library",
"keywords": [
"ES6",
"ECMAScript 6",
"ES7",
"ECMAScript 7",
"Map",
"Set",
"WeakMap",
"WeakSet",
"Dict",
"Promise",
"Symbol",
"console"
],
"authors": [
"Denis Pushkarev <zloirock@zloirock.ru> (http://zloirock.ru/)"
],
"license": "MIT",
"homepage": "https://github.com/zloirock/core-js",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
},
"ignore": [
"build",
"node_modules",
"tests"
]
}

View File

@@ -0,0 +1,84 @@
require! <[./build fs ./config]>
library-tests = <[client/library.js tests/helpers.js tests/library.js]>map -> src: it
module.exports = (grunt)->
grunt.loadNpmTasks \grunt-contrib-clean
grunt.loadNpmTasks \grunt-contrib-copy
grunt.loadNpmTasks \grunt-contrib-uglify
grunt.loadNpmTasks \grunt-contrib-watch
grunt.loadNpmTasks \grunt-livescript
grunt.loadNpmTasks \grunt-karma
grunt.initConfig do
pkg: grunt.file.readJSON './package.json'
uglify: build:
files: '<%=grunt.option("path")%>.min.js': '<%=grunt.option("path")%>.js'
options:
mangle: {+sort, +keep_fnames}
compress: {+pure_getters, +keep_fargs, +keep_fnames}
sourceMap: on
banner: config.banner
livescript: src: files:
'./tests/helpers.js': './tests/helpers/*'
'./tests/tests.js': './tests/tests/*'
'./tests/library.js': './tests/library/*'
'./tests/es.js': './tests/tests/es*'
'./tests/experimental.js': './tests/experimental/*'
'./build/index.js': './build/build.ls*'
clean: <[./library]>
copy: lib: files:
* expand: on
cwd: './'
src: <[es5/** es6/** es7/** js/** web/** core/** fn/** index.js shim.js]>
dest: './library/'
* expand: on
cwd: './'
src: <[modules/*]>
dest: './library/'
filter: \isFile
* expand: on
cwd: './modules/library/'
src: '*'
dest: './library/modules/'
watch:
core:
files: './modules/*'
tasks: \default
tests:
files: './tests/tests/*'
tasks: \livescript
karma:
'options':
configFile: './tests/karma.conf.js'
browsers: <[PhantomJS]>
singleRun: on
'continuous': {}
'continuous-library':
files: library-tests
grunt.registerTask \build (options)->
done = @async!
err, it <- build {
modules: (options || 'es5,es6,es7,js,web,core')split \,
blacklist: (grunt.option(\blacklist) || '')split \,
library: !!grunt.option \library
}
if err
console.error err
process.exit 1
grunt.option(\path) || grunt.option(\path, './custom')
fs.writeFile grunt.option(\path) + '.js', it, done
grunt.registerTask \client ->
grunt.option \library ''
grunt.option \path './client/core'
grunt.task.run <[build:es5,es6,es7,js,web,core uglify]>
grunt.registerTask \library ->
grunt.option \library 'true'
grunt.option \path './client/library'
grunt.task.run <[build:es5,es6,es7,js,web,core uglify]>
grunt.registerTask \shim ->
grunt.option \library ''
grunt.option \path './client/shim'
grunt.task.run <[build:es5,es6,es7,js,web uglify]>
grunt.registerTask \e ->
grunt.option \library ''>
grunt.option \path './client/core'
grunt.task.run <[build:es5,es6,es7,js,web,core,exp uglify]>
grunt.registerTask \default <[clean copy client library shim]>

View File

@@ -0,0 +1,218 @@
require! {'./config': {banner}, fs: {readFile, writeFile, unlink}, path, webpack}
list = <[
es5
es6.symbol
es6.object.assign
es6.object.is
es6.object.set-prototype-of
es6.object.to-string
es6.object.freeze
es6.object.seal
es6.object.prevent-extensions
es6.object.is-frozen
es6.object.is-sealed
es6.object.is-extensible
es6.object.get-own-property-descriptor
es6.object.get-prototype-of
es6.object.keys
es6.object.get-own-property-names
es6.function.name
es6.function.has-instance
es6.number.constructor
es6.number.epsilon
es6.number.is-finite
es6.number.is-integer
es6.number.is-nan
es6.number.is-safe-integer
es6.number.max-safe-integer
es6.number.min-safe-integer
es6.number.parse-float
es6.number.parse-int
es6.math.acosh
es6.math.asinh
es6.math.atanh
es6.math.cbrt
es6.math.clz32
es6.math.cosh
es6.math.expm1
es6.math.fround
es6.math.hypot
es6.math.imul
es6.math.log10
es6.math.log1p
es6.math.log2
es6.math.sign
es6.math.sinh
es6.math.tanh
es6.math.trunc
es6.string.from-code-point
es6.string.raw
es6.string.trim
es6.string.code-point-at
es6.string.ends-with
es6.string.includes
es6.string.repeat
es6.string.starts-with
es6.string.iterator
es6.array.from
es6.array.of
es6.array.iterator
es6.array.species
es6.array.copy-within
es6.array.fill
es6.array.find
es6.array.find-index
es6.regexp.constructor
es6.regexp.flags
es6.regexp.match
es6.regexp.replace
es6.regexp.search
es6.regexp.split
es6.promise
es6.map
es6.set
es6.weak-map
es6.weak-set
es6.reflect.apply
es6.reflect.construct
es6.reflect.define-property
es6.reflect.delete-property
es6.reflect.enumerate
es6.reflect.get
es6.reflect.get-own-property-descriptor
es6.reflect.get-prototype-of
es6.reflect.has
es6.reflect.is-extensible
es6.reflect.own-keys
es6.reflect.prevent-extensions
es6.reflect.set
es6.reflect.set-prototype-of
es6.date.to-string
es6.typed.array-buffer
es6.typed.data-view
es6.typed.int8-array
es6.typed.uint8-array
es6.typed.uint8-clamped-array
es6.typed.int16-array
es6.typed.uint16-array
es6.typed.int32-array
es6.typed.uint32-array
es6.typed.float32-array
es6.typed.float64-array
es7.array.includes
es7.string.at
es7.string.pad-left
es7.string.pad-right
es7.string.trim-left
es7.string.trim-right
es7.regexp.escape
es7.object.get-own-property-descriptors
es7.object.values
es7.object.entries
es7.map.to-json
es7.set.to-json
web.immediate
web.dom.iterable
web.timers
core.dict
core.get-iterator-method
core.get-iterator
core.is-iterable
core.delay
core.function.part
core.object.is-object
core.object.classof
core.object.define
core.object.make
core.number.iterator
core.string.escape-html
core.string.unescape-html
core.log
js.array.statics
]>
experimental = <[
es6.date.to-string
es6.typed.array-buffer
es6.typed.data-view
es6.typed.int8-array
es6.typed.uint8-array
es6.typed.uint8-clamped-array
es6.typed.int16-array
es6.typed.uint16-array
es6.typed.int32-array
es6.typed.uint32-array
es6.typed.float32-array
es6.typed.float64-array
]>
libraryBlacklist = <[
es6.object.to-string
es6.function.name
es6.regexp.constructor
es6.regexp.flags
es6.regexp.match
es6.regexp.replace
es6.regexp.search
es6.regexp.split
es6.number.constructor
]>
es5SpecialCase = <[
es6.object.freeze
es6.object.seal
es6.object.prevent-extensions
es6.object.is-frozen
es6.object.is-sealed
es6.object.is-extensible
es6.string.trim
]>
module.exports = ({modules = [], blacklist = [], library = no}, next)!->
let @ = modules.reduce ((memo, it)-> memo[it] = on; memo), {}
check = (err)->
if err
next err, ''
on
if @exp => for experimental => @[..] = on
if @es5 => for es5SpecialCase => @[..] = on
for ns of @
if @[ns]
for name in list
if name.indexOf("#ns.") is 0 and name not in experimental
@[name] = on
if library => blacklist ++= libraryBlacklist
for ns in blacklist
for name in list
if name is ns or name.indexOf("#ns.") is 0
@[name] = no
TARGET = "./__tmp#{ Math.random! }__.js"
err, info <~! webpack do
entry: list.filter(~> @[it]).map ~>
path.join(__dirname, '../', "#{ if library => '/library' else '' }/modules/#it")
output:
path: ''
filename: TARGET
if check err => return
err, script <~! readFile TARGET
if check err => return
err <~! unlink TARGET
if check err => return
next null """
#banner
!function(__e, __g, undefined){
'use strict';
#script
// CommonJS export
if(typeof module != 'undefined' && module.exports)module.exports = __e;
// RequireJS export
else if(typeof define == 'function' && define.amd)define(function(){return __e});
// Export to global object
else __g.core = __e;
}(1, 1);
"""

View File

@@ -0,0 +1,8 @@
module.exports = {
banner: '/**\n' +
' * core-js ' + require('../package').version + '\n' +
' * https://github.com/zloirock/core-js\n' +
' * License: http://rock.mit-license.org\n' +
' * © ' + new Date().getFullYear() + ' Denis Pushkarev\n' +
' */'
};

View File

@@ -0,0 +1,98 @@
// Generated by LiveScript 1.3.1
(function(){
var banner, ref$, readFile, writeFile, unlink, path, webpack, list, experimental, libraryBlacklist, es5SpecialCase;
banner = require('./config').banner;
ref$ = require('fs'), readFile = ref$.readFile, writeFile = ref$.writeFile, unlink = ref$.unlink;
path = require('path');
webpack = require('webpack');
list = ['es5', 'es6.symbol', 'es6.object.assign', 'es6.object.is', 'es6.object.set-prototype-of', 'es6.object.to-string', 'es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.object.get-own-property-descriptor', 'es6.object.get-prototype-of', 'es6.object.keys', 'es6.object.get-own-property-names', 'es6.function.name', 'es6.function.has-instance', 'es6.number.constructor', 'es6.number.epsilon', 'es6.number.is-finite', 'es6.number.is-integer', 'es6.number.is-nan', 'es6.number.is-safe-integer', 'es6.number.max-safe-integer', 'es6.number.min-safe-integer', 'es6.number.parse-float', 'es6.number.parse-int', 'es6.math.acosh', 'es6.math.asinh', 'es6.math.atanh', 'es6.math.cbrt', 'es6.math.clz32', 'es6.math.cosh', 'es6.math.expm1', 'es6.math.fround', 'es6.math.hypot', 'es6.math.imul', 'es6.math.log10', 'es6.math.log1p', 'es6.math.log2', 'es6.math.sign', 'es6.math.sinh', 'es6.math.tanh', 'es6.math.trunc', 'es6.string.from-code-point', 'es6.string.raw', 'es6.string.trim', 'es6.string.code-point-at', 'es6.string.ends-with', 'es6.string.includes', 'es6.string.repeat', 'es6.string.starts-with', 'es6.string.iterator', 'es6.array.from', 'es6.array.of', 'es6.array.iterator', 'es6.array.species', 'es6.array.copy-within', 'es6.array.fill', 'es6.array.find', 'es6.array.find-index', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.promise', 'es6.map', 'es6.set', 'es6.weak-map', 'es6.weak-set', 'es6.reflect.apply', 'es6.reflect.construct', 'es6.reflect.define-property', 'es6.reflect.delete-property', 'es6.reflect.enumerate', 'es6.reflect.get', 'es6.reflect.get-own-property-descriptor', 'es6.reflect.get-prototype-of', 'es6.reflect.has', 'es6.reflect.is-extensible', 'es6.reflect.own-keys', 'es6.reflect.prevent-extensions', 'es6.reflect.set', 'es6.reflect.set-prototype-of', 'es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array', 'es7.array.includes', 'es7.string.at', 'es7.string.pad-left', 'es7.string.pad-right', 'es7.string.trim-left', 'es7.string.trim-right', 'es7.regexp.escape', 'es7.object.get-own-property-descriptors', 'es7.object.values', 'es7.object.entries', 'es7.map.to-json', 'es7.set.to-json', 'web.immediate', 'web.dom.iterable', 'web.timers', 'core.dict', 'core.get-iterator-method', 'core.get-iterator', 'core.is-iterable', 'core.delay', 'core.function.part', 'core.object.is-object', 'core.object.classof', 'core.object.define', 'core.object.make', 'core.number.iterator', 'core.string.escape-html', 'core.string.unescape-html', 'core.log', 'js.array.statics'];
experimental = ['es6.date.to-string', 'es6.typed.array-buffer', 'es6.typed.data-view', 'es6.typed.int8-array', 'es6.typed.uint8-array', 'es6.typed.uint8-clamped-array', 'es6.typed.int16-array', 'es6.typed.uint16-array', 'es6.typed.int32-array', 'es6.typed.uint32-array', 'es6.typed.float32-array', 'es6.typed.float64-array'];
libraryBlacklist = ['es6.object.to-string', 'es6.function.name', 'es6.regexp.constructor', 'es6.regexp.flags', 'es6.regexp.match', 'es6.regexp.replace', 'es6.regexp.search', 'es6.regexp.split', 'es6.number.constructor'];
es5SpecialCase = ['es6.object.freeze', 'es6.object.seal', 'es6.object.prevent-extensions', 'es6.object.is-frozen', 'es6.object.is-sealed', 'es6.object.is-extensible', 'es6.string.trim'];
module.exports = function(arg$, next){
var modules, ref$, blacklist, library;
modules = (ref$ = arg$.modules) != null
? ref$
: [], blacklist = (ref$ = arg$.blacklist) != null
? ref$
: [], library = (ref$ = arg$.library) != null ? ref$ : false;
(function(){
var check, i$, x$, ref$, len$, y$, ns, name, j$, len1$, TARGET, this$ = this;
check = function(err){
if (err) {
next(err, '');
return true;
}
};
if (this.exp) {
for (i$ = 0, len$ = (ref$ = experimental).length; i$ < len$; ++i$) {
x$ = ref$[i$];
this[x$] = true;
}
}
if (this.es5) {
for (i$ = 0, len$ = (ref$ = es5SpecialCase).length; i$ < len$; ++i$) {
y$ = ref$[i$];
this[y$] = true;
}
}
for (ns in this) {
if (this[ns]) {
for (i$ = 0, len$ = (ref$ = list).length; i$ < len$; ++i$) {
name = ref$[i$];
if (name.indexOf(ns + ".") === 0 && !in$(name, experimental)) {
this[name] = true;
}
}
}
}
if (library) {
blacklist = blacklist.concat(libraryBlacklist);
}
for (i$ = 0, len$ = blacklist.length; i$ < len$; ++i$) {
ns = blacklist[i$];
for (j$ = 0, len1$ = (ref$ = list).length; j$ < len1$; ++j$) {
name = ref$[j$];
if (name === ns || name.indexOf(ns + ".") === 0) {
this[name] = false;
}
}
}
TARGET = "./__tmp" + Math.random() + "__.js";
webpack({
entry: list.filter(function(it){
return this$[it];
}).map(function(it){
return path.join(__dirname, '../', (library ? '/library' : '') + "/modules/" + it);
}),
output: {
path: '',
filename: TARGET
}
}, function(err, info){
if (check(err)) {
return;
}
readFile(TARGET, function(err, script){
if (check(err)) {
return;
}
unlink(TARGET, function(err){
if (check(err)) {
return;
}
next(null, "" + banner + "\n!function(__e, __g, undefined){\n'use strict';\n" + script + "\n// CommonJS export\nif(typeof module != 'undefined' && module.exports)module.exports = __e;\n// RequireJS export\nelse if(typeof define == 'function' && define.amd)define(function(){return __e});\n// Export to global object\nelse __g.core = __e;\n}(1, 1);");
});
});
});
}.call(modules.reduce(function(memo, it){
memo[it] = true;
return memo;
}, {})));
};
function in$(x, xs){
var i = -1, l = xs.length >>> 0;
while (++i < l) if (x === xs[i]) return true;
return false;
}
}).call(this);

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
require('../modules/core.function.part');
module.exports = require('../modules/$.core')._;

View File

@@ -0,0 +1,2 @@
require('../modules/core.delay');
module.exports = require('../modules/$.core').delay;

View File

@@ -0,0 +1,2 @@
require('../modules/core.dict');
module.exports = require('../modules/$.core').Dict;

View File

@@ -0,0 +1,2 @@
require('../modules/core.function.part');
module.exports = require('../modules/$.core').Function;

View File

@@ -0,0 +1,15 @@
require('../modules/core.dict');
require('../modules/core.get-iterator-method');
require('../modules/core.get-iterator');
require('../modules/core.is-iterable');
require('../modules/core.delay');
require('../modules/core.function.part');
require('../modules/core.object.is-object');
require('../modules/core.object.classof');
require('../modules/core.object.define');
require('../modules/core.object.make');
require('../modules/core.number.iterator');
require('../modules/core.string.escape-html');
require('../modules/core.string.unescape-html');
require('../modules/core.log');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,2 @@
require('../modules/core.log');
module.exports = require('../modules/$.core').log;

View File

@@ -0,0 +1,2 @@
require('../modules/core.number.iterator');
module.exports = require('../modules/$.core').Number;

View File

@@ -0,0 +1,5 @@
require('../modules/core.object.is-object');
require('../modules/core.object.classof');
require('../modules/core.object.define');
require('../modules/core.object.make');
module.exports = require('../modules/$.core').Object;

View File

@@ -0,0 +1,3 @@
require('../modules/core.string.escape-html');
require('../modules/core.string.unescape-html');
module.exports = require('../modules/$.core').String;

View File

@@ -0,0 +1,9 @@
require('../modules/es5');
require('../modules/es6.object.freeze');
require('../modules/es6.object.seal');
require('../modules/es6.object.prevent-extensions');
require('../modules/es6.object.is-frozen');
require('../modules/es6.object.is-sealed');
require('../modules/es6.object.is-extensible');
require('../modules/es6.string.trim');
module.exports = require('../modules/$.core');

View File

@@ -0,0 +1,10 @@
require('../modules/es6.string.iterator');
require('../modules/es6.array.from');
require('../modules/es6.array.of');
require('../modules/es6.array.species');
require('../modules/es6.array.iterator');
require('../modules/es6.array.copy-within');
require('../modules/es6.array.fill');
require('../modules/es6.array.find');
require('../modules/es6.array.find-index');
module.exports = require('../modules/$.core').Array;

View File

@@ -0,0 +1,3 @@
require('../modules/es6.function.name');
require('../modules/es6.function.has-instance');
module.exports = require('../modules/$.core').Function;

View File

@@ -0,0 +1,87 @@
require('../modules/es6.symbol');
require('../modules/es6.object.assign');
require('../modules/es6.object.is');
require('../modules/es6.object.set-prototype-of');
require('../modules/es6.object.to-string');
require('../modules/es6.object.freeze');
require('../modules/es6.object.seal');
require('../modules/es6.object.prevent-extensions');
require('../modules/es6.object.is-frozen');
require('../modules/es6.object.is-sealed');
require('../modules/es6.object.is-extensible');
require('../modules/es6.object.get-own-property-descriptor');
require('../modules/es6.object.get-prototype-of');
require('../modules/es6.object.keys');
require('../modules/es6.object.get-own-property-names');
require('../modules/es6.function.name');
require('../modules/es6.function.has-instance');
require('../modules/es6.number.constructor');
require('../modules/es6.number.epsilon');
require('../modules/es6.number.is-finite');
require('../modules/es6.number.is-integer');
require('../modules/es6.number.is-nan');
require('../modules/es6.number.is-safe-integer');
require('../modules/es6.number.max-safe-integer');
require('../modules/es6.number.min-safe-integer');
require('../modules/es6.number.parse-float');
require('../modules/es6.number.parse-int');
require('../modules/es6.math.acosh');
require('../modules/es6.math.asinh');
require('../modules/es6.math.atanh');
require('../modules/es6.math.cbrt');
require('../modules/es6.math.clz32');
require('../modules/es6.math.cosh');
require('../modules/es6.math.expm1');
require('../modules/es6.math.fround');
require('../modules/es6.math.hypot');
require('../modules/es6.math.imul');
require('../modules/es6.math.log10');
require('../modules/es6.math.log1p');
require('../modules/es6.math.log2');
require('../modules/es6.math.sign');
require('../modules/es6.math.sinh');
require('../modules/es6.math.tanh');
require('../modules/es6.math.trunc');
require('../modules/es6.string.from-code-point');
require('../modules/es6.string.raw');
require('../modules/es6.string.trim');
require('../modules/es6.string.iterator');
require('../modules/es6.string.code-point-at');
require('../modules/es6.string.ends-with');
require('../modules/es6.string.includes');
require('../modules/es6.string.repeat');
require('../modules/es6.string.starts-with');
require('../modules/es6.array.from');
require('../modules/es6.array.of');
require('../modules/es6.array.species');
require('../modules/es6.array.iterator');
require('../modules/es6.array.copy-within');
require('../modules/es6.array.fill');
require('../modules/es6.array.find');
require('../modules/es6.array.find-index');
require('../modules/es6.regexp.constructor');
require('../modules/es6.regexp.flags');
require('../modules/es6.regexp.match');
require('../modules/es6.regexp.replace');
require('../modules/es6.regexp.search');
require('../modules/es6.regexp.split');
require('../modules/es6.promise');
require('../modules/es6.map');
require('../modules/es6.set');
require('../modules/es6.weak-map');
require('../modules/es6.weak-set');
require('../modules/es6.reflect.apply');
require('../modules/es6.reflect.construct');
require('../modules/es6.reflect.define-property');
require('../modules/es6.reflect.delete-property');
require('../modules/es6.reflect.enumerate');
require('../modules/es6.reflect.get');
require('../modules/es6.reflect.get-own-property-descriptor');
require('../modules/es6.reflect.get-prototype-of');
require('../modules/es6.reflect.has');
require('../modules/es6.reflect.is-extensible');
require('../modules/es6.reflect.own-keys');
require('../modules/es6.reflect.prevent-extensions');
require('../modules/es6.reflect.set');
require('../modules/es6.reflect.set-prototype-of');
module.exports = require('../modules/$.core');

Some files were not shown because too many files have changed in this diff Show More