Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
pluma4345 committed Dec 10, 2024
1 parent 23b89ad commit 897e7b8
Show file tree
Hide file tree
Showing 55 changed files with 1,474 additions and 1,084 deletions.
8 changes: 4 additions & 4 deletions src/administration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export type EngineInfo = {
* Index type aliases supported by the storage engine.
*/
indexes?: Record<string, string>;
}
};
};
};

Expand Down Expand Up @@ -127,7 +127,7 @@ export type ServerStatusInformation = {
*/
foxxApi: boolean;
/**
* A host identifier defined by the HOST or NODE_NAME environment variable,
* A host identifier defined by the HOST or NODE_NAME environment variable,
* or a fallback value using a machine identifier or the cluster/Agency address.
*/
host: string;
Expand Down Expand Up @@ -318,7 +318,7 @@ export type ClusterSupportInfo = {
* Number of servers in the cluster.
*/
servers: number;
}
};
};
/**
* (Cluster only.) Information about the ArangoDB instance as well as the
Expand Down Expand Up @@ -347,4 +347,4 @@ export interface QueueTimeMetrics {
* in seconds.
*/
getAvg(): number;
};
}
149 changes: 75 additions & 74 deletions src/analyzers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,43 +77,42 @@ export type CreateAnalyzerOptions =

type CreateAnalyzerOptionsType<
Type extends AnalyzerType,
Properties = void
Properties = void,
> = Properties extends void
? {
/**
* Type of the Analyzer.
*/
type: Type;
/**
* Features to enable for this Analyzer.
*/
features?: AnalyzerFeature[];
/**
* This Analyzer does not take additional properties.
*/
properties?: Record<string, never>;
}
/**
* Type of the Analyzer.
*/
type: Type;
/**
* Features to enable for this Analyzer.
*/
features?: AnalyzerFeature[];
/**
* This Analyzer does not take additional properties.
*/
properties?: Record<string, never>;
}
: {
/**
* Type of the Analyzer.
*/
type: Type;
/**
* Features to enable for this Analyzer.
*/
features?: AnalyzerFeature[];
/**
* Additional properties for the Analyzer.
*/
properties: Properties;
};
/**
* Type of the Analyzer.
*/
type: Type;
/**
* Features to enable for this Analyzer.
*/
features?: AnalyzerFeature[];
/**
* Additional properties for the Analyzer.
*/
properties: Properties;
};

/**
* Options for creating an Identity Analyzer.
*/
export type CreateIdentityAnalyzerOptions = CreateAnalyzerOptionsType<
"identity"
>;
export type CreateIdentityAnalyzerOptions =
CreateAnalyzerOptionsType<"identity">;

/**
* Options for creating a Delimiter Analyzer.
Expand All @@ -122,12 +121,12 @@ export type CreateDelimiterAnalyzerOptions = CreateAnalyzerOptionsType<
"delimiter",
| string
| {
/**
* This value will be used as delimiter to split text into tokens as
* specified in RFC 4180, without starting new records on newlines.
*/
delimiter: string;
}
/**
* This value will be used as delimiter to split text into tokens as
* specified in RFC 4180, without starting new records on newlines.
*/
delimiter: string;
}
>;

