export function isLocaleRtl( locale ) { if ( ! isString( locale ) ) { return null; } const language = getLanguage( locale ); if ( ! language ) { return null; } return Boolean( language.rtl ); }
connect( ( state, props ) => ( { isLoggedIn: Boolean( getCurrentUserId( state ) ), locale: getCurrentLocaleSlug( state ), oauth2Client: getCurrentOAuth2Client( state ), isLoginView: ! props.twoFactorAuthType && ! props.socialConnect, } ), { recordPageView: withEnhancers( recordPageView, [ enhanceWithSiteType ] ), recordTracksEvent, } )( localize( Login ) )
constructor({ host, paths, global, handler }) { this.global = Boolean(global); this.handler = handler; this.host = host; this.paths = this.global ? [GLOBAL] : paths; this._routeRecognizer = new RouteRecognizer(); this.paths.forEach(path => this._routeRecognizer.add([{ path, handler: [handler] }]) ); }
/** * Whether this member is currently speaking. A boolean if the information is available (aka * the bot is connected to any voice channel in the guild), otherwise this is null * @type {?boolean} * @readonly */ get speaking() { return this.channel && this.channel.connection ? Boolean(this.channel.connection._speaking.get(this.id)) : null; }
const canBeFixed = node => { if (node.type === 'Literal') { return node.value === null || Boolean(node.value.trim()); } if (node.type === 'TemplateLiteral') { return ( node.expressions.length === 0 && node.quasis.some(templateElement => templateElement.value.cooked.trim()) ); } return false; }
const withTransitionState = Comp => ({ isOpen, ...props }) => { return ( <TransitionProvider isOpen={Boolean(isOpen)}> {state => <Comp transitionState={state} {...props} />} </TransitionProvider> ); }
// @flow // eslint-disable-next-line flowtype/no-weak-types const isSubjectFreezable = (subject: any): boolean => { return Boolean(subject !== null && (typeof subject === 'object' || typeof subject === 'function') && subject.constructor !== Buffer && !Object.isFrozen(subject)); }
export default function normalizeRecordedResponse(response) { const { status, statusText, headers, content } = response; return { statusText, statusCode: status, headers: normalizeHeaders(headers), body: content && content.text, isBinary: Boolean(content && content._isBinary) }; }
passthrough(value = true) { this.set('passthrough', Boolean(value)); if (this.get('passthrough')) { this.delete('intercept'); } return this; }
export function isFreeTrial( product ) { product = formatProduct( product ); assertValidProduct( product ); return Boolean( product.free_trial ); }
/** * Whether or not playback is paused * @type {boolean} * @readonly */ get paused() { return Boolean(this.pausedSince); }
const withTransitionState = Comp => ({ isOpen, ...props }) => { return ( <TransitionProvider isOpen={Boolean(isOpen)}> {state => <Comp transitionState={state} {...props} />} </TransitionProvider> ); }
constructor({ host, paths, global, handler }) { this.global = Boolean(global); this.handler = handler; this.host = host; this.paths = this.global ? [GLOBAL] : paths; this._routeRecognizer = new RouteRecognizer(); this.paths.forEach(path => this._routeRecognizer.add([{ path, handler: [handler] }]) ); }
export default function normalizeRecordedResponse(response) { const { status, statusText, headers, content } = response; return { statusText, statusCode: status, headers: normalizeHeaders(headers), body: content && content.text, isBinary: Boolean(content && content._isBinary) }; }
passthrough(value = true) { this.set('passthrough', Boolean(value)); if (this.get('passthrough')) { this.delete('intercept'); } return this; }