@spinajs/configuration 2.0.180 → 2.0.181

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.
@@ -1,79 +1,79 @@
1
- import _ from 'lodash';
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- import { Configuration } from '@spinajs/configuration-common';
4
- import { AddDependencyForProperty, DI } from '@spinajs/di';
5
- /**
6
- * Injects configuration value to given class property
7
- *
8
- * @param path - path to configuration value eg. "app.dirs.stats"
9
- * @param dafaultValue - default value if path not exists
10
- * @returns
11
- */
12
- export function Config(path, options) {
13
- return (target, key) => {
14
- let config = null;
15
- // register conf, so we can expose eg. in db if config is set
16
- DI.register({ path, options }).asValue('__configuration_property__');
17
- const getter = () => {
18
- if (!config) {
19
- config = DI.get(Configuration);
20
- }
21
- // try to return val
22
- return config.get(path, options ? options.defaultValue ?? undefined : undefined);
23
- };
24
- Object.defineProperty(target, key, {
25
- get: getter,
26
- enumerable: false,
27
- configurable: false,
28
- });
29
- };
30
- }
31
- /**
32
- * Inject service based on configuration.
33
- * Configuration could be object or string containing service
34
- *
35
- * If array is provided in configuration, service is resolved by name
36
- * stored in 'service' property and returnes as Map\<serviceName, instance\>
37
- *
38
- * @param path - configuration path where service type is stored
39
- * @param type - if type is provided, it will override type obtain from reflection. Use it specific with arrays and maps, becouse ts reflection module cannot extract array and map type data
40
- */
41
- export function AutoinjectService(path, type) {
42
- return AddDependencyForProperty((descriptor, target, propertyKey) => {
43
- const t = type ?? Reflect.getMetadata('design:type', target, propertyKey);
44
- descriptor.inject.push({
45
- autoinject: true,
46
- autoinjectKey: propertyKey,
47
- inject: t,
48
- data: path,
49
- mapFunc: (x) => {
50
- return x.ServiceName || x.constructor.name;
51
- },
52
- serviceFunc: (path, container) => {
53
- const cfg = container.get(Configuration);
54
- const cfgVal = cfg.get(path);
55
- if (!cfgVal) {
56
- throw new Error(`Configuration value ${path} is empty`);
57
- }
58
- if (_.isString(cfgVal)) {
59
- return {
60
- service: cfgVal,
61
- };
62
- }
63
- if (_.isArray(cfgVal)) {
64
- return cfgVal.map((x) => {
65
- return {
66
- service: x.service,
67
- options: x,
68
- };
69
- });
70
- }
71
- return {
72
- service: cfgVal.service,
73
- options: cfgVal,
74
- };
75
- },
76
- });
77
- });
78
- }
1
+ import _ from 'lodash';
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ import { Configuration } from '@spinajs/configuration-common';
4
+ import { AddDependencyForProperty, DI } from '@spinajs/di';
5
+ /**
6
+ * Injects configuration value to given class property
7
+ *
8
+ * @param path - path to configuration value eg. "app.dirs.stats"
9
+ * @param dafaultValue - default value if path not exists
10
+ * @returns
11
+ */
12
+ export function Config(path, options) {
13
+ return (target, key) => {
14
+ let config = null;
15
+ // register conf, so we can expose eg. in db if config is set
16
+ DI.register({ path, options }).asValue('__configuration_property__');
17
+ const getter = () => {
18
+ if (!config) {
19
+ config = DI.get(Configuration);
20
+ }
21
+ // try to return val
22
+ return config.get(path, options ? options.defaultValue ?? undefined : undefined);
23
+ };
24
+ Object.defineProperty(target, key, {
25
+ get: getter,
26
+ enumerable: false,
27
+ configurable: false,
28
+ });
29
+ };
30
+ }
31
+ /**
32
+ * Inject service based on configuration.
33
+ * Configuration could be object or string containing service
34
+ *
35
+ * If array is provided in configuration, service is resolved by name
36
+ * stored in 'service' property and returnes as Map\<serviceName, instance\>
37
+ *
38
+ * @param path - configuration path where service type is stored
39
+ * @param type - if type is provided, it will override type obtain from reflection. Use it specific with arrays and maps, becouse ts reflection module cannot extract array and map type data
40
+ */
41
+ export function AutoinjectService(path, type) {
42
+ return AddDependencyForProperty((descriptor, target, propertyKey) => {
43
+ const t = type ?? Reflect.getMetadata('design:type', target, propertyKey);
44
+ descriptor.inject.push({
45
+ autoinject: true,
46
+ autoinjectKey: propertyKey,
47
+ inject: t,
48
+ data: path,
49
+ mapFunc: (x) => {
50
+ return x.ServiceName || x.constructor.name;
51
+ },
52
+ serviceFunc: (path, container) => {
53
+ const cfg = container.get(Configuration);
54
+ const cfgVal = cfg.get(path);
55
+ if (!cfgVal) {
56
+ throw new Error(`Configuration value ${path} is empty`);
57
+ }
58
+ if (_.isString(cfgVal)) {
59
+ return {
60
+ service: cfgVal,
61
+ };
62
+ }
63
+ if (_.isArray(cfgVal)) {
64
+ return cfgVal.map((x) => {
65
+ return {
66
+ service: x.service,
67
+ options: x,
68
+ };
69
+ });
70
+ }
71
+ return {
72
+ service: cfgVal.service,
73
+ options: cfgVal,
74
+ };
75
+ },
76
+ });
77
+ });
78
+ }
79
79
  //# sourceMappingURL=decorators.js.map
