Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
let keysA = Object.keys(objA);
let keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
let bHasOwnProperty = hasOwnProperty.bind(objB);
for (let i = 0; i < keysA.length; i++) {
if (!bHasOwnProperty(keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {
return false;
}
}
return true;
}
function deepEqual(objA, objB) {
if (objA === objB || is(objA, objB)) {
return true;
}
if (typeof objA !== 'object' || objA === null || typeof objB !== 'object' || objB === null) {
return false;
}
let keysA = Object.keys(objA);
let keysB = Object.keys(objB);
if (keysA.length !== keysB.length) {
return false;
}
// Test for A's keys different from B.
let bHasOwnProperty = hasOwnProperty.bind(objB);
entry.parent = '__root'
}
const newId = entry.id
let newNode = this._node(entry)
const parentId = entry.parent
if (parentId) {
const parentNode = this.index[parentId]
if (parentNode) {
const siblings = parentNode.get('children')
const canAppend = siblings.size === 0 || entry[this.sortProp] >= this.index[siblings.last()].get(this.sortProp)
if (canAppend) {
// avoiding a re-sort can save a lot of time with large child lists
this.index[parentId] = parentNode.set('children', siblings.delete(newId).add(newId))
if (!Immutable.is(parentNode, this.index[parentId])) {
_changed[parentId] = _changed[parentId] || parentNode
}
} else {
this.index[parentId] = parentNode.set('children', siblings.add(newId))
_needsSort[parentId] = true
_changed[parentId] = _changed[parentId] || parentNode
}
} else {
// create unreachable orphan parent
this.index[parentId] = this._node().set('id', parentId).mergeIn(['children'], [newId])
_changed[parentId] = _changed[parentId] || true
this.size++
_needsSort[parentId] = true
}
}
componentWillReceiveProps(nextProps){
if(!is(fromJS(this.props.proData), fromJS(nextProps.proData))){
this.initData(nextProps);
}
}
callIfNeeded(oldMap, newMap) {
if (this.keys.length === 0 && !Immutable.is(oldMap, newMap))
return this.trigger('*');
for (let i in this.keys)
if (this.stateKeyChanged(this.keys[i], oldMap, newMap))
return this.trigger(this.keys[i]);
}
shouldComponentUpdate(nextProps) {
return !Immutable.is(nextProps.pageHeader, this.props.pageHeader) ||
['dpi'].some(prop =>
nextProps[prop] !== this.props[prop],
)
}
__isCached(state, getter) {
return (
this.__cachedGetters.hasIn([getter, 'value']) &&
Immutable.is(this.__cachedGetters.getIn([getter, 'state']), state)
)
}
shouldComponentUpdate(nextProps, nextState) {
return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state),fromJS(nextState))
}
}
if (params[1] === "set_subscribe_callback" || params[1] === "subscribe_to_market" ||
params[1] === "broadcast_transaction_with_callback" || params[1] === "set_pending_transaction_callback"
)
{
this.subscriptions[this.current_callback_id] = {
callback: params[2][0],
params: Immutable.fromJS(params[2][1])
};
params[2][0] = this.current_callback_id;
}
if( params[1] === "unsubscribe_from_market" || params[1] === "unsubscribe_from_accounts") {
let unSubParams = Immutable.fromJS(params[2][0]);
for (let id in this.subscriptions) {
if (Immutable.is(this.subscriptions[id].params, unSubParams)) {
this.unsub[this.current_callback_id] = id;
break;
}
}
}
var request = {
method: "call",
params: params
};
request.id = this.current_callback_id;
return new Promise((resolve, reject) => {
this.callbacks[this.current_callback_id] = {
time: new Date(),
function validateTranslation(translation, original) {
if (!I.is(countOfReactComponentsByName(translation), countOfReactComponentsByName(original))) {
throw new InputError('The translation has a different set of React components than the original.');
}
if (!I.is(countOfNamedExpressionsByName(translation), countOfNamedExpressionsByName(original))) {
throw new InputError('The translation has a different set of expressions than the original.');
}
return translation;
}