Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
future = function(control, propValue, newProp, comment) {
const additionalComment = comment ? ` ${comment}` : '';
if (!hasWarned[control + newProp]) {
/* eslint-disable max-len */
warning(
!propValue,
`[Design System React] \`${newProp}\` of ${control} is not implemented yet. Please check future releases for \`${newProp}\`.${additionalComment}`
);
/* eslint-enable max-len */
hasWarned[control + newProp] = !!propValue;
}
};
}
if (args.length < 2) {
const [handler]: [FunctionalHandler | Builder] = (args: any);
this.on(context => context.event.isPayload, handler);
} else {
// eslint-disable-next-line prefer-const
let [pattern, handler]: [
Pattern,
FunctionalHandler | Builder
] = (args: any);
if (handler.build) {
handler = handler.build();
}
warning(
typeof pattern === 'function' ||
typeof pattern === 'string' ||
pattern instanceof RegExp,
`'onPayload' only accepts string, regex or function, but received ${typeof pattern}`
);
if (typeof pattern === 'function') {
const predicate: Predicate = pattern;
this.on(
context =>
context.event.isPayload &&
predicate(context.event.payload, context),
handler
);
} else {
if (pattern instanceof RegExp) {
export var parsePath = function parsePath() {
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
args[_key3] = arguments[_key3];
}
var target = args[0],
path = args[1],
value = args[2];
warning(typeof path === 'string', 'The second parameter(' + JSON.stringify(path) + ') of parsePath() must be a string.');
var pathSymbols = (path.match(PATH_REGEXP) || []).map(function (s) {
return s.replace(/\s/g, '');
});
var pathWords = path.split(PATH_REGEXP).map(function (s) {
return s.trim();
}).filter(function (item) {
return item !== '';
});
var scope = target;
try {
if (args.length < 3) {
for (var index = 0, len = pathWords.length; index < len; index++) {
var word = executeWord(pathWords[index]);
const warn = () => {
if (__DEV__) {
warning(didWarnAboutRemoval, `The \`${name}\` component has been removed.`);
didWarnAboutRemoval = true;
}
};
return class {
...Object.keys(classesProp).reduce((accumulator, key) => {
warning(
renderedClasses[key] || this.disableStylesGeneration,
[
`Material-UI: the key \`${key}\` ` +
`provided to the classes property is not implemented in ${getDisplayName(
Component,
)}.`,
`You can only override one of the following: ${Object.keys(renderedClasses).join(
',',
)}`,
].join('\n'),
);
warning(
!classesProp[key] || typeof classesProp[key] === 'string',
[
`Material-UI: the key \`${key}\` ` +
componentDidMount() {
warning(true, 'DEPRECATED: the Field system is now deprecated. Please use Flow instead. (from FieldWrapper)');
}
cloned.forEach(({ key, val }) => {
const v0 = this.valueToStep(val)
warning(
v0 === val,
`React Electric Slide: Invalid default value. Changing ${val} to ${v0}.`,
)
warning(
!pushed[key],
`React Electric Slide: No duplicate keys allowed. Skipping "${key}" key.`,
)
if (!pushed[key]) {
pushed[key] = true
values.push({ key, val: v0 })
}
})
postMessage(
channel: string,
inputMessage: Types.Message | string,
options: Types.PostMessageOptionalOptions = {}
): Promise {
warning(
false,
'`postMessage` is deprecated. Use `chat.postMessage` instead.'
);
const message =
typeof inputMessage === 'string' ? { text: inputMessage } : inputMessage;
return this._postMessage({
channel,
...message,
...options,
});
}
async linkRichMenu(richMenuId: string): Promise {
if (this._session && this._session.user) {
return this._client.linkRichMenu(this._session.user.id, richMenuId, {
...(this._customAccessToken
? { accessToken: this._customAccessToken }
: undefined),
} as any);
}
warning(
false,
'linkRichMenu: should not be called in context without session user'
);
}
UNSAFE_componentWillMount() {
warning(
!(this.props.component && this.props.render),
'You should not use and in the same route; will be ignored'
)
warning(
!(this.props.component && this.props.children && !isEmptyChildren(this.props.children)),
'You should not use and in the same route; will be ignored'
)
warning(
!(this.props.render && this.props.children && !isEmptyChildren(this.props.children)),
'You should not use and in the same route; will be ignored'
)
}