@@ -1,6 +1,6 @@
1
- import { ErrorObject } from 'ajv';
2
- export declare class InvalidConfiguration extends Error {
3
- validationExceptions?: ErrorObject[];
4
- constructor(message: string, validationExceptions?: ErrorObject[]);
5
- }
1
+ import { ErrorObject } from 'ajv';
2
+ export declare class InvalidConfiguration extends Error {
3
+ validationExceptions?: ErrorObject[];
4
+ constructor(message: string, validationExceptions?: ErrorObject[]);
5
+ }
6
6
  //# sourceMappingURL=exception.d.ts.map
@@ -1,7 +1,7 @@
1
- export class InvalidConfiguration extends Error {
2
- constructor(message, validationExceptions) {
3
- super(message);
4
- this.validationExceptions = validationExceptions;
5
- }
6
- }
1
+ export class InvalidConfiguration extends Error {
2
+ constructor(message, validationExceptions) {
3
+ super(message);
4
+ this.validationExceptions = validationExceptions;
5
+ }
6
+ }
7
7
  //# sourceMappingURL=exception.js.map
@@ -1,10 +1,10 @@
1
- /**
2
- * Reexport for simplicity, we dont need to import configuration-common
3
- * and remember all this packages :)
4
- */
5
- export * from '@spinajs/configuration-common';
6
- export * from './sources.js';
7
- export * from './decorators.js';
8
- export * from './configuration.js';
9
- export * from './exception.js';
1
+ /**
2
+ * Reexport for simplicity, we dont need to import configuration-common
3
+ * and remember all this packages :)
4
+ */
5
+ export * from '@spinajs/configuration-common';
6
+ export * from './sources.js';
7
+ export * from './decorators.js';
8
+ export * from './configuration.js';
9
+ export * from './exception.js';
10
10
  //# sourceMappingURL=index.d.ts.map
package/lib/mjs/index.js CHANGED
@@ -1,10 +1,10 @@
1
- /**
2
- * Reexport for simplicity, we dont need to import configuration-common
3
- * and remember all this packages :)
4
- */
5
- export * from '@spinajs/configuration-common';
6
- export * from './sources.js';
7
- export * from './decorators.js';
8
- export * from './configuration.js';
9
- export * from './exception.js';
1
+ /**
2
+ * Reexport for simplicity, we dont need to import configuration-common
3
+ * and remember all this packages :)
4
+ */
5
+ export * from '@spinajs/configuration-common';
6
+ export * from './sources.js';
7
+ export * from './decorators.js';
8
+ export * from './configuration.js';
9
+ export * from './exception.js';
10
10
  //# sourceMappingURL=index.js.map
