@homedev/objector 1.2.61 → 1.2.62

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.
@@ -0,0 +1,750 @@
1
+ export declare const AsyncFunction: any;
2
+
3
+ /**
4
+ * Maps an array asynchronously using Promise.all for parallel execution
5
+ * @typeParam T - Type of input array items
6
+ * @typeParam U - Type of async result items
7
+ * @param arr - Array to map
8
+ * @param fn - Async mapping function
9
+ * @returns Promise of mapped array
10
+ * @public
11
+ */
12
+ export declare const asyncMap: <T, U>(arr: T[], fn: (item: T, index: number, array: T[]) => Promise<U>) => Promise<U[]>;
13
+
14
+ /**
15
+ * Converts a string to camelCase (lowerCamelCase).
16
+ * Handles spaces, underscores, and hyphens as word separators.
17
+ *
18
+ * @example
19
+ * camel('hello_world') // 'helloWorld'
20
+ * camel('hello world') // 'helloWorld'
21
+ * camel('HelloWorld') // 'helloWorld'
22
+ *
23
+ * @param v - The string to convert
24
+ * @returns The string in camelCase
25
+ */
26
+ export declare const camel: (v: string) => string;
27
+
28
+ /**
29
+ * Converts a string to Capital Case (each word capitalized, spaces preserved).
30
+ * Only capitalizes words following spaces.
31
+ *
32
+ * @example
33
+ * capital('hello world') // 'Hello World'
34
+ * capital('hello_world') // 'hello_World'
35
+ *
36
+ * @param v - The string to convert
37
+ * @returns The string with each space-separated word capitalized
38
+ */
39
+ export declare const capital: (v: string) => string;
40
+
41
+ /**
42
+ * Changes the case of a string to uppercase, lowercase, or returns unchanged.
43
+ *
44
+ * @example
45
+ * changeCase('Hello', 'upper') // 'HELLO'
46
+ * changeCase('Hello', 'lower') // 'hello'
47
+ * changeCase('Hello') // 'Hello'
48
+ *
49
+ * @param v - The string to transform
50
+ * @param arg - The case type: 'upper', 'lower', or undefined to return unchanged
51
+ * @returns The transformed string
52
+ */
53
+ export declare const changeCase: (v: string, arg?: string) => string;
54
+
55
+ /**
56
+ * @public
57
+ */
58
+ export declare const conditionPredicates: Record<string, (...args: any[]) => boolean>;
59
+
60
+ export declare const decoder: (options?: DecoderOptions) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (data: string) => unknown>) => void;
61
+
62
+ declare type DecoderOptions = ObjectorDecoratorOptions;
63
+
64
+ /**
65
+ * Deep clones an object using structuredClone (faster) with JSON fallback
66
+ * - Uses structuredClone for better performance and broader type support (Date, RegExp, etc.)
67
+ * - Falls back to JSON serialization if structuredClone fails or is unavailable
68
+ * - Note: Functions, symbols, and undefined values are lost in JSON fallback
69
+ * @typeParam T - Type of object to clone
70
+ * @param model - Object to clone
71
+ * @returns Deep clone of the object
72
+ * @public
73
+ */
74
+ export declare const deepClone: <T>(model: T) => T;
75
+
76
+ /**
77
+ * Asserts that a value is defined, throwing an error if undefined
78
+ * @typeParam T - Type of the value
79
+ * @param value - Value to check
80
+ * @param msg - Error message to throw if value is undefined or null
81
+ * @returns The value if defined
82
+ * @throws Error if value is undefined
83
+ * @public
84
+ */
85
+ export declare const defined: <T>(value: T | undefined | null, msg?: string) => T;
86
+
87
+ declare interface Encoder {
88
+ fn: (data: unknown, ...args: any[]) => string | Promise<string>;
89
+ options?: EncoderOptions;
90
+ }
91
+
92
+ export declare const encoder: (options?: EncoderOptions_2) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (data: unknown) => string | Promise<string>>) => void;
93
+
94
+ declare interface EncoderOptions {
95
+ includeTags?: boolean;
96
+ }
97
+
98
+ declare type EncoderOptions_2 = ObjectorDecoratorOptions;
99
+
100
+ export declare const exists: (fileName: string) => Promise<boolean>;
101
+
102
+ export declare interface FieldContext {
103
+ path: string;
104
+ root: any;
105
+ options: ProcessFieldsOptions;
106
+ value: string | object | number | NavigateResult | null;
107
+ key: string;
108
+ args: any[];
109
+ rawArgs: {
110
+ value: string;
111
+ quoted: boolean;
112
+ }[];
113
+ tags: Record<string, string[]>;
114
+ parent?: any;
115
+ }
116
+
117
+ export declare interface FieldProcessor {
118
+ fn: FieldProcessorFunc;
119
+ options: FieldProcessorOptions;
120
+ }
121
+
122
+ export declare type FieldProcessorFunc = (context: FieldContext) => any;
123
+
124
+ export declare type FieldProcessorMap = Record<string, FieldProcessorTypedFunc>;
125
+
126
+ export declare interface FieldProcessorOptions {
127
+ filters?: RegExp[];
128
+ processArgs?: boolean;
129
+ types?: Record<number, string | any[] | ((value: string, root: any, index: number, quoted: boolean) => any)> | FieldProcessorTypeChecker;
130
+ }
131
+
132
+ export declare interface FieldProcessorSection {
133
+ config: Record<string, any>;
134
+ content: string;
135
+ trim?: boolean;
136
+ indent?: number;
137
+ show?: boolean;
138
+ }
139
+
140
+ export declare type FieldProcessorSectionConfigFunc = (context: FieldProcessorSectionContext) => Promise<boolean | void> | boolean | void;
141
+
142
+ export declare interface FieldProcessorSectionContext {
143
+ section: FieldProcessorSection;
144
+ content: string;
145
+ path: string;
146
+ root: Record<string, any>;
147
+ options: ProcessFieldsOptions;
148
+ }
149
+
150
+ export declare type FieldProcessorSectionFunc = (context: FieldProcessorSectionContext) => Promise<void | boolean | string> | void | boolean | string;
151
+
152
+ export declare type FieldProcessorSectionMap = Record<string, FieldProcessorSectionFunc>;
153
+
154
+ export declare type FieldProcessorTypeChecker = (n: number, value: any, args: any[]) => any;
155
+
156
+ export declare type FieldProcessorTypeCheckers<T = unknown> = Record<keyof T, FieldProcessorTypeChecker>;
157
+
158
+ export declare type FieldProcessorTypedFunc = FieldProcessorFunc | (FieldProcessorOptions & {
159
+ fn: FieldProcessorFunc;
160
+ });
161
+
162
+ declare interface FilePatternOptions {
163
+ cwd: string;
164
+ filter?: (fileName: string, index: number, array: string[]) => boolean;
165
+ map: (fileName: string, index: number, array: string[]) => Promise<any>;
166
+ }
167
+
168
+ /**
169
+ * Finds values in an object tree that match a predicate function.
170
+ *
171
+ * @public
172
+ * @param from - The object to search through
173
+ * @param cb - Predicate function that receives the path and value, returns true for matches
174
+ * @returns Array of matching values
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * const obj = { a: { b: 1 }, c: { d: 2 } }
179
+ * const results = await find(obj, (path, value) => value === 2)
180
+ * // results: [2]
181
+ * ```
182
+ */
183
+ export declare const find: (from: any, cb: (path: string, value: any) => boolean) => Promise<any[]>;
184
+
185
+ export declare const globMap: <T>(pattern: string | string[], options: FilePatternOptions) => Promise<T[] | T>;
186
+
187
+ /**
188
+ * @public
189
+ */
190
+ export declare const importGlob: (patterns: string[], options?: ImportOptions) => Promise<any[]>;
191
+
192
+ /**
193
+ * @public
194
+ */
195
+ export declare const importList: (modules: string[], options?: ImportOptions) => Promise<any[]>;
196
+
197
+ /**
198
+ * @public
199
+ */
200
+ export declare interface ImportOptions {
201
+ cwd?: string;
202
+ resolveDefault?: boolean | 'only';
203
+ filter?: (name: string) => boolean | undefined;
204
+ fail?: (name: string, error: any) => boolean | undefined;
205
+ map?: (module: any, name: string) => any;
206
+ }
207
+
208
+ export declare const key: (options?: KeyOptions) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (value: any) => any>) => void;
209
+
210
+ declare type KeyOptions = ObjectorDecoratorOptions;
211
+
212
+ /**
213
+ * @public
214
+ */
215
+ export declare interface LoadContext {
216
+ included: string[];
217
+ document: unknown;
218
+ }
219
+
220
+ /**
221
+ * @public
222
+ * @param fileName
223
+ * @param options
224
+ * @returns
225
+ */
226
+ export declare const loadFormat: <T = any>(fileName: string, options?: LoadOptions) => Promise<LoadResult<T>>;
227
+
228
+ /**
229
+ * @public
230
+ */
231
+ export declare interface LoadFormatParser {
232
+ matching?: string[];
233
+ fn: (data: string) => any;
234
+ }
235
+
236
+ /**
237
+ * @public
238
+ */
239
+ export declare interface LoadObjectOptions {
240
+ fileName: string;
241
+ fullPath: string;
242
+ folderPath: string;
243
+ }
244
+
245
+ /**
246
+ * @public
247
+ */
248
+ export declare interface LoadOptions {
249
+ dirs?: string[];
250
+ parsers?: Record<string, LoadFormatParser>;
251
+ format?: string;
252
+ }
253
+
254
+ export declare interface LoadResult<T> {
255
+ fullPath: string;
256
+ folderPath: string;
257
+ content: T;
258
+ }
259
+
260
+ export declare const locate: (fileName: string, dirs?: string[]) => Promise<string>;
261
+
262
+ export declare type LogFunction = (className: string, ...args: any[]) => void;
263
+
264
+ export declare class Logger {
265
+ options: LoggerOptions;
266
+ constructor(options?: Partial<LoggerOptions>);
267
+ write(className: string, ...args: any[]): void;
268
+ info(...args: any[]): void;
269
+ error(...args: any[]): void;
270
+ warn(...args: any[]): void;
271
+ debug(...args: any[]): void;
272
+ verbose(...args: any[]): void;
273
+ }
274
+
275
+ export declare interface LoggerOptions {
276
+ level: string;
277
+ showClass: boolean;
278
+ levels: string[];
279
+ timeStamp: boolean;
280
+ timeLocale?: string;
281
+ timeOptions?: Intl.DateTimeFormatOptions;
282
+ logFunction: LogFunction;
283
+ }
284
+
285
+ export declare const macro: (options?: MacroOptions) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (...args: any[]) => any>) => void;
286
+
287
+ declare type MacroOptions = ObjectorDecoratorOptions;
288
+
289
+ export declare const makeFieldProcessor: (fn: SourceFunc, types?: FieldProcessorTypeChecker) => FieldProcessorTypedFunc;
290
+
291
+ export declare const makeFieldProcessorList: <T = unknown>(source: SourceFunc[], options?: {
292
+ types?: FieldProcessorTypeCheckers<T>;
293
+ }) => FieldProcessorMap;
294
+
295
+ export declare const makeFieldProcessorMap: <T = unknown>(source: Record<keyof T, SourceFunc>, options?: {
296
+ types?: FieldProcessorTypeCheckers<T>;
297
+ keys?: (keyof T)[];
298
+ }) => FieldProcessorMap;
299
+
300
+ /**
301
+ * @public
302
+ * @param source
303
+ * @param target
304
+ * @param options
305
+ */
306
+ export declare const merge: (source: any, target: any, options?: MergeOptions) => void;
307
+
308
+ /**
309
+ * @public
310
+ * @param elements
311
+ * @param options
312
+ */
313
+ export declare const mergeAll: (elements: any[], options?: MergeOptions) => any;
314
+
315
+ /**
316
+ * @public
317
+ */
318
+ export declare type MergeMode = 'merge' | 'source' | 'target' | 'skip';
319
+
320
+ /**
321
+ * @public
322
+ */
323
+ export declare interface MergeOptions {
324
+ conflict?: (key: string, source: any, target: any, sourceContainer: any, targetContainer: any) => any;
325
+ mismatch?: (key: string, source: any, target: any, sourceContainer: any, targetContainer: any) => any;
326
+ navigate?: (key: string, source: any, target: any, sourceContainer: any, targetContainer: any) => boolean | undefined;
327
+ mode?: (key: string, source: any, target: any, sourceContainer: any, targetContainer: any) => MergeMode | void;
328
+ }
329
+
330
+ /**
331
+ * Recursively navigates through an object tree, invoking a callback for each property.
332
+ * Supports various actions like replacing, deleting, or merging values during traversal.
333
+ * Includes circular reference detection to prevent infinite loops.
334
+ *
335
+ * Performance optimizations:
336
+ * - Caches static NavigateResult instances
337
+ * - Uses WeakSet for O(1) circular reference detection
338
+ * - Avoids Object.entries() to prevent array allocations
339
+ * - Optimizes switch statement order for common cases
340
+ *
341
+ * @public
342
+ * @param o - The object to navigate
343
+ * @param cb - Callback function invoked for each property
344
+ * @throws {Error} When attempting to replace the root object
345
+ */
346
+ export declare const navigate: (o: any, cb: NavigateCallback) => Promise<void>;
347
+
348
+ /**
349
+ * @public
350
+ */
351
+ export declare enum NavigateAction {
352
+ Explore = 0,
353
+ SkipSiblings = 1,
354
+ NoExplore = 2,
355
+ ReplaceParent = 3,
356
+ DeleteParent = 4,
357
+ MergeParent = 5,
358
+ ReplaceItem = 6,
359
+ DeleteItem = 7
360
+ }
361
+
362
+ /**
363
+ * @public
364
+ */
365
+ export declare type NavigateCallback = (context: NavigateContext) => Promise<NavigateResult> | NavigateResult;
366
+
367
+ /**
368
+ * @public
369
+ */
370
+ export declare interface NavigateContext {
371
+ key: string;
372
+ value: any;
373
+ path: string[];
374
+ parent: any;
375
+ parents: any[];
376
+ }
377
+
378
+ /**
379
+ * @public
380
+ */
381
+ export declare class NavigateResult {
382
+ readonly action: NavigateAction;
383
+ by?: any | undefined;
384
+ skipSiblings?: boolean | undefined;
385
+ reexplore?: boolean | undefined;
386
+ constructor(action: NavigateAction, by?: any | undefined, skipSiblings?: boolean | undefined, reexplore?: boolean | undefined);
387
+ private static readonly _explore;
388
+ private static readonly _noExplore;
389
+ private static readonly _skipSiblings;
390
+ private static readonly _deleteParent;
391
+ static ReplaceParent(by: any, reexplore?: boolean): NavigateResult;
392
+ static SkipSiblings(): NavigateResult;
393
+ static Explore(): NavigateResult;
394
+ static NoExplore(): NavigateResult;
395
+ static DeleteParent(): NavigateResult;
396
+ static MergeParent(by: any): NavigateResult;
397
+ static ReplaceItem(by: any, skipSiblings?: boolean): NavigateResult;
398
+ static DeleteItem(skipSiblings?: boolean): NavigateResult;
399
+ }
400
+
401
+ /**
402
+ * Maps an array while filtering out null/undefined values (performance optimized)
403
+ * Combines filter and map operations to avoid double iteration
404
+ * @typeParam T - Type of input array items
405
+ * @typeParam U - Type of mapped result items
406
+ * @param arr - Array to map (can be undefined)
407
+ * @param fn - Mapping function
408
+ * @returns Mapped array with nulls/undefined filtered out, or empty array if input is undefined
409
+ * @public
410
+ */
411
+ export declare const nonNullMap: <T, U>(arr: T[] | undefined, fn: (item: T, index: number, array: T[]) => U) => U[];
412
+
413
+ /**
414
+ * @public
415
+ */
416
+ export declare class Objector {
417
+ private includeManager;
418
+ private includeProcessor;
419
+ private cacheManager;
420
+ private outputs;
421
+ private vars;
422
+ private funcs;
423
+ private fields;
424
+ private objectMetadata;
425
+ private currentContext;
426
+ private storedSections;
427
+ private dataEncoders;
428
+ private dataDecoders;
429
+ constructor();
430
+ use(handler: ObjectorPluginConstructor | ObjectorPluginFunction): this;
431
+ includeDirectory(...dirs: string[]): this;
432
+ getIncludeDirectories(): string[];
433
+ include(...files: string[]): this;
434
+ keys(keys: FieldProcessorMap): this;
435
+ sources(sources: FieldProcessorMap): this;
436
+ sections(sections: Record<string, FieldProcessorSectionFunc>): this;
437
+ variables(vars: Record<string, unknown>): this;
438
+ functions(funcs: Record<string, typeof AsyncFunction>): this;
439
+ getFunctions(): Record<string, typeof AsyncFunction>;
440
+ getOutputs(): Output[];
441
+ output(o: Output): this;
442
+ metadata(path: string, o: unknown): this;
443
+ getMetadata(path: string): unknown;
444
+ getAllMetadata(): Record<string, unknown>;
445
+ setCacheMaxSize(size: number): this;
446
+ clearCache(): this;
447
+ getCurrentContext(): LoadContext | null;
448
+ fieldOptions(options: ProcessFieldsOptions): this;
449
+ section(section: FieldProcessorSection): this;
450
+ getSection(name: string): FieldProcessorSection | undefined;
451
+ encoders(encoders: Record<string, Encoder>): this;
452
+ decoders(decoders: Record<string, LoadFormatParser>): this;
453
+ getEncoder(name: string): Encoder | undefined;
454
+ getDecoder(name: string): LoadFormatParser | undefined;
455
+ filter(f: RegExp): this;
456
+ loadObject<T = any>(data: T, container?: any, options?: LoadObjectOptions): Promise<T>;
457
+ load<T = unknown>(fileName: string, cwd?: string, container?: unknown, noProcess?: boolean, ld?: LoadContext): Promise<T | null>;
458
+ writeAll(option?: WriteOutputsOption): Promise<void>;
459
+ }
460
+
461
+ declare interface ObjectorDecoratorOptions {
462
+ name?: string;
463
+ }
464
+
465
+ export declare class ObjectorPlugin {
466
+ protected readonly o: Objector;
467
+ protected readonly context: {
468
+ path: string;
469
+ root: any;
470
+ options: ProcessFieldsOptions;
471
+ value?: string | object | number | null;
472
+ key?: string;
473
+ args?: any[];
474
+ rawArgs?: {
475
+ value: string;
476
+ quoted: boolean;
477
+ }[];
478
+ tags?: Record<string, string[]>;
479
+ parent?: any;
480
+ config?: Record<string, any>;
481
+ };
482
+ constructor(o: Objector);
483
+ }
484
+
485
+ export declare type ObjectorPluginConstructor = new (o: Objector, ...args: any[]) => ObjectorPlugin;
486
+
487
+ declare type ObjectorPluginFunction = (o: Objector) => void;
488
+
489
+ export declare interface Output {
490
+ name: string;
491
+ type?: 'json' | 'yaml' | 'text';
492
+ value: any;
493
+ class?: string;
494
+ }
495
+
496
+ /**
497
+ * Adds indentation to each line of a string.
498
+ * Useful for formatting multi-line text with consistent indentation.
499
+ *
500
+ * @example
501
+ * padBlock('hello\\nworld', 2) // ' hello\\n world'
502
+ * padBlock('a|b|c', 1, '|', '-') // '-a|-b|-c'
503
+ *
504
+ * @param str - The string to indent
505
+ * @param indent - The number of padding units to add
506
+ * @param separator - The separator between lines (default: '\\n')
507
+ * @param padder - The character to repeat for padding (default: ' ')
508
+ * @returns The indented string
509
+ */
510
+ export declare const padBlock: (str: string, indent: number, separator?: string, padder?: string) => string;
511
+
512
+ /**
513
+ * Converts a string to PascalCase (UpperCamelCase).
514
+ * Handles spaces, underscores, and hyphens as word separators.
515
+ *
516
+ * @example
517
+ * pascal('hello_world') // 'HelloWorld'
518
+ * pascal('hello world') // 'HelloWorld'
519
+ * pascal('helloWorld') // 'HelloWorld'
520
+ *
521
+ * @param v - The string to convert
522
+ * @returns The string in PascalCase
523
+ */
524
+ export declare const pascal: (v: string) => string;
525
+
526
+ /**
527
+ * @public
528
+ * @param obj
529
+ * @param options
530
+ * @returns
531
+ */
532
+ export declare const processFields: (obj: any, options?: ProcessFieldsOptions) => Promise<any>;
533
+
534
+ export declare interface ProcessFieldsOptions {
535
+ sources?: FieldProcessorMap;
536
+ keys?: FieldProcessorMap;
537
+ sections?: FieldProcessorSectionMap;
538
+ filters?: RegExp[];
539
+ root?: Record<any, any>;
540
+ globalContext?: any;
541
+ onSection?: FieldProcessorSectionFunc;
542
+ onSectionConfig?: FieldProcessorSectionConfigFunc;
543
+ configParser?: (configText: string) => any;
544
+ }
545
+
546
+ export declare const section: (options?: SectionOptions) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (section: FieldProcessorSection) => any>) => void;
547
+
548
+ declare type SectionOptions = ObjectorDecoratorOptions;
549
+
550
+ /**
551
+ * Selects a value from a nested object using a path string with advanced querying capabilities
552
+ *
553
+ * Supports:
554
+ * - Dot notation: 'user.profile.name'
555
+ * - Array indexing: 'users.0' or 'users[0]'
556
+ * - Array filtering: 'users.[name=John].age'
557
+ * - References: 'users.\{activeUserId\}.name'
558
+ * - Optional paths: 'user.profile?.bio'
559
+ * - Default values: 'config.timeout?=5000'
560
+ *
561
+ * @public
562
+ * @param from - The root object to select from
563
+ * @param path - The path string to navigate
564
+ * @param options - Optional configuration
565
+ * @returns The selected value or undefined
566
+ *
567
+ * @example
568
+ * ```typescript
569
+ * const obj = { user: { name: 'Alice', age: 30 } }
570
+ * select(obj, 'user.name') // 'Alice'
571
+ * select(obj, 'user.email', { defaultValue: 'N/A' }) // 'N/A'
572
+ * ```
573
+ */
574
+ export declare const select: <T = any>(from: any, path: string, options?: SelectOptions) => T | undefined;
575
+
576
+ /**
577
+ * Options for configuring the select function behavior
578
+ * @public
579
+ */
580
+ export declare interface SelectOptions {
581
+ /** Value to set at the selected path */
582
+ set?: any;
583
+ /** Alternative key to use (currently unused) */
584
+ key?: string;
585
+ /** Path separator character (default: '.') */
586
+ separator?: string;
587
+ /** Default value to return when path is not found */
588
+ defaultValue?: any;
589
+ /** If true, returns undefined instead of throwing on missing paths */
590
+ optional?: boolean;
591
+ }
592
+
593
+ export declare const sharedFunction: (options?: SharedFunctionOptions) => (_: any, ctx: ClassMethodDecoratorContext<ObjectorPlugin, (...args: any[]) => any>) => void;
594
+
595
+ declare type SharedFunctionOptions = ObjectorDecoratorOptions;
596
+
597
+ /**
598
+ * Converts a string to snake_case or custom_case.
599
+ * Inserts the separator between lowercase and uppercase characters.
600
+ *
601
+ * @example
602
+ * snake('helloWorld', '_') // 'hello_world'
603
+ * snake('HelloWorld', '-') // 'hello-world'
604
+ * snake('hello world', '_') // 'hello_world'
605
+ *
606
+ * @param v - The string to convert
607
+ * @param separator - The separator to use between words (default: '_')
608
+ * @returns The string in snake case with the specified separator
609
+ */
610
+ export declare const snake: (v: string, separator?: string) => string;
611
+
612
+ /**
613
+ * Sorts an array by a selector function with custom comparison
614
+ * Uses a shallow copy to avoid mutating the original array
615
+ * @typeParam T - Type of array items
616
+ * @typeParam U - Type of comparison values
617
+ * @param arr - Array to sort
618
+ * @param selector - Function to extract comparison value from item
619
+ * @param compare - Comparison function (default: numeric comparison)
620
+ * @returns New sorted array
621
+ * @public
622
+ */
623
+ export declare const sortBy: <T, U>(arr: T[], selector: (item: T) => U, compare?: (a: U, b: U) => number) => T[];
624
+
625
+ declare type SourceFunc = (...args: any[]) => any;
626
+
627
+ export declare const splitNested: (str: string, separator: string, open?: string, close?: string) => string[];
628
+
629
+ /**
630
+ * Splits a string by a separator while respecting quoted values.
631
+ * Quoted values can contain the separator without being split.
632
+ * Supports both single (') and double (") quotes.
633
+ *
634
+ * @param input - The string to split
635
+ * @param separator - Single or multi-character separator (default: ',')
636
+ * @returns Array of objects with value and quoted status
637
+ *
638
+ * @example
639
+ * splitWithQuotes('hello, "world", test')
640
+ * // Returns: [
641
+ * // { value: 'hello', quoted: false },
642
+ * // { value: 'world', quoted: true },
643
+ * // { value: 'test', quoted: false }
644
+ * // ]
645
+ *
646
+ * @example
647
+ * splitWithQuotes('a:: "b:: c":: d', '::')
648
+ * // Returns: [
649
+ * // { value: 'a', quoted: false },
650
+ * // { value: 'b:: c', quoted: true },
651
+ * // { value: 'd', quoted: false }
652
+ * // ]
653
+ */
654
+ export declare const splitWithQuotes: (input: string, separator?: string) => {
655
+ value: string;
656
+ quoted: boolean;
657
+ }[];
658
+
659
+ export declare const stripIndent: (value: string) => string;
660
+
661
+ /**
662
+ * Replaces tokens in a string with values from an object.
663
+ * Tokens are in the format `$\{key\}`.
664
+ *
665
+ * @example
666
+ * tokenize('Hello $\{name\}', { name: 'World' }) // 'Hello World'
667
+ * tokenize('$\{greeting\} $\{name\}!', { greeting: 'Hi', name: 'Alice' }) // 'Hi Alice!'
668
+ * tokenize('$\{missing\}', {}) // ''
669
+ *
670
+ * @param str - The string containing tokens
671
+ * @param from - An object with key-value pairs for token replacement
672
+ * @param tokenizer - The regex pattern for token matching (default: `/\$\{([^}]+)\}/g`)
673
+ * @returns The string with tokens replaced by values from the object
674
+ */
675
+ export declare const tokenize: (str: string, from: Record<string, unknown>, tokenizer?: RegExp) => string;
676
+
677
+ /**
678
+ * Converts an object's entries into an array of objects with a key property
679
+ * @typeParam T - The type of items in the resulting array
680
+ * @param from - Object to convert
681
+ * @param key - Property name to use for keys (default: 'name')
682
+ * @returns Array of objects with key properties
683
+ * @example
684
+ * toList({ a: { value: 1 }, b: { value: 2 } }) // [{ name: 'a', value: 1 }, { name: 'b', value: 2 }]
685
+ * @public
686
+ */
687
+ export declare const toList: <T>(from: Record<string, unknown>, key?: string) => T[];
688
+
689
+ /**
690
+ * Converts an array into an object indexed by a key property, excluding the key from items
691
+ * @typeParam T - The type of the resulting object values
692
+ * @param from - Array to convert
693
+ * @param key - Property name to use as key (default: 'name')
694
+ * @returns Object indexed by key values, without the key property in values
695
+ * @example
696
+ * toObject([{ name: 'a', value: 1 }]) // { a: { value: 1 } }
697
+ * @public
698
+ */
699
+ export declare const toObject: <T extends Record<string, unknown>>(from: T[], key?: string) => Record<string, Omit<T, typeof key>>;
700
+
701
+ /**
702
+ * Converts an array into an object indexed by a key property, keeping the full items
703
+ * @typeParam T - The type of the resulting object
704
+ * @param from - Array to convert
705
+ * @param key - Property name to use as key (default: 'name')
706
+ * @returns Object indexed by key values
707
+ * @example
708
+ * toObjectWithKey([{ name: 'a', value: 1 }]) // { a: { name: 'a', value: 1 } }
709
+ * @public
710
+ */
711
+ export declare const toObjectWithKey: <T extends Record<string, unknown>>(from: T[], key?: string) => Record<string, T>;
712
+
713
+ export declare const variable: (options?: VariableOptions) => (_: any, ctx: ClassFieldDecoratorContext<ObjectorPlugin, any>) => void;
714
+
715
+ declare type VariableOptions = ObjectorDecoratorOptions;
716
+
717
+ export declare const writeFormat: (filePath: string, content: any, options?: WriteFormatOptions) => Promise<void>;
718
+
719
+ /**
720
+ * @public
721
+ */
722
+ export declare interface WriteFormatEncoder {
723
+ matching?: string[];
724
+ fn: (data: any) => Promise<string> | string;
725
+ }
726
+
727
+ /**
728
+ * @public
729
+ */
730
+ export declare interface WriteFormatOptions {
731
+ format: string;
732
+ encoders?: Record<string, WriteFormatEncoder>;
733
+ }
734
+
735
+ export declare const writeOutput: (o: Output, options?: WriteOutputOption) => Promise<void>;
736
+
737
+ export declare interface WriteOutputOption {
738
+ targetDirectory?: string;
739
+ writing?: (output: Output) => boolean | undefined | void;
740
+ classes?: string[];
741
+ classRequired?: boolean;
742
+ }
743
+
744
+ export declare const writeOutputs: (outputs: Output[], options?: WriteOutputsOption) => Promise<void>;
745
+
746
+ export declare interface WriteOutputsOption extends WriteOutputOption {
747
+ removeFirst?: boolean;
748
+ }
749
+
750
+ export { }
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var Ar=Object.create;var{getPrototypeOf:ro,defineProperty:Q,getOwnPropertyNames:Er,getOwnPropertyDescriptor:to}=Object,Qe=Object.prototype.hasOwnProperty;function Xe(e){return this[e]}var R=(e,r,t)=>{var n=Er(r);for(let o of n)if(!Qe.call(e,o)&&o!=="default")Q(e,o,{get:Xe.bind(r,o),enumerable:!0});if(t){for(let o of n)if(!Qe.call(t,o)&&o!=="default")Q(t,o,{get:Xe.bind(r,o),enumerable:!0});return t}},no,oo,io=(e,r,t)=>{var n=e!=null&&typeof e==="object";if(n){var o=r?no??=new WeakMap:oo??=new WeakMap,i=o.get(e);if(i)return i}t=e!=null?Ar(ro(e)):{};let l=r||!e||!e.__esModule?Q(t,"default",{value:e,enumerable:!0}):t;for(let a of Er(e))if(!Qe.call(l,a))Q(l,a,{get:Xe.bind(e,a),enumerable:!0});if(n)o.set(e,l);return l};var so=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),br=(e,r)=>{return Object.defineProperty(e,"name",{value:r,enumerable:!1,configurable:!0}),e},ao=(e)=>e;function lo(e,r){this[e]=ao.bind(null,r)}var W=(e,r)=>{for(var t in r)Q(e,t,{get:r[t],enumerable:!0,configurable:!0,set:lo.bind(r,t)})};var Mr=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ae=(e)=>{throw TypeError(e)},uo=(e,r,t)=>(r in e)?Q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Ve=(e,r,t)=>r.has(e)||ae("Cannot "+t),po=(e,r)=>Object(r)!==r?ae('Cannot use the "in" operator on this value'):e.has(r),Or=(e,r,t)=>(Ve(e,r,"read from private field"),t?t.call(e):r.get(e));var vr=(e,r,t,n)=>(Ve(e,r,"write to private field"),n?n.call(e,t):r.set(e,t),t),fo=(e,r,t)=>(Ve(e,r,"access private method"),t),Sr=(e)=>[,,,Ar(e?.[Mr("metadata")]??null)],jr=["class","method","getter","setter","accessor","field","value","get","set"],se=(e)=>e!==void 0&&typeof e!=="function"?ae("Function expected"):e,co=(e,r,t,n,o)=>({kind:jr[e],name:r,metadata:n,addInitializer:(i)=>t._?ae("Already initialized"):o.push(se(i||null))}),Ze=(e,r)=>uo(r,Mr("metadata"),e[3]),kr=(e,r,t,n)=>{for(var o=0,i=e[r>>1],l=i&&i.length;o<l;o++)r&1?i[o].call(t):n=i[o].call(t,n);return n},m=(e,r,t,n,o,i)=>{var l,a,p,h,O,y=r&7,u=!!(r&8),d=!!(r&16),A=y>3?e.length+1:y?u?1:2:0,g=jr[y+5],v=y>3&&(e[A-1]=[]),f=e[A]||(e[A]=[]),j=y&&(!d&&!u&&(o=o.prototype),y<5&&(y>3||!d)&&to(y<4?o:{get[t](){return Or(this,i)},set[t](S){vr(this,i,S)}},t));y?d&&y<4&&br(i,(y>2?"set ":y>1?"get ":"")+t):br(o,t);for(var b=n.length-1;b>=0;b--){if(h=co(y,t,p={},e[3],f),y){if(h.static=u,h.private=d,O=h.access={has:d?(S)=>po(o,S):(S)=>(t in S)},y^3)O.get=d?(S)=>(y^1?Or:fo)(S,o,y^4?i:j.get):(S)=>S[t];if(y>2)O.set=d?(S,k)=>vr(S,o,k,y^4?i:j.set):(S,k)=>S[t]=k}if(a=(0,n[b])(y?y<4?d?i:j[g]:y>4?void 0:{get:j.get,set:j.set}:o,h),p._=1,y^4||a===void 0)se(a)&&(y>4?v.unshift(a):y?d?i=a:j[g]=a:o=a);else if(typeof a!=="object"||a===null)ae("Object expected");else se(l=a.get)&&(j.get=l),se(l=a.set)&&(j.set=l),se(l=a.init)&&v.unshift(l)}return y||Ze(e,o),j&&Q(o,t,j),d?y^4?i:j:o};var Rt=so((pl,Ft)=>{var{defineProperty:hr,getOwnPropertyNames:ci,getOwnPropertyDescriptor:mi}=Object,gi=Object.prototype.hasOwnProperty,kt=new WeakMap,yi=(e)=>{var r=kt.get(e),t;if(r)return r;if(r=hr({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function")ci(e).map((n)=>!gi.call(r,n)&&hr(r,n,{get:()=>e[n],enumerable:!(t=mi(e,n))||t.enumerable}));return kt.set(e,r),r},di=(e,r)=>{for(var t in r)hr(e,t,{get:r[t],enumerable:!0,configurable:!0,set:(n)=>r[t]=()=>n})},Dt={};di(Dt,{splitWithQuotes:()=>hi,splitNested:()=>wi});Ft.exports=yi(Dt);var wi=(e,r,t="(",n=")")=>{let o=0,i="",l=[];for(let a of e){if(i+=a,a===t)o++;if(a===n)o--;if(o===0&&a===r)l.push(i.slice(0,-1)),i=""}if(i)l.push(i);return l},hi=(e,r=",")=>{let t=[],n=e.length,o=r.length,i=0,l=(a)=>{if(a+o>n)return!1;for(let p=0;p<o;p++)if(e[a+p]!==r[p])return!1;return!0};while(i<n){while(i<n&&e[i]===" ")i++;if(i>=n)break;let a="",p=e[i]==='"'||e[i]==="'";if(p){let h=e[i++];while(i<n&&e[i]!==h)a+=e[i++];if(i<n)i++}else{while(i<n&&!l(i)){let h=e[i];if(h==='"'||h==="'"){a+=h,i++;while(i<n&&e[i]!==h)a+=e[i++];if(i<n)a+=e[i++]}else a+=e[i++]}a=a.trim()}if(a)t.push({value:a,quoted:p});if(l(i))i+=o}return t}});var N={};W(N,{writeOutputs:()=>me,writeOutput:()=>xe,writeFormat:()=>Re,variable:()=>Yr,tokenize:()=>yr,toObjectWithKey:()=>or,toObject:()=>ge,toList:()=>Z,stripIndent:()=>dr,sortBy:()=>ar,snake:()=>re,sharedFunction:()=>Gr,select:()=>D,section:()=>Tr,processFields:()=>C,pascal:()=>ee,padBlock:()=>T,nonNullMap:()=>ir,navigate:()=>We,mergeAll:()=>z,merge:()=>_,makeFieldProcessorMap:()=>K,makeFieldProcessorList:()=>qe,makeFieldProcessor:()=>pe,macro:()=>c,locate:()=>V,loadFormat:()=>fe,key:()=>Kr,importList:()=>$e,importGlob:()=>tr,globMap:()=>ce,getProcessor:()=>ue,getArgs:()=>Fe,find:()=>fr,exists:()=>q,encoder:()=>Qr,defined:()=>sr,deepClone:()=>I,decoder:()=>Xr,conditionPredicates:()=>L,changeCase:()=>te,capital:()=>we,camel:()=>he,asyncMap:()=>lr,ObjectorPlugin:()=>H,Objector:()=>$t,NavigateResult:()=>M,NavigateAction:()=>Ce,Logger:()=>Ke,AsyncFunction:()=>gr});var ze={};W(ze,{processFields:()=>C,makeFieldProcessorMap:()=>K,makeFieldProcessorList:()=>qe,makeFieldProcessor:()=>pe,getProcessor:()=>ue,getArgs:()=>Fe});var mo=Object.create,{getPrototypeOf:go,defineProperty:Dr,getOwnPropertyNames:yo}=Object,wo=Object.prototype.hasOwnProperty,ho=(e,r,t)=>{t=e!=null?mo(go(e)):{};let n=r||!e||!e.__esModule?Dr(t,"default",{value:e,enumerable:!0}):t;for(let o of yo(e))if(!wo.call(n,o))Dr(n,o,{get:()=>e[o],enumerable:!0});return n},bo=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Oo=bo((e,r)=>{var{defineProperty:t,getOwnPropertyNames:n,getOwnPropertyDescriptor:o}=Object,i=Object.prototype.hasOwnProperty,l=new WeakMap,a=(u)=>{var d=l.get(u),A;if(d)return d;if(d=t({},"__esModule",{value:!0}),u&&typeof u==="object"||typeof u==="function")n(u).map((g)=>!i.call(d,g)&&t(d,g,{get:()=>u[g],enumerable:!(A=o(u,g))||A.enumerable}));return l.set(u,d),d},p=(u,d)=>{for(var A in d)t(u,A,{get:d[A],enumerable:!0,configurable:!0,set:(g)=>d[A]=()=>g})},h={};p(h,{splitWithQuotes:()=>y,splitNested:()=>O}),r.exports=a(h);var O=(u,d,A="(",g=")")=>{let v=0,f="",j=[];for(let b of u){if(f+=b,b===A)v++;if(b===g)v--;if(v===0&&b===d)j.push(f.slice(0,-1)),f=""}if(f)j.push(f);return j},y=(u,d=",")=>{let A=[],g=u.length,v=d.length,f=0,j=(b)=>{if(b+v>g)return!1;for(let S=0;S<v;S++)if(u[b+S]!==d[S])return!1;return!0};while(f<g){while(f<g&&u[f]===" ")f++;if(f>=g)break;let b="",S=u[f]==='"'||u[f]==="'";if(S){let k=u[f++];while(f<g&&u[f]!==k)b+=u[f++];if(f<g)f++}else{while(f<g&&!j(f)){let k=u[f];if(k==='"'||k==="'"){b+=k,f++;while(f<g&&u[f]!==k)b+=u[f++];if(f<g)b+=u[f++]}else b+=u[f++]}b=b.trim()}if(b)A.push({value:b,quoted:S});if(j(f))f+=v}return A}}),vo=ho(Oo(),1),X;((e)=>{e[e.Explore=0]="Explore",e[e.SkipSiblings=1]="SkipSiblings",e[e.NoExplore=2]="NoExplore",e[e.ReplaceParent=3]="ReplaceParent",e[e.DeleteParent=4]="DeleteParent",e[e.MergeParent=5]="MergeParent",e[e.ReplaceItem=6]="ReplaceItem",e[e.DeleteItem=7]="DeleteItem"})(X||={});class x{action;by;skipSiblings;reexplore;constructor(e,r,t,n){this.action=e,this.by=r,this.skipSiblings=t,this.reexplore=n}static _explore=new x(0);static _noExplore=new x(2);static _skipSiblings=new x(1);static _deleteParent=new x(4);static ReplaceParent(e,r){return new x(3,e,void 0,r)}static SkipSiblings(){return x._skipSiblings}static Explore(){return x._explore}static NoExplore(){return x._noExplore}static DeleteParent(){return x._deleteParent}static MergeParent(e){return new x(5,e)}static ReplaceItem(e,r){return new x(6,e,r)}static DeleteItem(e){return new x(7,void 0,e)}}var Ao=async(e,r)=>{let t=new WeakSet,n=[],o=[],i=async(a,p,h)=>{let O=a===null,y=O?x.Explore():await r({key:a,value:p,path:n,parent:h,parents:o});if(p&&typeof p==="object"&&y.action===0){if(t.has(p))return y;if(t.add(p),!O)n.push(a),o.push(h);let u=p;while(await l(u,a,h))u=h[a];if(!O)o.pop(),n.pop()}return y},l=async(a,p,h)=>{let O=Object.keys(a),y=O.length;for(let u=0;u<y;u++){let d=O[u],A=a[d],g=await i(d,A,a),v=g.action;if(v===0||v===2)continue;if(v===6){if(a[d]=g.by,g.skipSiblings)return;continue}if(v===7){if(delete a[d],g.skipSiblings)return;continue}if(v===1)return;if(v===3){if(p===null)throw Error("Cannot replace root object");if(h[p]=g.by,g.reexplore)return!0;return}if(v===4){if(p===null)throw Error("Cannot delete root object");delete h[p];return}if(v===5)delete a[d],Object.assign(a,g.by)}};await i(null,e,null)},Eo=Object.create,{getPrototypeOf:Mo,defineProperty:Fr,getOwnPropertyNames:So}=Object,jo=Object.prototype.hasOwnProperty,ko=(e,r,t)=>{t=e!=null?Eo(Mo(e)):{};let n=r||!e||!e.__esModule?Fr(t,"default",{value:e,enumerable:!0}):t;for(let o of So(e))if(!jo.call(n,o))Fr(n,o,{get:()=>e[o],enumerable:!0});return n},Do=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Fo=Do((e,r)=>{var{defineProperty:t,getOwnPropertyNames:n,getOwnPropertyDescriptor:o}=Object,i=Object.prototype.hasOwnProperty,l=new WeakMap,a=(u)=>{var d=l.get(u),A;if(d)return d;if(d=t({},"__esModule",{value:!0}),u&&typeof u==="object"||typeof u==="function")n(u).map((g)=>!i.call(d,g)&&t(d,g,{get:()=>u[g],enumerable:!(A=o(u,g))||A.enumerable}));return l.set(u,d),d},p=(u,d)=>{for(var A in d)t(u,A,{get:d[A],enumerable:!0,configurable:!0,set:(g)=>d[A]=()=>g})},h={};p(h,{splitWithQuotes:()=>y,splitNested:()=>O}),r.exports=a(h);var O=(u,d,A="(",g=")")=>{let v=0,f="",j=[];for(let b of u){if(f+=b,b===A)v++;if(b===g)v--;if(v===0&&b===d)j.push(f.slice(0,-1)),f=""}if(f)j.push(f);return j},y=(u,d=",")=>{let A=[],g=u.length,v=d.length,f=0,j=(b)=>{if(b+v>g)return!1;for(let S=0;S<v;S++)if(u[b+S]!==d[S])return!1;return!0};while(f<g){while(f<g&&u[f]===" ")f++;if(f>=g)break;let b="",S=u[f]==='"'||u[f]==="'";if(S){let k=u[f++];while(f<g&&u[f]!==k)b+=u[f++];if(f<g)f++}else{while(f<g&&!j(f)){let k=u[f];if(k==='"'||k==="'"){b+=k,f++;while(f<g&&u[f]!==k)b+=u[f++];if(f<g)b+=u[f++]}else b+=u[f++]}b=b.trim()}if(b)A.push({value:b,quoted:S});if(j(f))f+=v}return A}}),Ro=ko(Fo(),1),xo=/^\[([^=\]]*)([=]*)([^\]]*)\]$/,$o=/^([^[\]]*)\[([^\]]*)]$/,He=(e,r,t,n)=>{if(e.startsWith("{")&&e.endsWith("}")){let o=e.substring(1,e.length-1);return le(r,o,t)?.toString()}return n?e:void 0},Co=(e,r,t,n)=>{let o=He(r,t,n);if(o)return le(e,o,n);let i=xo.exec(r);if(i){let[,a,p,h]=i,O=He(a.trim(),t,n,!0),y=He(h.trim(),t,n,!0);if(Array.isArray(e)&&(p==="="||p==="==")&&O)return e.find((u)=>u?.[O]==y)}let l=$o.exec(r);if(l){let[,a,p]=l;return e?.[a]?.[p]}return e?.[r]},le=(e,r,t)=>{let n=void 0,o=void 0,i=r??"",l=(y)=>{if(!y)return[y,!1];return y.endsWith("?")?[y.substring(0,y.length-1),!0]:[y,!1]},a=(y,u)=>{let[d,A]=l(u.pop());if(!d){if(t?.set!==void 0&&o!==void 0&&n!==void 0)n[o]=t.set;return y}let g=Co(y,d,e,t);if(g===void 0){if(A||t?.optional||t?.defaultValue!==void 0)return;throw Error(`Unknown path element: "${d}" in "${i}"`)}return n=y,o=d,a(g,u)},p=Ro.splitNested(i,t?.separator??".","{","}"),h=void 0;if(p.length>0&&p[p.length-1].startsWith("?="))h=p.pop()?.substring(2);p.reverse();let O=a(e,p);if(O===void 0)return h??t?.defaultValue;return O},Rr=(e,r)=>{if(typeof e.value==="string"){if(e.quoted)return e.value;if(e.value.startsWith("[")&&e.value.endsWith("]")){let t=e.value.slice(1,-1);if(t.trim()==="")return[];return t.split(";").map((n)=>{let o=n.trim();if(!isNaN(+o))return+o;return o})}if(e.value.startsWith("{")&&e.value.endsWith("}")){if(e.value.slice(1,-1).trim()==="")return{}}if(e.value==="null")return null;if(e.value==="undefined")return;if(e.value.startsWith("@"))return e.value.slice(1);if(!isNaN(+e.value))return+e.value}return r(e.value)},De=(e,r,t,n,o,i)=>{let l=n?.(e)??e,a=o(l);if(a[0])return a[1];if(!r){let p=le(t,e),h=o(p);if(h[0])return h[1]}throw Error(i)},$r=(e,r,t,n,o)=>{let i=typeof e.types==="function"?e.types(n,r.value,o):e.types?.[n];if(!i||i==="ref")return Rr(r,(a)=>le(t,a));let l=Rr(r,()=>r.value);if(Array.isArray(i)){if(!i.includes(l))throw Error(`Argument ${n.toString()} must be one of [${i.join(", ")}]: ${l}`);return l}if(typeof i==="string"){if(i.endsWith("?")){let a=i.slice(0,-1);if(r.value==="null")return x.ReplaceItem(null);if(r.value==="undefined")return x.ReplaceItem(void 0);if(r.value==="")return"";i=a}switch(i){case"any":return l;case"array":return De(l,r.quoted,t,null,(a)=>[Array.isArray(a),a],`Argument ${n.toString()} must be an array: ${l}`);case"object":return De(l,r.quoted,t,null,(a)=>[typeof a==="object"&&a!==null,a],`Argument ${n.toString()} must be an object: ${l}`);case"number":return De(l,r.quoted,t,(a)=>Number(a),(a)=>[!isNaN(a),a],`Argument ${n.toString()} must be a number: ${l}`);case"boolean":return De(l,r.quoted,t,null,(a)=>{if([!0,"true","1",1,"yes","on"].includes(a))return[!0,!0];if([!1,"false","0",0,"no","off"].includes(a))return[!0,!1];if([null,"null","undefined",void 0,""].includes(a))return[!0,!1];if(Array.isArray(a))return[!0,a.length>0];return[!1,!1]},`Argument ${n.toString()} must be a boolean: ${l}`);case"string":return l.toString();default:throw Error(`Unknown type for argument ${n.toString()}: ${i}`)}}return i(l,t,n,r.quoted)},ue=(e,r)=>{let t=e?.[r];if(t===void 0)throw Error(`Unhandled field processor type: ${r}`);return typeof t==="function"?{options:{},fn:t}:{options:t,fn:t.fn}},Cr=(e)=>!e.quoted&&e.value.startsWith("."),Wo=(e)=>{let r={};for(let t of e){if(!Cr(t))continue;let n=t.value.indexOf("="),o=n>-1?t.value.slice(1,n):t.value.slice(1),i=n>-1?t.value.slice(n+1):"";if(i.length>=2){let l=i[0],a=i[i.length-1];if(l==='"'&&a==='"'||l==="'"&&a==="'")i=i.slice(1,-1)}if(!r[o])r[o]=[];r[o].push(i)}return r},Fe=(e,r,t)=>{let n=vo.splitWithQuotes(e??""),o=Wo(n),i=n.filter((a)=>!Cr(a)),l=r.options.processArgs===!1?[]:i.map((a,p)=>$r(r.options,a,t,p,i));return{rawArgs:i,parsedArgs:l,tags:o}},No=(e)=>{return e!==null&&typeof e==="object"&&"action"in e},Io=(e,r)=>r.keys!==void 0&&e.key.startsWith(".")&&r.keys[e.key.substring(1)]!==void 0,Lo=async(e,r,t,n)=>{let{key:o,parent:i}=e,l=ue(n.keys,o.substring(1));if(l.options.processArgs!==!1&&(typeof l.options.types==="function"||l.options.types?.[0]!==void 0))e.value=$r(l.options,{value:e.value,quoted:!1},t,0,[]);if(typeof e.value!=="string")await C(e.value,{...n,root:{...t,parent:e.parent,parents:e.parents},filters:[...n.filters??[],...l.options.filters??[]]});let a=await l.fn({path:r,root:t,parent:i,key:o,options:n,value:e.value,args:[],rawArgs:[],tags:{}});return No(a)?a:x.ReplaceParent(a)},xr=(e)=>{let r=e.split(/\r?\n/),t=r.filter((o)=>o.trim().length>0).map((o)=>/^[ \t]*/.exec(o)?.[0].length??0),n=t.length>0?Math.min(...t):0;if(n===0)return e;return r.map((o)=>o.slice(n)).join(`
1
+ var Ar=Object.create;var{getPrototypeOf:ro,defineProperty:Q,getOwnPropertyNames:Er,getOwnPropertyDescriptor:to}=Object,Qe=Object.prototype.hasOwnProperty;function Xe(e){return this[e]}var R=(e,r,t)=>{var n=Er(r);for(let o of n)if(!Qe.call(e,o)&&o!=="default")Q(e,o,{get:Xe.bind(r,o),enumerable:!0});if(t){for(let o of n)if(!Qe.call(t,o)&&o!=="default")Q(t,o,{get:Xe.bind(r,o),enumerable:!0});return t}},no,oo,io=(e,r,t)=>{var n=e!=null&&typeof e==="object";if(n){var o=r?no??=new WeakMap:oo??=new WeakMap,i=o.get(e);if(i)return i}t=e!=null?Ar(ro(e)):{};let l=r||!e||!e.__esModule?Q(t,"default",{value:e,enumerable:!0}):t;for(let a of Er(e))if(!Qe.call(l,a))Q(l,a,{get:Xe.bind(e,a),enumerable:!0});if(n)o.set(e,l);return l};var so=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),br=(e,r)=>{return Object.defineProperty(e,"name",{value:r,enumerable:!1,configurable:!0}),e},ao=(e)=>e;function lo(e,r){this[e]=ao.bind(null,r)}var W=(e,r)=>{for(var t in r)Q(e,t,{get:r[t],enumerable:!0,configurable:!0,set:lo.bind(r,t)})};var Mr=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ae=(e)=>{throw TypeError(e)},uo=(e,r,t)=>(r in e)?Q(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t;var Ve=(e,r,t)=>r.has(e)||ae("Cannot "+t),po=(e,r)=>Object(r)!==r?ae('Cannot use the "in" operator on this value'):e.has(r),Or=(e,r,t)=>(Ve(e,r,"read from private field"),t?t.call(e):r.get(e));var vr=(e,r,t,n)=>(Ve(e,r,"write to private field"),n?n.call(e,t):r.set(e,t),t),fo=(e,r,t)=>(Ve(e,r,"access private method"),t),Sr=(e)=>[,,,Ar(e?.[Mr("metadata")]??null)],jr=["class","method","getter","setter","accessor","field","value","get","set"],se=(e)=>e!==void 0&&typeof e!=="function"?ae("Function expected"):e,co=(e,r,t,n,o)=>({kind:jr[e],name:r,metadata:n,addInitializer:(i)=>t._?ae("Already initialized"):o.push(se(i||null))}),Ze=(e,r)=>uo(r,Mr("metadata"),e[3]),kr=(e,r,t,n)=>{for(var o=0,i=e[r>>1],l=i&&i.length;o<l;o++)r&1?i[o].call(t):n=i[o].call(t,n);return n},m=(e,r,t,n,o,i)=>{var l,a,p,h,O,y=r&7,u=!!(r&8),d=!!(r&16),A=y>3?e.length+1:y?u?1:2:0,g=jr[y+5],v=y>3&&(e[A-1]=[]),f=e[A]||(e[A]=[]),j=y&&(!d&&!u&&(o=o.prototype),y<5&&(y>3||!d)&&to(y<4?o:{get[t](){return Or(this,i)},set[t](S){vr(this,i,S)}},t));y?d&&y<4&&br(i,(y>2?"set ":y>1?"get ":"")+t):br(o,t);for(var b=n.length-1;b>=0;b--){if(h=co(y,t,p={},e[3],f),y){if(h.static=u,h.private=d,O=h.access={has:d?(S)=>po(o,S):(S)=>(t in S)},y^3)O.get=d?(S)=>(y^1?Or:fo)(S,o,y^4?i:j.get):(S)=>S[t];if(y>2)O.set=d?(S,k)=>vr(S,o,k,y^4?i:j.set):(S,k)=>S[t]=k}if(a=(0,n[b])(y?y<4?d?i:j[g]:y>4?void 0:{get:j.get,set:j.set}:o,h),p._=1,y^4||a===void 0)se(a)&&(y>4?v.unshift(a):y?d?i=a:j[g]=a:o=a);else if(typeof a!=="object"||a===null)ae("Object expected");else se(l=a.get)&&(j.get=l),se(l=a.set)&&(j.set=l),se(l=a.init)&&v.unshift(l)}return y||Ze(e,o),j&&Q(o,t,j),d?y^4?i:j:o};var Rt=so((il,Ft)=>{var{defineProperty:hr,getOwnPropertyNames:ci,getOwnPropertyDescriptor:mi}=Object,gi=Object.prototype.hasOwnProperty,kt=new WeakMap,yi=(e)=>{var r=kt.get(e),t;if(r)return r;if(r=hr({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function")ci(e).map((n)=>!gi.call(r,n)&&hr(r,n,{get:()=>e[n],enumerable:!(t=mi(e,n))||t.enumerable}));return kt.set(e,r),r},di=(e,r)=>{for(var t in r)hr(e,t,{get:r[t],enumerable:!0,configurable:!0,set:(n)=>r[t]=()=>n})},Dt={};di(Dt,{splitWithQuotes:()=>hi,splitNested:()=>wi});Ft.exports=yi(Dt);var wi=(e,r,t="(",n=")")=>{let o=0,i="",l=[];for(let a of e){if(i+=a,a===t)o++;if(a===n)o--;if(o===0&&a===r)l.push(i.slice(0,-1)),i=""}if(i)l.push(i);return l},hi=(e,r=",")=>{let t=[],n=e.length,o=r.length,i=0,l=(a)=>{if(a+o>n)return!1;for(let p=0;p<o;p++)if(e[a+p]!==r[p])return!1;return!0};while(i<n){while(i<n&&e[i]===" ")i++;if(i>=n)break;let a="",p=e[i]==='"'||e[i]==="'";if(p){let h=e[i++];while(i<n&&e[i]!==h)a+=e[i++];if(i<n)i++}else{while(i<n&&!l(i)){let h=e[i];if(h==='"'||h==="'"){a+=h,i++;while(i<n&&e[i]!==h)a+=e[i++];if(i<n)a+=e[i++]}else a+=e[i++]}a=a.trim()}if(a)t.push({value:a,quoted:p});if(l(i))i+=o}return t}});var N={};W(N,{writeOutputs:()=>me,writeOutput:()=>xe,writeFormat:()=>Re,variable:()=>Yr,tokenize:()=>yr,toObjectWithKey:()=>or,toObject:()=>ge,toList:()=>Z,stripIndent:()=>dr,sortBy:()=>ar,snake:()=>re,sharedFunction:()=>Gr,select:()=>D,section:()=>Tr,processFields:()=>C,pascal:()=>ee,padBlock:()=>T,nonNullMap:()=>ir,navigate:()=>We,mergeAll:()=>z,merge:()=>_,makeFieldProcessorMap:()=>K,makeFieldProcessorList:()=>qe,makeFieldProcessor:()=>pe,macro:()=>c,locate:()=>V,loadFormat:()=>fe,key:()=>Kr,importList:()=>$e,importGlob:()=>tr,globMap:()=>ce,getProcessor:()=>ue,getArgs:()=>Fe,find:()=>fr,exists:()=>q,encoder:()=>Qr,defined:()=>sr,deepClone:()=>I,decoder:()=>Xr,conditionPredicates:()=>L,changeCase:()=>te,capital:()=>we,camel:()=>he,asyncMap:()=>lr,ObjectorPlugin:()=>H,Objector:()=>$t,NavigateResult:()=>M,NavigateAction:()=>Ce,Logger:()=>Ke,AsyncFunction:()=>gr});var ze={};W(ze,{processFields:()=>C,makeFieldProcessorMap:()=>K,makeFieldProcessorList:()=>qe,makeFieldProcessor:()=>pe,getProcessor:()=>ue,getArgs:()=>Fe});var mo=Object.create,{getPrototypeOf:go,defineProperty:Dr,getOwnPropertyNames:yo}=Object,wo=Object.prototype.hasOwnProperty,ho=(e,r,t)=>{t=e!=null?mo(go(e)):{};let n=r||!e||!e.__esModule?Dr(t,"default",{value:e,enumerable:!0}):t;for(let o of yo(e))if(!wo.call(n,o))Dr(n,o,{get:()=>e[o],enumerable:!0});return n},bo=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Oo=bo((e,r)=>{var{defineProperty:t,getOwnPropertyNames:n,getOwnPropertyDescriptor:o}=Object,i=Object.prototype.hasOwnProperty,l=new WeakMap,a=(u)=>{var d=l.get(u),A;if(d)return d;if(d=t({},"__esModule",{value:!0}),u&&typeof u==="object"||typeof u==="function")n(u).map((g)=>!i.call(d,g)&&t(d,g,{get:()=>u[g],enumerable:!(A=o(u,g))||A.enumerable}));return l.set(u,d),d},p=(u,d)=>{for(var A in d)t(u,A,{get:d[A],enumerable:!0,configurable:!0,set:(g)=>d[A]=()=>g})},h={};p(h,{splitWithQuotes:()=>y,splitNested:()=>O}),r.exports=a(h);var O=(u,d,A="(",g=")")=>{let v=0,f="",j=[];for(let b of u){if(f+=b,b===A)v++;if(b===g)v--;if(v===0&&b===d)j.push(f.slice(0,-1)),f=""}if(f)j.push(f);return j},y=(u,d=",")=>{let A=[],g=u.length,v=d.length,f=0,j=(b)=>{if(b+v>g)return!1;for(let S=0;S<v;S++)if(u[b+S]!==d[S])return!1;return!0};while(f<g){while(f<g&&u[f]===" ")f++;if(f>=g)break;let b="",S=u[f]==='"'||u[f]==="'";if(S){let k=u[f++];while(f<g&&u[f]!==k)b+=u[f++];if(f<g)f++}else{while(f<g&&!j(f)){let k=u[f];if(k==='"'||k==="'"){b+=k,f++;while(f<g&&u[f]!==k)b+=u[f++];if(f<g)b+=u[f++]}else b+=u[f++]}b=b.trim()}if(b)A.push({value:b,quoted:S});if(j(f))f+=v}return A}}),vo=ho(Oo(),1),X;((e)=>{e[e.Explore=0]="Explore",e[e.SkipSiblings=1]="SkipSiblings",e[e.NoExplore=2]="NoExplore",e[e.ReplaceParent=3]="ReplaceParent",e[e.DeleteParent=4]="DeleteParent",e[e.MergeParent=5]="MergeParent",e[e.ReplaceItem=6]="ReplaceItem",e[e.DeleteItem=7]="DeleteItem"})(X||={});class x{action;by;skipSiblings;reexplore;constructor(e,r,t,n){this.action=e,this.by=r,this.skipSiblings=t,this.reexplore=n}static _explore=new x(0);static _noExplore=new x(2);static _skipSiblings=new x(1);static _deleteParent=new x(4);static ReplaceParent(e,r){return new x(3,e,void 0,r)}static SkipSiblings(){return x._skipSiblings}static Explore(){return x._explore}static NoExplore(){return x._noExplore}static DeleteParent(){return x._deleteParent}static MergeParent(e){return new x(5,e)}static ReplaceItem(e,r){return new x(6,e,r)}static DeleteItem(e){return new x(7,void 0,e)}}var Ao=async(e,r)=>{let t=new WeakSet,n=[],o=[],i=async(a,p,h)=>{let O=a===null,y=O?x.Explore():await r({key:a,value:p,path:n,parent:h,parents:o});if(p&&typeof p==="object"&&y.action===0){if(t.has(p))return y;if(t.add(p),!O)n.push(a),o.push(h);let u=p;while(await l(u,a,h))u=h[a];if(!O)o.pop(),n.pop()}return y},l=async(a,p,h)=>{let O=Object.keys(a),y=O.length;for(let u=0;u<y;u++){let d=O[u],A=a[d],g=await i(d,A,a),v=g.action;if(v===0||v===2)continue;if(v===6){if(a[d]=g.by,g.skipSiblings)return;continue}if(v===7){if(delete a[d],g.skipSiblings)return;continue}if(v===1)return;if(v===3){if(p===null)throw Error("Cannot replace root object");if(h[p]=g.by,g.reexplore)return!0;return}if(v===4){if(p===null)throw Error("Cannot delete root object");delete h[p];return}if(v===5)delete a[d],Object.assign(a,g.by)}};await i(null,e,null)},Eo=Object.create,{getPrototypeOf:Mo,defineProperty:Fr,getOwnPropertyNames:So}=Object,jo=Object.prototype.hasOwnProperty,ko=(e,r,t)=>{t=e!=null?Eo(Mo(e)):{};let n=r||!e||!e.__esModule?Fr(t,"default",{value:e,enumerable:!0}):t;for(let o of So(e))if(!jo.call(n,o))Fr(n,o,{get:()=>e[o],enumerable:!0});return n},Do=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Fo=Do((e,r)=>{var{defineProperty:t,getOwnPropertyNames:n,getOwnPropertyDescriptor:o}=Object,i=Object.prototype.hasOwnProperty,l=new WeakMap,a=(u)=>{var d=l.get(u),A;if(d)return d;if(d=t({},"__esModule",{value:!0}),u&&typeof u==="object"||typeof u==="function")n(u).map((g)=>!i.call(d,g)&&t(d,g,{get:()=>u[g],enumerable:!(A=o(u,g))||A.enumerable}));return l.set(u,d),d},p=(u,d)=>{for(var A in d)t(u,A,{get:d[A],enumerable:!0,configurable:!0,set:(g)=>d[A]=()=>g})},h={};p(h,{splitWithQuotes:()=>y,splitNested:()=>O}),r.exports=a(h);var O=(u,d,A="(",g=")")=>{let v=0,f="",j=[];for(let b of u){if(f+=b,b===A)v++;if(b===g)v--;if(v===0&&b===d)j.push(f.slice(0,-1)),f=""}if(f)j.push(f);return j},y=(u,d=",")=>{let A=[],g=u.length,v=d.length,f=0,j=(b)=>{if(b+v>g)return!1;for(let S=0;S<v;S++)if(u[b+S]!==d[S])return!1;return!0};while(f<g){while(f<g&&u[f]===" ")f++;if(f>=g)break;let b="",S=u[f]==='"'||u[f]==="'";if(S){let k=u[f++];while(f<g&&u[f]!==k)b+=u[f++];if(f<g)f++}else{while(f<g&&!j(f)){let k=u[f];if(k==='"'||k==="'"){b+=k,f++;while(f<g&&u[f]!==k)b+=u[f++];if(f<g)b+=u[f++]}else b+=u[f++]}b=b.trim()}if(b)A.push({value:b,quoted:S});if(j(f))f+=v}return A}}),Ro=ko(Fo(),1),xo=/^\[([^=\]]*)([=]*)([^\]]*)\]$/,$o=/^([^[\]]*)\[([^\]]*)]$/,He=(e,r,t,n)=>{if(e.startsWith("{")&&e.endsWith("}")){let o=e.substring(1,e.length-1);return le(r,o,t)?.toString()}return n?e:void 0},Co=(e,r,t,n)=>{let o=He(r,t,n);if(o)return le(e,o,n);let i=xo.exec(r);if(i){let[,a,p,h]=i,O=He(a.trim(),t,n,!0),y=He(h.trim(),t,n,!0);if(Array.isArray(e)&&(p==="="||p==="==")&&O)return e.find((u)=>u?.[O]==y)}let l=$o.exec(r);if(l){let[,a,p]=l;return e?.[a]?.[p]}return e?.[r]},le=(e,r,t)=>{let n=void 0,o=void 0,i=r??"",l=(y)=>{if(!y)return[y,!1];return y.endsWith("?")?[y.substring(0,y.length-1),!0]:[y,!1]},a=(y,u)=>{let[d,A]=l(u.pop());if(!d){if(t?.set!==void 0&&o!==void 0&&n!==void 0)n[o]=t.set;return y}let g=Co(y,d,e,t);if(g===void 0){if(A||t?.optional||t?.defaultValue!==void 0)return;throw Error(`Unknown path element: "${d}" in "${i}"`)}return n=y,o=d,a(g,u)},p=Ro.splitNested(i,t?.separator??".","{","}"),h=void 0;if(p.length>0&&p[p.length-1].startsWith("?="))h=p.pop()?.substring(2);p.reverse();let O=a(e,p);if(O===void 0)return h??t?.defaultValue;return O},Rr=(e,r)=>{if(typeof e.value==="string"){if(e.quoted)return e.value;if(e.value.startsWith("[")&&e.value.endsWith("]")){let t=e.value.slice(1,-1);if(t.trim()==="")return[];return t.split(";").map((n)=>{let o=n.trim();if(!isNaN(+o))return+o;return o})}if(e.value.startsWith("{")&&e.value.endsWith("}")){if(e.value.slice(1,-1).trim()==="")return{}}if(e.value==="null")return null;if(e.value==="undefined")return;if(e.value.startsWith("@"))return e.value.slice(1);if(!isNaN(+e.value))return+e.value}return r(e.value)},De=(e,r,t,n,o,i)=>{let l=n?.(e)??e,a=o(l);if(a[0])return a[1];if(!r){let p=le(t,e),h=o(p);if(h[0])return h[1]}throw Error(i)},$r=(e,r,t,n,o)=>{let i=typeof e.types==="function"?e.types(n,r.value,o):e.types?.[n];if(!i||i==="ref")return Rr(r,(a)=>le(t,a));let l=Rr(r,()=>r.value);if(Array.isArray(i)){if(!i.includes(l))throw Error(`Argument ${n.toString()} must be one of [${i.join(", ")}]: ${l}`);return l}if(typeof i==="string"){if(i.endsWith("?")){let a=i.slice(0,-1);if(r.value==="null")return x.ReplaceItem(null);if(r.value==="undefined")return x.ReplaceItem(void 0);if(r.value==="")return"";i=a}switch(i){case"any":return l;case"array":return De(l,r.quoted,t,null,(a)=>[Array.isArray(a),a],`Argument ${n.toString()} must be an array: ${l}`);case"object":return De(l,r.quoted,t,null,(a)=>[typeof a==="object"&&a!==null,a],`Argument ${n.toString()} must be an object: ${l}`);case"number":return De(l,r.quoted,t,(a)=>Number(a),(a)=>[!isNaN(a),a],`Argument ${n.toString()} must be a number: ${l}`);case"boolean":return De(l,r.quoted,t,null,(a)=>{if([!0,"true","1",1,"yes","on"].includes(a))return[!0,!0];if([!1,"false","0",0,"no","off"].includes(a))return[!0,!1];if([null,"null","undefined",void 0,""].includes(a))return[!0,!1];if(Array.isArray(a))return[!0,a.length>0];return[!1,!1]},`Argument ${n.toString()} must be a boolean: ${l}`);case"string":return l.toString();default:throw Error(`Unknown type for argument ${n.toString()}: ${i}`)}}return i(l,t,n,r.quoted)},ue=(e,r)=>{let t=e?.[r];if(t===void 0)throw Error(`Unhandled field processor type: ${r}`);return typeof t==="function"?{options:{},fn:t}:{options:t,fn:t.fn}},Cr=(e)=>!e.quoted&&e.value.startsWith("."),Wo=(e)=>{let r={};for(let t of e){if(!Cr(t))continue;let n=t.value.indexOf("="),o=n>-1?t.value.slice(1,n):t.value.slice(1),i=n>-1?t.value.slice(n+1):"";if(i.length>=2){let l=i[0],a=i[i.length-1];if(l==='"'&&a==='"'||l==="'"&&a==="'")i=i.slice(1,-1)}if(!r[o])r[o]=[];r[o].push(i)}return r},Fe=(e,r,t)=>{let n=vo.splitWithQuotes(e??""),o=Wo(n),i=n.filter((a)=>!Cr(a)),l=r.options.processArgs===!1?[]:i.map((a,p)=>$r(r.options,a,t,p,i));return{rawArgs:i,parsedArgs:l,tags:o}},No=(e)=>{return e!==null&&typeof e==="object"&&"action"in e},Io=(e,r)=>r.keys!==void 0&&e.key.startsWith(".")&&r.keys[e.key.substring(1)]!==void 0,Lo=async(e,r,t,n)=>{let{key:o,parent:i}=e,l=ue(n.keys,o.substring(1));if(l.options.processArgs!==!1&&(typeof l.options.types==="function"||l.options.types?.[0]!==void 0))e.value=$r(l.options,{value:e.value,quoted:!1},t,0,[]);if(typeof e.value!=="string")await C(e.value,{...n,root:{...t,parent:e.parent,parents:e.parents},filters:[...n.filters??[],...l.options.filters??[]]});let a=await l.fn({path:r,root:t,parent:i,key:o,options:n,value:e.value,args:[],rawArgs:[],tags:{}});return No(a)?a:x.ReplaceParent(a)},xr=(e)=>{let r=e.split(/\r?\n/),t=r.filter((o)=>o.trim().length>0).map((o)=>/^[ \t]*/.exec(o)?.[0].length??0),n=t.length>0?Math.min(...t):0;if(n===0)return e;return r.map((o)=>o.slice(n)).join(`
2
2
  `)},_o=async(e,r,t,n)=>{if(!r?.onSection&&!r?.onSectionConfig&&!r?.sections)return[e,!1];let o=/<@\s*section(?:\s*:\s*([\w-]+))?\s*@>([\s\S]*?)<@\s*\/\s*section\s*@>/g,i,l=e,a=0,p=!1,h={content:l,root:n,path:t,options:r,section:{}};while((i=o.exec(e))!==null){p=!0;let[O,y,u]=i,d=i.index,A=d+O.length,g=e[A]===`
3
3
  `;if(g)A++;let v=d+a,f=A+a,j={},b=u,S=/(^|\r?\n)[ \t]*---[ \t]*(\r?\n|$)/m.exec(u);if(S){let oe=u.slice(0,S.index),Ye=S.index+S[0].length;b=u.slice(Ye);let je=xr(oe).trim();if(je.length>0)try{j=r?.configParser?.(je)??{}}catch(Ge){throw Error(`Failed to parse YAML config for section: ${Ge.message}`)}}else if(/^\r?\n/.test(b))b=b.replace(/^\r?\n/,"");b=xr(b),b=b.replace(/(?:\r?\n[ \t]*)+$/,""),b=b.replace(/[ \t]+$/,"");let k={config:y?{...j,type:y}:j,content:b};if(h.content=l,h.section=k,Object.keys(k.config).length>0){if(await r.onSectionConfig?.(h)!==!1)await C(k.config,{...r,root:n})}let Ae=h.section.config.type?r.sections?.[h.section.config.type]:void 0,G;if(Ae)G=await Ae(h);else if(r.onSection)G=await r.onSection(h);if(k.trim)k.content=k.content.trim();if(k.indent)k.content=k.content.split(`
4
4
  `).map((oe)=>" ".repeat(k.indent)+oe).join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homedev/objector",
3
- "version": "1.2.61",
3
+ "version": "1.2.62",
4
4
  "description": "object extensions for YAML/JSON",
5
5
  "author": "julzor",
6
6
  "license": "ISC",