Skip to content

Commit 8299ec2

Browse files
committed
feat: set constructors as protected
1 parent 962ebde commit 8299ec2

File tree

8 files changed

+20
-10
lines changed

8 files changed

+20
-10
lines changed

packages/fs/src/dir.lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { fsFiles, fsFilesFromDir } from "./files-array.lib.ts";
1212
export class FsDir extends Pipeable<FsDir> {
1313
private readonly _path: AnyPath;
1414

15-
private constructor(path: AnyPath) {
15+
protected constructor(path: AnyPath) {
1616
super();
1717
this._path = path;
1818
}

packages/fs/src/file.lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class FsFile<
7474
return new FsFile<"utf-8", undefined>(path.resolve(arg), "utf-8");
7575
}
7676

77-
private constructor(path: AnyPath, encoding?: TEncoding, schema?: TSchema) {
77+
protected constructor(path: AnyPath, encoding?: TEncoding, schema?: TSchema) {
7878
super();
7979
this._path = path;
8080
this._encoding = encoding ?? ("utf-8" as TEncoding);

packages/glob/src/glob.lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export class Glob {
112112
private readonly _cwd: string;
113113
private readonly _options: GlobOptions;
114114

115-
private constructor(
115+
protected constructor(
116116
cwd: string = ".",
117117
options: GlobOptions = {
118118
nodir: true,

packages/llm/src/completion.builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class CompletionBuilder<OPTIONS extends Llm.Completion.Partial> {
2424

2525
private readonly _options: OPTIONS;
2626

27-
private constructor(options: OPTIONS) {
27+
protected constructor(options: OPTIONS) {
2828
this._options = options;
2929
}
3030

packages/markdown-patterns/src/markdown-patterns.engine.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class MarkdownPatternsEngine<
2727
Map<string, Pattern<CONFIG_SCHEMA>[]>
2828
> | null = null;
2929

30-
private constructor(
30+
protected constructor(
3131
cwd: FsDir,
3232
queryEngine: QueryEngine<any, INPUT>,
3333
configSchema: CONFIG_SCHEMA,
@@ -57,7 +57,12 @@ export class MarkdownPatternsEngine<
5757
const newSchema = this._configSchema.omit({ query: true }).extend({
5858
query: queryEngine.schema,
5959
}) as CONFIG_SCHEMA;
60-
return new MarkdownPatternsEngine(this._cwd, queryEngine, newSchema, this._glob);
60+
return new MarkdownPatternsEngine(
61+
this._cwd,
62+
queryEngine,
63+
newSchema,
64+
this._glob,
65+
);
6166
}
6267

6368
public setConfigSchema<NEW_CONFIG_SCHEMA extends z.ZodObject<any>>(
@@ -76,7 +81,12 @@ export class MarkdownPatternsEngine<
7681
}
7782

7883
public setGlob(glob: string) {
79-
return new MarkdownPatternsEngine(this._cwd, this._queryEngine, this._configSchema, glob);
84+
return new MarkdownPatternsEngine(
85+
this._cwd,
86+
this._queryEngine,
87+
this._configSchema,
88+
glob,
89+
);
8090
}
8191

8292
public async refreshPatterns() {

packages/markdown/src/markdown.lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ export class MdDoc<SHAPE = never, DATA extends SHAPE | undefined = never> {
180180
private readonly _data: DATA;
181181
private readonly _options: { schema?: ZodSchema<SHAPE> };
182182

183-
private constructor(
183+
protected constructor(
184184
data: DATA,
185185
body: string,
186186
options: { schema?: ZodSchema<SHAPE, SHAPE> } = {},

packages/pipe/src/pipe.engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type ZodSchema<OUT = any, IN = any> =
1010
export class Pipe<INPUT, OUTPUT> {
1111
private readonly _fns: Array<Pipe.Fn>;
1212

13-
private constructor(fns: Array<Pipe.Fn>) {
13+
protected constructor(fns: Array<Pipe.Fn>) {
1414
this._fns = fns;
1515
}
1616

packages/text/src/text.lib.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class Text {
1212
joinString: string;
1313
};
1414

15-
private constructor(options: Text.Options = {}) {
15+
protected constructor(options: Text.Options = {}) {
1616
this._options = {
1717
joinString: options.joinString ?? "\n",
1818
};

0 commit comments

Comments
 (0)