@@ -1,22 +1,22 @@
1
- import { Configuration, ConfigurationSource, IConfigLike } from '@spinajs/configuration-common';
2
- export declare abstract class BaseFileSource extends ConfigurationSource {
3
- protected RunApp?: string;
4
- protected CustomConfigPaths?: string[];
5
- protected appBaseDir?: string;
6
- /**
7
- * Configuration base dir, where to look for app config
8
- */
9
- BaseDir: string;
10
- protected CommonDirs: string[];
11
- protected BasePath: string;
12
- get Order(): number;
13
- constructor(RunApp?: string, CustomConfigPaths?: string[], appBaseDir?: string);
14
- protected load(extension: string, callback: (file: string) => Promise<unknown>): Promise<{}>;
15
- }
16
- export declare class JsFileSource extends BaseFileSource {
17
- Load(config: Configuration): Promise<IConfigLike>;
18
- }
19
- export declare class JsonFileSource extends BaseFileSource {
20
- Load(config: Configuration): Promise<IConfigLike>;
21
- }
1
+ import { Configuration, ConfigurationSource, IConfigLike } from '@spinajs/configuration-common';
2
+ export declare abstract class BaseFileSource extends ConfigurationSource {
3
+ protected RunApp?: string;
4
+ protected CustomConfigPaths?: string[];
5
+ protected appBaseDir?: string;
6
+ /**
7
+ * Configuration base dir, where to look for app config
8
+ */
9
+ BaseDir: string;
10
+ protected CommonDirs: string[];
11
+ protected BasePath: string;
12
+ get Order(): number;
13
+ constructor(RunApp?: string, CustomConfigPaths?: string[], appBaseDir?: string);
14
+ protected load(extension: string, callback: (file: string) => Promise<unknown>): Promise<{}>;
15
+ }
16
+ export declare class JsFileSource extends BaseFileSource {
17
+ Load(config: Configuration): Promise<IConfigLike>;
18
+ }
19
+ export declare class JsonFileSource extends BaseFileSource {
20
+ Load(config: Configuration): Promise<IConfigLike>;
21
+ }
22
22
  //# sourceMappingURL=sources.d.ts.map
