function purgeLocalStorageArtifacts() {
    if (!(0, _environment.env)().getBool("IS_BROWSER") || typeof window === "undefined" || typeof window.localStorage === "undefined") throw new Error("purgeLocalStorageModels() cannot proceed because local storage is unavailable in the current environment.");
    const LS = window.localStorage;
    const purgedModelPaths = [];
    for(let i = 0; i < LS.length; ++i){
        const key = LS.key(i);
        const prefix = PATH_PREFIX + PATH_SEPARATOR;
        if (key.startsWith(prefix) && key.length > prefix.length) {
            LS.removeItem(key);
            const modelName = getModelPathFromKey(key);
            if (purgedModelPaths.indexOf(modelName) === -1) purgedModelPaths.push(modelName);
        }
    }
    return purgedModelPaths;
}
Factory function for local storage IOHandler.

This `IOHandler` supports both `save` and `load`.

For each model's saved artifacts, four items are saved to local storage.
  - `${PATH_SEPARATOR}/${modelPath}/info`: Contains meta-info about the
    model, such as date saved, type of the topology, size in bytes, etc.
  - `${PATH_SEPARATOR}/${modelPath}/topology`: Model topology. For Keras-
    style models, this is a stringized JSON.
  - `${PATH_SEPARATOR}/${modelPath}/weight_specs`: Weight specs of the
    model, can be used to decode the saved binary weight values (see
    item below).
  - `${PATH_SEPARATOR}/${modelPath}/weight_data`: Concatenated binary
    weight values, stored as a base64-encoded string.

Saving may throw an `Error` if the total size of the artifacts exceed the
browser-specific quota.

@param modelPath A unique identifier for the model to be saved. Must be a
  non-empty string.
@returns An instance of `IOHandler`, which can be used with, e.g.,
  `tf.Model.save`.