"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isSourceChanged = exports.deepMergeLayerOptions = void 0;
var tslib_1 = require("tslib");
var util_1 = require("@antv/util");
/**
 * 深克隆图层配置项
 */
var deepMergeLayerOptions = function (options, srcOptions) {
    var source = options.source, restOptions = tslib_1.__rest(options, ["source"]);
    var srcSource = srcOptions.source, restSrcOptions = tslib_1.__rest(srcOptions, ["source"]);
    var target = tslib_1.__assign(tslib_1.__assign({}, (0, util_1.deepMix)(restOptions, restSrcOptions)), { source: tslib_1.__assign(tslib_1.__assign({}, source), srcSource) });
    return target;
};
exports.deepMergeLayerOptions = deepMergeLayerOptions;
/**
 * 判断 source 数据是否发生改变
 */
var isSourceChanged = function (source, currentSource) {
    var data = source.data, restOptions = tslib_1.__rest(source, ["data"]);
    var currentData = currentSource.data, restCurrentOptions = tslib_1.__rest(currentSource, ["data"]);
    var changed = data !== currentData || !(0, util_1.isEqual)(restOptions, restCurrentOptions);
    return changed;
};
exports.isSourceChanged = isSourceChanged;
//# sourceMappingURL=index.js.map