/**
Expand Down Expand Up @@ -583,7 +582,7 @@ export type AnalyzerDescription =
*/
type AnalyzerDescriptionType<
Type extends string,
Properties = Record<string, never>
Properties = Record<string, never>,
> = {
/**
* A unique name for this Analyzer.
Expand Down Expand Up @@ -932,43 +931,43 @@ export class Analyzer {
* ```
*/
create<Options extends CreateAnalyzerOptions>(
options: Options
options: Options,
): Promise<
Options extends CreateIdentityAnalyzerOptions
? IdentityAnalyzerDescription
: Options extends CreateDelimiterAnalyzerOptions
? DelimiterAnalyzerDescription
: Options extends CreateStemAnalyzerOptions
? StemAnalyzerDescription
: Options extends CreateNormAnalyzerOptions
? NormAnalyzerDescription
: Options extends CreateNgramAnalyzerOptions
? NgramAnalyzerDescription
: Options extends CreateTextAnalyzerOptions
? TextAnalyzerDescription
: Options extends CreateSegmentationAnalyzerOptions
? SegmentationAnalyzerDescription
: Options extends CreateAqlAnalyzerOptions
? AqlAnalyzerDescription
: Options extends CreatePipelineAnalyzerOptions
? PipelineAnalyzerDescription
: Options extends CreateStopwordsAnalyzerOptions
? StopwordsAnalyzerDescription
: Options extends CreateCollationAnalyzerOptions
? CollationAnalyzerDescription
: Options extends CreateMinHashAnalyzerOptions
? MinHashAnalyzerDescription
: Options extends CreateClassificationAnalyzerOptions
? ClassificationAnalyzerDescription
: Options extends CreateNearestNeighborsAnalyzerOptions
? NearestNeighborsAnalyzerDescription
: Options extends CreateGeoJsonAnalyzerOptions
? GeoJsonAnalyzerDescription
: Options extends CreateGeoPointAnalyzerOptions
? GeoPointAnalyzerDescription
: Options extends CreateGeoS2AnalyzerOptions
? GeoS2AnalyzerDescription
: AnalyzerDescription
? IdentityAnalyzerDescription
: Options extends CreateDelimiterAnalyzerOptions
? DelimiterAnalyzerDescription
: Options extends CreateStemAnalyzerOptions
? StemAnalyzerDescription
: Options extends CreateNormAnalyzerOptions
? NormAnalyzerDescription
: Options extends CreateNgramAnalyzerOptions
? NgramAnalyzerDescription
: Options extends CreateTextAnalyzerOptions
? TextAnalyzerDescription
: Options extends CreateSegmentationAnalyzerOptions
? SegmentationAnalyzerDescription
: Options extends CreateAqlAnalyzerOptions
? AqlAnalyzerDescription
: Options extends CreatePipelineAnalyzerOptions
? PipelineAnalyzerDescription
: Options extends CreateStopwordsAnalyzerOptions
? StopwordsAnalyzerDescription
: Options extends CreateCollationAnalyzerOptions
? CollationAnalyzerDescription
: Options extends CreateMinHashAnalyzerOptions
? MinHashAnalyzerDescription
: Options extends CreateClassificationAnalyzerOptions
? ClassificationAnalyzerDescription
: Options extends CreateNearestNeighborsAnalyzerOptions
? NearestNeighborsAnalyzerDescription
: Options extends CreateGeoJsonAnalyzerOptions
? GeoJsonAnalyzerDescription
: Options extends CreateGeoPointAnalyzerOptions
? GeoPointAnalyzerDescription
: Options extends CreateGeoS2AnalyzerOptions
? GeoS2AnalyzerDescription
: AnalyzerDescription
> {
return this._db.request({
method: "POST",
Expand All @@ -991,12 +990,14 @@ export class Analyzer {
* // the Analyzer "some-analyzer" no longer exists
* ```
*/
drop(force: boolean = false): Promise<connection.ArangoApiResponse<{ name: string }>> {
drop(
force: boolean = false,
): Promise<connection.ArangoApiResponse<{ name: string }>> {
return this._db.request({
method: "DELETE",
pathname: `/_api/analyzer/${encodeURIComponent(this._name)}`,
search: { force },
});
}
}
//#endregion
//#endregion
4 changes: 2 additions & 2 deletions src/aql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export function aql<T = any>(
2,
strings[i] + src.strings[0],
...src.strings.slice(1, src.args.length),
src.strings[src.args.length] + strings[i + 1]
src.strings[src.args.length] + strings[i + 1],
);
} else {
query += rawValue.query + strings[i + 1];
Expand Down Expand Up @@ -319,7 +319,7 @@ export function aql<T = any>(
* ```
*/
export function literal(
value: string | number | boolean | AqlLiteral | null | undefined
value: string | number | boolean | AqlLiteral | null | undefined,
): AqlLiteral {
if (isAqlLiteral(value)) {
return value;
Expand Down
Loading

0 comments on commit 897e7b8

Please sign in to comment.