Skip to content

Commit

Permalink
refactor: get rid of defaultOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
BatuhanW committed Dec 29, 2023
1 parent 31260ac commit 88630e4
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,11 @@ interface Options<Schema> {
}

class Haf<Schema, FlattenedSchema = FlattenedWithDotNotation<Schema>> {
readonly #options: Readonly<Options<Schema>>;
private storePath: string;
private defaultSchema: Partial<Schema>;

readonly #defaultOptions: Readonly<Options<Schema>> = {
name: 'haf',
extension: '',
};

constructor(options: Options<Schema>) {
this.#options = Object.assign(this.#defaultOptions, options);
this.storePath = getStorePath(this.#options.name, this.#options.extension);
this.storePath = getStorePath(options.name, options.extension);
this.defaultSchema = options.defaultSchema ?? {};

this.initializeStore();
Expand Down

0 comments on commit 88630e4

Please sign in to comment.