@@ -1,126 +1,126 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { Injectable, DI } from '@spinajs/di';
8
- import glob from 'glob';
9
- import { default as _ } from 'lodash';
10
- import { join, normalize, resolve } from 'path';
11
- import { findBasePath, mergeArrays } from './util.js';
12
- import * as fs from 'fs';
13
- import * as path from 'path';
14
- import { InternalLogger } from '@spinajs/internal-logger';
15
- import { ConfigurationSource } from '@spinajs/configuration-common';
16
- export class BaseFileSource extends ConfigurationSource {
17
- get Order() {
18
- return 1;
19
- }
20
- constructor(RunApp, CustomConfigPaths, appBaseDir) {
21
- super();
22
- this.RunApp = RunApp;
23
- this.CustomConfigPaths = CustomConfigPaths;
24
- this.appBaseDir = appBaseDir;
25
- /**
26
- * Configuration base dir, where to look for app config
27
- */
28
- this.BaseDir = './';
29
- this.CommonDirs = [];
30
- this.BasePath = '';
31
- const isESMMode = DI.get('__esmMode__');
32
- this.CommonDirs = [
33
- // for tests, in src dir
34
- normalize(join(resolve(process.cwd()), 'src', '/config')),
35
- // other @spinajs modules paths
36
- normalize(join(resolve(process.cwd()), isESMMode ? 'node_modules/@spinajs/*/lib/mjs/config' : 'node_modules/@spinajs/*/lib/cjs/config')),
37
- // project paths - last to allow overwrite @spinajs conf
38
- normalize(join(resolve(process.cwd()), 'lib/config')),
39
- normalize(join(resolve(process.cwd()), 'dist/config')),
40
- normalize(join(resolve(process.cwd()), 'build/config')),
41
- normalize(join(resolve(process.cwd()), 'config')),
42
- ];
43
- // try to find root folder with node_modules
44
- // on server environment
45
- const bPath = findBasePath(process.cwd());
46
- // if we cannot find node_modules folders and base path
47
- // assume that process working dir is base path
48
- // eg. on electron environment
49
- this.BasePath = bPath === null ? process.cwd() : bPath;
50
- if (this.RunApp) {
51
- this.CommonDirs = this.CommonDirs.concat([join(this.appBaseDir, `/${this.RunApp}/config`)]);
52
- }
53
- if (this.CustomConfigPaths) {
54
- this.CommonDirs = this.CommonDirs.concat(this.CustomConfigPaths);
55
- }
56
- }
57
- async load(extension, callback) {
58
- const config = {};
59
- const toResolve = this.CommonDirs.map((f) => (path.isAbsolute(f) ? f : join(this.BasePath, f)))
60
- // get all config files
61
- .map((d) => {
62
- return glob.sync(path.join(d, `/**/${extension}`).replace(/\\/g, '/'));
63
- })
64
- // flatten files
65
- .reduce((prev, current) => {
66
- return prev.concat(_.flattenDeep(current));
67
- }, [])
68
- // normalize & resolve paths to be sure
69
- .map((f) => normalize(resolve(f)))
70
- .filter((f, index, self) => self.indexOf(f) === index)
71
- .map(callback);
72
- const result = await Promise.all(toResolve);
73
- result
74
- .filter((v) => v !== undefined && v !== null)
75
- // load & merge configs
76
- .map((c) => _.mergeWith(config, c.default ?? c, mergeArrays));
77
- return config;
78
- }
79
- }
80
- let JsFileSource = class JsFileSource extends BaseFileSource {
81
- async Load(config) {
82
- const common = await this.load('!(*.dev|*.prod).{cjs,js}', _load);
83
- const env = config.get('process.env.APP_ENV', 'production');
84
- const fExt = env === 'development' ? '*.dev.{cjs,js}' : '*.prod.{cjs,js}';
85
- const cfg = await this.load(fExt, _load);
86
- return _.mergeWith(common, cfg, mergeArrays);
87
- async function _load(file) {
88
- try {
89
- InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
90
- return await DI.__spinajs_require__(file);
91
- }
92
- catch (err) {
93
- InternalLogger.error(err, `error loading configuration file ${file}`, 'configuration');
94
- return null;
95
- }
96
- }
97
- }
98
- };
99
- JsFileSource = __decorate([
100
- Injectable(ConfigurationSource)
101
- ], JsFileSource);
102
- export { JsFileSource };
103
- let JsonFileSource = class JsonFileSource extends BaseFileSource {
104
- async Load(config) {
105
- const common = await this.load('!(*.dev|*.prod).json', _load);
106
- const env = config.get('process.env.APP_ENV', 'production');
107
- const fExt = env === 'development' ? '*.dev.json' : '*.prod.json';
108
- const cfg = await this.load(fExt, _load);
109
- return _.mergeWith(common, cfg, mergeArrays);
110
- function _load(file) {
111
- try {
112
- InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
113
- return Promise.resolve(JSON.parse(fs.readFileSync(file, 'utf-8')));
114
- }
115
- catch (err) {
116
- console.error(`error loading configuration file ${file}, reasoun: ${err.message}`);
117
- return null;
118
- }
119
- }
120
- }
121
- };
122
- JsonFileSource = __decorate([
123
- Injectable(ConfigurationSource)
124
- ], JsonFileSource);
125
- export { JsonFileSource };
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { Injectable, DI } from '@spinajs/di';
8
+ import glob from 'glob';
9
+ import { default as _ } from 'lodash';
10
+ import { join, normalize, resolve } from 'path';
11
+ import { findBasePath, mergeArrays } from './util.js';
12
+ import * as fs from 'fs';
13
+ import * as path from 'path';
14
+ import { InternalLogger } from '@spinajs/internal-logger';
15
+ import { ConfigurationSource } from '@spinajs/configuration-common';
16
+ export class BaseFileSource extends ConfigurationSource {
17
+ get Order() {
18
+ return 1;
19
+ }
20
+ constructor(RunApp, CustomConfigPaths, appBaseDir) {
21
+ super();
22
+ this.RunApp = RunApp;
23
+ this.CustomConfigPaths = CustomConfigPaths;
24
+ this.appBaseDir = appBaseDir;
25
+ /**
26
+ * Configuration base dir, where to look for app config
27
+ */
28
+ this.BaseDir = './';
29
+ this.CommonDirs = [];
30
+ this.BasePath = '';
31
+ const isESMMode = DI.get('__esmMode__');
32
+ this.CommonDirs = [
33
+ // for tests, in src dir
34
+ normalize(join(resolve(process.cwd()), 'src', '/config')),
35
+ // other @spinajs modules paths
36
+ normalize(join(resolve(process.cwd()), isESMMode ? 'node_modules/@spinajs/*/lib/mjs/config' : 'node_modules/@spinajs/*/lib/cjs/config')),
37
+ // project paths - last to allow overwrite @spinajs conf
38
+ normalize(join(resolve(process.cwd()), 'lib/config')),
39
+ normalize(join(resolve(process.cwd()), 'dist/config')),
40
+ normalize(join(resolve(process.cwd()), 'build/config')),
41
+ normalize(join(resolve(process.cwd()), 'config')),
42
+ ];
43
+ // try to find root folder with node_modules
44
+ // on server environment
45
+ const bPath = findBasePath(process.cwd());
46
+ // if we cannot find node_modules folders and base path
47
+ // assume that process working dir is base path
48
+ // eg. on electron environment
49
+ this.BasePath = bPath === null ? process.cwd() : bPath;
50
+ if (this.RunApp) {
51
+ this.CommonDirs = this.CommonDirs.concat([join(this.appBaseDir, `/${this.RunApp}/config`)]);
52
+ }
53
+ if (this.CustomConfigPaths) {
54
+ this.CommonDirs = this.CommonDirs.concat(this.CustomConfigPaths);
55
+ }
56
+ }
57
+ async load(extension, callback) {
58
+ const config = {};
59
+ const toResolve = this.CommonDirs.map((f) => (path.isAbsolute(f) ? f : join(this.BasePath, f)))
60
+ // get all config files
61
+ .map((d) => {
62
+ return glob.sync(path.join(d, `/**/${extension}`).replace(/\\/g, '/'));
63
+ })
64
+ // flatten files
65
+ .reduce((prev, current) => {
66
+ return prev.concat(_.flattenDeep(current));
67
+ }, [])
68
+ // normalize & resolve paths to be sure
69
+ .map((f) => normalize(resolve(f)))
70
+ .filter((f, index, self) => self.indexOf(f) === index)
71
+ .map(callback);
72
+ const result = await Promise.all(toResolve);
73
+ result
74
+ .filter((v) => v !== undefined && v !== null)
75
+ // load & merge configs
76
+ .map((c) => _.mergeWith(config, c.default ?? c, mergeArrays));
77
+ return config;
78
+ }
79
+ }
80
+ let JsFileSource = class JsFileSource extends BaseFileSource {
81
+ async Load(config) {
82
+ const common = await this.load('!(*.dev|*.prod).{cjs,js}', _load);
83
+ const env = config.get('process.env.APP_ENV', 'production');
84
+ const fExt = env === 'development' ? '*.dev.{cjs,js}' : '*.prod.{cjs,js}';
85
+ const cfg = await this.load(fExt, _load);
86
+ return _.mergeWith(common, cfg, mergeArrays);
87
+ async function _load(file) {
88
+ try {
89
+ InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
90
+ return await DI.__spinajs_require__(file);
91
+ }
92
+ catch (err) {
93
+ InternalLogger.error(err, `error loading configuration file ${file}`, 'configuration');
94
+ return null;
95
+ }
96
+ }
97
+ }
98
+ };
99
+ JsFileSource = __decorate([
100
+ Injectable(ConfigurationSource)
101
+ ], JsFileSource);
102
+ export { JsFileSource };
103
+ let JsonFileSource = class JsonFileSource extends BaseFileSource {
104
+ async Load(config) {
105
+ const common = await this.load('!(*.dev|*.prod).json', _load);
106
+ const env = config.get('process.env.APP_ENV', 'production');
107
+ const fExt = env === 'development' ? '*.dev.json' : '*.prod.json';
108
+ const cfg = await this.load(fExt, _load);
109
+ return _.mergeWith(common, cfg, mergeArrays);
110
+ function _load(file) {
111
+ try {
112
+ InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
113
+ return Promise.resolve(JSON.parse(fs.readFileSync(file, 'utf-8')));
114
+ }
115
+ catch (err) {
116
+ console.error(`error loading configuration file ${file}, reasoun: ${err.message}`);
117
+ return null;
118
+ }
119
+ }
120
+ }
121
+ };
122
+ JsonFileSource = __decorate([
123
+ Injectable(ConfigurationSource)
124
+ ], JsonFileSource);
125
+ export { JsonFileSource };
126
126
  //# sourceMappingURL=sources.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sources.js","sourceRoot":"","sources":["../../src/sources.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAiB,mBAAmB,EAAe,MAAM,+BAA+B,CAAC;AAMhG,MAAM,OAAgB,cAAe,SAAQ,mBAAmB;IAU9D,IAAW,KAAK;QACd,OAAO,CAAC,CAAC;IACX,CAAC;IAED,YAAsB,MAAe,EAAY,iBAA4B,EAAY,UAAmB;QAC1G,KAAK,EAAE,CAAC;QADY,WAAM,GAAN,MAAM,CAAS;QAAY,sBAAiB,GAAjB,iBAAiB,CAAW;QAAY,eAAU,GAAV,UAAU,CAAS;QAb5G;;WAEG;QACI,YAAO,GAAG,IAAI,CAAC;QAEZ,eAAU,GAAa,EAAE,CAAC;QAE1B,aAAQ,GAAG,EAAE,CAAC;QAStB,MAAM,SAAS,GAAG,EAAE,CAAC,GAAG,CAAU,aAAa,CAAC,CAAC;QAEjD,IAAI,CAAC,UAAU,GAAG;YAChB,wBAAwB;YACxB,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,SAAS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cAAc,CAAC,KAAK,CAAC,uBAAuB,IAAI,EAAE,EAAE,eAAe,CAAC,CAAC;gBAErE,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAY,CAAC,CAAC;aAC/E;YAAC,OAAO,GAAG,EAAE;gBACZ,OAAO,CAAC,KAAK,CAAC,oCAAoC,IAAI,cAAe,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;gBAC9F,OAAO,IAAI,CAAC;aACb;QACH,CAAC;IACH,CAAC;CACF,CAAA;AAnBY,cAAc;IAD1B,UAAU,CAAC,mBAAmB,CAAC;GACnB,cAAc,CAmB1B"}
package/lib/mjs/util.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export declare function parseArgv(param: string): string;
2
- export declare function findBasePath(path: string): string;
3
- export declare function merge(to: unknown, from: unknown): unknown;
4
- export declare function mergeArrays(target: unknown[], source: unknown[]): unknown;
5
- export declare function uncache(file: string): string;
6
- export declare function filterDirs(dir: string): boolean;
1
+ export declare function parseArgv(param: string): string;
2
+ export declare function findBasePath(path: string): string;
3
+ export declare function merge(to: unknown, from: unknown): unknown;
4
+ export declare function mergeArrays(target: unknown[], source: unknown[]): unknown;
5
+ export declare function uncache(file: string): string;
6
+ export declare function filterDirs(dir: string): boolean;
7
7
  //# sourceMappingURL=util.d.ts.map