Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getStoredState(config, (err, restoredState) => {
state.dispatch(setAppVersions(versions));
// Fresh install
if (isEmpty(restoredState)) {
return persistState(state, config, cb);
}
const { app } = state.getState();
const restoredVersion = get(restoredState, 'app.versions.version');
const restoredBuildNumber = get(restoredState, 'app.versions.buildNumber');
const incomingVersion = get(app, 'versions.version');
const incomingBuildNumber = get(app, 'versions.buildNumber');
const hasAnUpdate = restoredVersion !== incomingVersion || restoredBuildNumber !== incomingBuildNumber;
return hasAnUpdate ? purgeBeforePersist(restoredState, state, config, cb) : persistState(state, config, cb);
});
export default function patternRule(schema, t) {
const pattern = get(schema, 'schema.pattern');
if (pattern) {
return {
value: new RegExp(pattern),
message: t('ERROR_STRING_PATTERN', {
defaultValue: 'String does not match pattern: {{pattern}}',
pattern,
}),
};
}
return null;
}
render() {
const {
match: { params },
character,
title,
alias,
} = this.props;
const { editing } = this.state;
const editable = alias === params.alias;
const characterTitle = get(title, 'name');
const showPublic = get(character, 'authorization.showPublic');
const guild = character && {
name: character.guild_name,
tag: character.guild_tag,
id: character.guild,
};
return (
<content type="characters" title="{`${params.character}"></content>
(id) =>
this.api.sms.phonebookContact.getBatch({
serviceName: this.$stateParams.serviceName,
bookKey: get(phonebook, 'bookKey'),
id,
}).$promise,
),
export default function embeddedConfig(state: EmbeddedState | undefined) {
if (state === undefined) {
const search = _get(window, 'location.search');
return search ? getEmbeddedState(search) : null;
}
return state;
}
}
},
em: {
Component: Text,
props: {
use: 'em',
..._get(props, 'elementProps.em', {})
}
},
a: {
Component: Link,
props: _get(props, 'elementProps.a', {})
},
blockquote: {
Component: Blockquote,
props: _get(props, 'elementProps.blockquote', {})
},
h1: {
Component: Heading,
props: {
use: 'h1',
..._get(props, 'elementProps.h1', {})
}
},
h2: {
Component: Heading,
props: {
use: 'h2',
..._get(props, 'elementProps.h2', {})
}
},
h3: {
radioButtonList(list) {
const staticField = this.props.static || _get(this.props.field, 'static', false);
let disabled = false;
if (this.props.field && this.props.field.disabled && _isFunction(this.props.field.disabled)) {
disabled = this.props.checkDisabled(this.props.field.disabled(), _get(this.props.field, 'parent'));
}
if (_get(this.props, 'field.single', false) === true) {
return _map(list, (option, key) => {
if (staticField === true) {
return ({option.desc});
}
return (
renderReview(review) {
return (
);
}
renderTitle = (entity) => {
const title = entity.targettedResource ? get(entity, 'targettedResource.title') : entity.title;
const type = get(entity, 'type', '');
return (
<a href="{entity.targettedResource">
<span>
{title || type.substring(type.indexOf('#') + 1, type.length || entity['@type'])}
</span>
</a>
);
}
renderEntityCardHeader = (entity) =>
get(path, parameters, fallbackValue) {
if (!path) {
return this._config;
}
let value = _get(this._config, path, fallbackValue);
value = (parameters) ? this.resolve(value, parameters) : value;
return (_isUndefined(value) || _isNull(value)) ? null : value;
}
}