Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createMountRenderer(options) {
assertDomAvailable('mount');
if (has(options, 'suspenseFallback')) {
throw new TypeError('`suspenseFallback` is not supported by the `mount` renderer');
}
if (FiberTags === null) {
// Requires DOM.
FiberTags = detectFiberTags();
}
const { attachTo, hydrateIn, wrappingComponentProps } = options;
const domNode = hydrateIn || attachTo || global.document.createElement('div');
let instance = null;
const adapter = this;
return {
render(el, context, callback) {
return wrapAct(() => {
if (instance === null) {
const { type, props, ref } = el;
const wrapperProps = {
async getProperties() {
let properties = []
const { modelId } = this
if (has(this.propertyMap, modelId)) {
properties = this.propertyMap[modelId]
} else {
const action = 'objectModelProperty/searchObjectAttribute'
properties = await this.$store.dispatch(action, {
params: {
bk_biz_id: this.business,
bk_obj_id: modelId,
bk_supplier_account: this.$store.getters.supplierAccount
},
config: {
requestId: 'getModelProperties'
}
})
this.$store.commit('businessHost/setProperties', {
id: modelId,
properties
if ( result_type !== 'post' ) {
return null;
}
const noMatchingContent = ! highlight.content || highlight.content[ 0 ] === '';
return (
<div>
<span>
{ new Date( fields.date.split( ' ' )[ 0 ] ).toLocaleDateString( locale, {
dateStyle: 'short',
} ) }
</span>
<h3>
<a href="{">
</a></h3><a href="{">
{ noMatchingContent ? this.renderNoMatchingContent() : this.renderMatchingContent() }
</a></div><a href="{">
);
}
}</a>
function isRSTNodeLike(node) {
return has(node, 'nodeType')
&& typeof node.nodeType === 'string'
&& has(node, 'type')
&& has(node, 'key')
&& has(node, 'ref')
&& has(node, 'instance')
&& has(node, 'rendered');
}
export function spyMethod(instance, methodName, getStub = () => {}) {
let lastReturnValue;
const originalMethod = instance[methodName];
const hasOwn = has(instance, methodName);
let descriptor;
if (hasOwn) {
descriptor = Object.getOwnPropertyDescriptor(instance, methodName);
}
Object.defineProperty(instance, methodName, {
configurable: true,
enumerable: !descriptor || !!descriptor.enumerable,
value: getStub(originalMethod) || function spied(...args) {
const result = originalMethod.apply(this, args);
lastReturnValue = result;
return result;
},
});
return {
restore() {
if (hasOwn) {
const showFullText = ['keywords', 'show'].every(key => has(query, key))
if (showFullText && this.isFullTextSearch) {
function createBinaryExpr(operator, left, right) {
const expr = { operator, type: 'binary_expr' }
expr.left = has(left, 'type') ? left : createValueExpr(left)
if (operator === 'BETWEEN' || operator === 'NOT BETWEEN') {
expr.right = {
type : 'expr_list',
value : [createValueExpr(right[0]), createValueExpr(right[1])],
}
return expr
}
expr.right = has(right, 'type') ? right : createValueExpr(right)
return expr
}
function isRSTNodeLike(node) {
return has(node, 'nodeType')
&& typeof node.nodeType === 'string'
&& has(node, 'type')
&& has(node, 'key')
&& has(node, 'ref')
&& has(node, 'instance')
&& has(node, 'rendered');
}