"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const _assignValue = require("./_assignValue3.cjs");
const _castPath = require("./_castPath3.cjs");
const _isIndex = require("./_isIndex3.cjs");
const isObject = require("./isObject3.cjs");
const _toKey = require("./_toKey3.cjs");
function baseSet(object, path, value, customizer) {
  if (!isObject.default(object)) {
    return object;
  }
  path = _castPath.default(path, object);
  var index = -1, length = path.length, lastIndex = length - 1, nested = object;
  while (nested != null && ++index < length) {
    var key = _toKey.default(path[index]), newValue = value;
    if (key === "__proto__" || key === "constructor" || key === "prototype") {
      return object;
    }
    if (index != lastIndex) {
      var objValue = nested[key];
      newValue = void 0;
      if (newValue === void 0) {
        newValue = isObject.default(objValue) ? objValue : _isIndex.default(path[index + 1]) ? [] : {};
      }
    }
    _assignValue.default(nested, key, newValue);
    nested = nested[key];
  }
  return object;
}
exports.default = baseSet;
//# sourceMappingURL=_baseSet3.cjs.map
