taraskevizer 10.1.9 → 10.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/config.d.ts +2 -2
- package/dist/pipelines.d.ts +2 -1
- package/dist/steps/types.d.ts +2 -1
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -7,7 +7,7 @@ process.argv.splice(0, 2);
|
|
|
7
7
|
const firstArg = process.argv[0];
|
|
8
8
|
if (firstArg) {
|
|
9
9
|
if (firstArg === '-v' || firstArg === '--version') {
|
|
10
|
-
printWithPrefix("10.1.
|
|
10
|
+
printWithPrefix("10.1.10");
|
|
11
11
|
process.exit(0);
|
|
12
12
|
}
|
|
13
13
|
if (firstArg === '-h' || firstArg === '--help') {
|
package/dist/config.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DeepPartialReadonly } from './types';
|
|
2
2
|
import type { Alphabet } from './dict/alphabets';
|
|
3
3
|
import { type Wrappers } from './wrappers';
|
|
4
4
|
export type Variation = 'no' | 'first' | 'all';
|
|
5
5
|
export type OptionJ = 'never' | 'random' | 'always';
|
|
6
6
|
export declare class TaraskConfig {
|
|
7
|
-
constructor(options?:
|
|
7
|
+
constructor(options?: DeepPartialReadonly<TaraskConfig>);
|
|
8
8
|
/**
|
|
9
9
|
* Predefined alphabets are in {@link dicts.alphabets}.
|
|
10
10
|
*
|
package/dist/pipelines.d.ts
CHANGED
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import { TaraskConfig } from './config';
|
|
20
20
|
import { type TaraskStep } from './steps';
|
|
21
|
+
import type { DeepPartialReadonly } from './types';
|
|
21
22
|
export type Pipeline = {
|
|
22
|
-
(text: string, cfg?:
|
|
23
|
+
(text: string, cfg?: DeepPartialReadonly<TaraskConfig>): string;
|
|
23
24
|
steps: TaraskStep<any>[];
|
|
24
25
|
};
|
|
25
26
|
/**
|
package/dist/steps/types.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { TaraskConfig } from '@/config';
|
|
2
|
+
import type { DeepReadonly } from '@/types';
|
|
2
3
|
export type TaraskStep<Storage extends object = object> = (context: {
|
|
3
4
|
text: string;
|
|
4
5
|
storage: Storage;
|
|
5
|
-
cfg: TaraskConfig
|
|
6
|
+
cfg: DeepReadonly<TaraskConfig>;
|
|
6
7
|
}) => void;
|
|
7
8
|
export type SplittedTextStorage = {
|
|
8
9
|
textArr: string[];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
export type PartialReadonly<T> = {
|
|
2
2
|
readonly [P in keyof T]?: T[P];
|
|
3
3
|
};
|
|
4
|
+
type AnyFn = (...args: any[]) => any;
|
|
5
|
+
export type DeepReadonly<T> = T extends (infer R)[] ? ReadonlyArray<DeepReadonly<R>> : T extends AnyFn ? T : T extends object ? {
|
|
6
|
+
readonly [P in keyof T]: DeepReadonly<T[P]>;
|
|
7
|
+
} : T;
|
|
8
|
+
export type DeepPartialReadonly<T> = T extends (infer R)[] ? ReadonlyArray<DeepPartialReadonly<R>> : T extends AnyFn ? T : T extends object ? {
|
|
9
|
+
readonly [P in keyof T]?: DeepPartialReadonly<T[P]>;
|
|
10
|
+
} : T;
|
|
11
|
+
export {};
|