Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const isHSL = (value: unknown): value is HSL =>
isObject(value) && value.constructor && (value.constructor as any).$$id === HSL_SYMBOL;
export const isObjectNode = (value: unknown): value is ObjectNode =>
isObject(value) && (value as PlainObject).type === 'doc' && Array.isArray((value as PlainObject).content);
export const isNodeSelection = (
value: unknown,
): value is NodeSelection => isObject(value) && value instanceof NodeSelection;
export const isExtension = (extension: unknown): extension is AnyExtension =>
isObject(extension) && extension.toString() === RemirrorClassName.Extension;
export const isValidElement = (value: unknown): value is ReactElement =>
isObject(value) && reactIsValidElement(value);
export const isRemirrorElement = (
value: unknown,
): value is RemirrorElement => {
return bool(
isObject(value) &&
isValidElement(value) &&
(value.type as RemirrorComponentType).$$remirrorType,
);
};