function buildNestedPath(path, object, value) {
    let i = 0, component = path[i];
    for (; i < path.length - 1; ++i, component = path[i]) {
      object[component] = object[component] == null ? {
        bsonType: 'object',
        properties: {}
      } : object[component];
      object = object[component].properties;
    }
    object[component] = value;
  }
`schemaMap`s are JSON schemas, which use the following structure to represent objects:
   { field: { bsonType: 'object', properties: { ... } } }

for example, a schema that looks like this `{ a: { b: int32 } }` would be encoded as
`{ a: { bsonType: 'object', properties: { b: < encryption configuration > } } }`

This function takes an array of path segments, an output object (that gets mutated) and
a value to be associated with the full path, and constructs a valid CSFLE JSON schema path for
the object.  This works for deeply nested properties as well.

@param {string[]} path array of path components
@param {object} object the object in which to build a JSON schema of `path`'s properties
@param {object} value the value to associate with the path in object