"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function assocPath(obj, path, value) {
    let _obj = Object.assign({}, obj);
    if (path.length > 0) {
        const [head, ...tail] = path;
        _obj[head] = assocPath(_obj[head] || {}, tail, value);
        return _obj;
    }
    else {
        return value;
    }
}
exports.default = assocPath;
// import * as assert from 'assert'
// assert.deepEqual(assocPath({}, [], 0), 0)
// assert.deepEqual(assocPath({}, ['a'], 0), { a: 0 })
// assert.deepEqual(assocPath({}, ['a', 'b'], 0), { a: { b: 0 } })
//# sourceMappingURL=f.js.map