@yamato-daiwa/es-extensions-nodejs 0.0.2 → 0.10.0-alpha.0
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/Distributable/ConsoleApplicationLogger.d.ts +68 -0
- package/Distributable/ConsoleApplicationLogger.js +435 -0
- package/Distributable/ConsoleCommandsParser/ConsoleCommandsParser.d.ts +289 -0
- package/Distributable/ConsoleCommandsParser/ConsoleCommandsParser.js +702 -0
- package/Distributable/ConsoleCommandsParser/ConsoleCommandsParserLocalization.english.d.ts +4 -0
- package/Distributable/ConsoleCommandsParser/ConsoleCommandsParserLocalization.english.js +118 -0
- package/Distributable/DateTime/NodeJS_Timer.d.ts +21 -7
- package/Distributable/DateTime/NodeJS_Timer.js +61 -13
- package/Distributable/DotEnvFilesGenerator.d.ts +13 -0
- package/Distributable/DotEnvFilesGenerator.js +21 -0
- package/Distributable/Errors/FileNotFoundError/FileNotFoundError.d.ts +25 -0
- package/Distributable/Errors/FileNotFoundError/FileNotFoundError.js +21 -0
- package/Distributable/Errors/FileNotFoundError/FileNotFoundErrorLocalization.english.d.ts +3 -0
- package/Distributable/Errors/FileNotFoundError/FileNotFoundErrorLocalization.english.js +7 -0
- package/Distributable/Errors/InvalidConsoleCommand/InvalidConsoleCommandError.d.ts +25 -0
- package/Distributable/Errors/InvalidConsoleCommand/InvalidConsoleCommandError.js +21 -0
- package/Distributable/Errors/InvalidConsoleCommand/InvalidConsoleCommandErrorLocalization.english.d.ts +3 -0
- package/Distributable/Errors/InvalidConsoleCommand/InvalidConsoleCommandErrorLocalization.english.js +7 -0
- package/Distributable/Errors/PathRefersToDirectoryNotFileError/PathRefersToDirectoryNotFileError.d.ts +25 -0
- package/Distributable/Errors/PathRefersToDirectoryNotFileError/PathRefersToDirectoryNotFileError.js +21 -0
- package/Distributable/Errors/PathRefersToDirectoryNotFileError/PathRefersToDirectoryNotFileErrorLocalization.english.d.ts +3 -0
- package/Distributable/Errors/PathRefersToDirectoryNotFileError/PathRefersToDirectoryNotFileErrorLocalization.english.js +7 -0
- package/Distributable/ImprovedFileSystem.d.ts +43 -0
- package/Distributable/ImprovedFileSystem.js +142 -0
- package/Distributable/ImprovedGlob.d.ts +57 -0
- package/Distributable/ImprovedGlob.js +275 -0
- package/Distributable/ImprovedPath/ImprovedPath.d.ts +59 -0
- package/Distributable/ImprovedPath/ImprovedPath.js +224 -0
- package/Distributable/ObjectDataFilesProcessor/ObjectDataFilesProcessor.d.ts +55 -0
- package/Distributable/ObjectDataFilesProcessor/ObjectDataFilesProcessor.js +228 -0
- package/Distributable/ObjectDataFilesProcessor/ObjectDataFilesProcessorLocalization.english.d.ts +4 -0
- package/Distributable/ObjectDataFilesProcessor/ObjectDataFilesProcessorLocalization.english.js +11 -0
- package/Distributable/Temporary/appendCharacterIfItDoesNotPresentInLastPosition.d.ts +4 -0
- package/Distributable/Temporary/appendCharacterIfItDoesNotPresentInLastPosition.js +7 -0
- package/Distributable/Temporary/extractLastExtensionOfFileName.d.ts +9 -0
- package/Distributable/Temporary/extractLastExtensionOfFileName.js +21 -0
- package/Distributable/index.d.ts +22 -7
- package/Distributable/index.js +45 -7
- package/Distributable/isErrnoException.d.ts +2 -0
- package/Distributable/isErrnoException.js +12 -0
- package/LICENSE +1 -1
- package/README.md +51 -3
- package/package.json +45 -15
- package/tsconfig.test.json +0 -4
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export default class ImprovedGlob {
|
|
2
|
+
static getFilesAbsolutePathsSynchronously(globSelectors: ReadonlyArray<string>, options?: Readonly<{
|
|
3
|
+
alwaysForwardSlashSeparators?: boolean;
|
|
4
|
+
}>): Array<string>;
|
|
5
|
+
static isFilePathMatchingWithGlobSelector(compoundParameter: Readonly<{
|
|
6
|
+
filePath: string;
|
|
7
|
+
globSelector: string;
|
|
8
|
+
}>): boolean;
|
|
9
|
+
static isFilePathMatchingWithAllGlobSelectors(compoundParameter: Readonly<{
|
|
10
|
+
filePath: string;
|
|
11
|
+
globSelectors: ReadonlyArray<string> | string;
|
|
12
|
+
}>): boolean;
|
|
13
|
+
static isFilePathMatchingWithAtLeastOneGlobSelector({ filePath, globSelectors }: Readonly<{
|
|
14
|
+
filePath: string;
|
|
15
|
+
globSelectors: ReadonlyArray<string> | ReadonlySet<string>;
|
|
16
|
+
}>): boolean;
|
|
17
|
+
static isExcludingGlobSelector(globSelector: string): boolean;
|
|
18
|
+
static buildAllFilesInCurrentDirectoryButNotBelowGlobSelector(compoundParameter: {
|
|
19
|
+
basicDirectoryPath: string;
|
|
20
|
+
fileNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
21
|
+
}): string;
|
|
22
|
+
static buildAllFilesInCurrentDirectoryAndBelowGlobSelector(polymorphicParameter: string | Readonly<{
|
|
23
|
+
basicDirectoryPath: string;
|
|
24
|
+
fileNamesPostfixes?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
25
|
+
fileNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
26
|
+
penultimateFileNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
27
|
+
}>): string;
|
|
28
|
+
static buildExcludingOfDirectoryWithSubdirectoriesGlobSelector(polymorphicParameter: string | Readonly<{
|
|
29
|
+
targetDirectoryPath: string;
|
|
30
|
+
fileNamesPostfixes?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
31
|
+
fileNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
32
|
+
penultimateFileNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
33
|
+
}>): string;
|
|
34
|
+
static buildExcludingOfFilesWithSpecificPrefixesGlobSelector(compoundParameter: Readonly<{
|
|
35
|
+
basicDirectoryPath: string;
|
|
36
|
+
filesNamesPrefixes: ReadonlyArray<string> | ReadonlySet<string>;
|
|
37
|
+
filesNamesExtensions: ReadonlyArray<string> | ReadonlySet<string>;
|
|
38
|
+
}>): string;
|
|
39
|
+
static buildExcludingOfFilesInSubdirectoriesWithSpecificPrefixesGlobSelector(compoundParameter: Readonly<{
|
|
40
|
+
basicDirectoryPath: string;
|
|
41
|
+
subdirectoriesPrefixes: ReadonlyArray<string> | ReadonlySet<string>;
|
|
42
|
+
filesNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
43
|
+
}>): string;
|
|
44
|
+
static buildExcludingOfFilesInSpecificSubdirectoriesGlobSelector(compoundParameter: Readonly<{
|
|
45
|
+
basicDirectoryPath: string;
|
|
46
|
+
subdirectoriesNames: ReadonlyArray<string> | ReadonlySet<string>;
|
|
47
|
+
filesNamesExtensions?: ReadonlyArray<string> | ReadonlySet<string>;
|
|
48
|
+
}>): string;
|
|
49
|
+
static createMultipleFilenameExtensionsGlobPostfix(fileNamesExtensions: ReadonlyArray<string> | ReadonlySet<string>): string;
|
|
50
|
+
static buildAbsolutePathBasedGlob(compoundParameter: Readonly<{
|
|
51
|
+
basicDirectoryPath: string;
|
|
52
|
+
relativePathBasedGlob: string;
|
|
53
|
+
isExclusive?: boolean;
|
|
54
|
+
}>): string;
|
|
55
|
+
static includingGlobSelectorToExcludingOne(targetIncludingGlobSelector: string): string;
|
|
56
|
+
static includingGlobSelectorsToExcludingOnes(targetIncludingGlobSelectors: ReadonlyArray<string>): Array<string>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const glob_1 = require("glob");
|
|
7
|
+
const minimatch_1 = require("minimatch");
|
|
8
|
+
const es_extensions_1 = require("@yamato-daiwa/es-extensions");
|
|
9
|
+
const appendCharacterIfItDoesNotPresentInLastPosition_1 = __importDefault(require("./Temporary/appendCharacterIfItDoesNotPresentInLastPosition"));
|
|
10
|
+
class ImprovedGlob {
|
|
11
|
+
static getFilesAbsolutePathsSynchronously(globSelectors, options = {}) {
|
|
12
|
+
const inclusiveGlobSelectors = [];
|
|
13
|
+
const exclusiveGlobSelectors = [];
|
|
14
|
+
for (const globSelector of globSelectors) {
|
|
15
|
+
(ImprovedGlob.isExcludingGlobSelector(globSelector) ? exclusiveGlobSelectors : inclusiveGlobSelectors).
|
|
16
|
+
push((0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(globSelector));
|
|
17
|
+
}
|
|
18
|
+
const matchingFilesAbsolutePaths = [];
|
|
19
|
+
for (const inclusiveGlobSelector of inclusiveGlobSelectors) {
|
|
20
|
+
matchingFilesAbsolutePaths.push(...glob_1.glob.sync(inclusiveGlobSelector, {
|
|
21
|
+
ignore: exclusiveGlobSelectors.map((globSelector) => (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
|
|
22
|
+
targetString: globSelector,
|
|
23
|
+
fromFirstPosition: true,
|
|
24
|
+
targetCharacter: "!"
|
|
25
|
+
})),
|
|
26
|
+
nodir: true,
|
|
27
|
+
dot: true
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
if (options.alwaysForwardSlashSeparators !== true) {
|
|
31
|
+
return matchingFilesAbsolutePaths;
|
|
32
|
+
}
|
|
33
|
+
return matchingFilesAbsolutePaths.map((fileAbsolutePath) => (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(fileAbsolutePath));
|
|
34
|
+
}
|
|
35
|
+
static isFilePathMatchingWithGlobSelector(compoundParameter) {
|
|
36
|
+
return (0, minimatch_1.minimatch)(compoundParameter.filePath, compoundParameter.globSelector);
|
|
37
|
+
}
|
|
38
|
+
static isFilePathMatchingWithAllGlobSelectors(compoundParameter) {
|
|
39
|
+
return (Array.isArray(compoundParameter.globSelectors) ?
|
|
40
|
+
compoundParameter.globSelectors : [compoundParameter.globSelectors]).
|
|
41
|
+
every((globSelector) => (0, minimatch_1.minimatch)(compoundParameter.filePath, globSelector));
|
|
42
|
+
}
|
|
43
|
+
static isFilePathMatchingWithAtLeastOneGlobSelector({ filePath, globSelectors }) {
|
|
44
|
+
return (Array.isArray(globSelectors) ? globSelectors : [...globSelectors]).
|
|
45
|
+
some((globSelector) => (0, minimatch_1.minimatch)(filePath, globSelector));
|
|
46
|
+
}
|
|
47
|
+
static isExcludingGlobSelector(globSelector) {
|
|
48
|
+
return globSelector.startsWith("!");
|
|
49
|
+
}
|
|
50
|
+
static buildAllFilesInCurrentDirectoryButNotBelowGlobSelector(compoundParameter) {
|
|
51
|
+
let fileNamesExtensions;
|
|
52
|
+
if ((0, es_extensions_1.isUndefined)(compoundParameter.fileNamesExtensions)) {
|
|
53
|
+
fileNamesExtensions = new Set();
|
|
54
|
+
}
|
|
55
|
+
else if (compoundParameter.fileNamesExtensions instanceof Set) {
|
|
56
|
+
fileNamesExtensions = compoundParameter.fileNamesExtensions;
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
fileNamesExtensions = new Set(compoundParameter.fileNamesExtensions);
|
|
60
|
+
}
|
|
61
|
+
return [
|
|
62
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
63
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.basicDirectoryPath),
|
|
64
|
+
trailingCharacter: "/"
|
|
65
|
+
}),
|
|
66
|
+
"*",
|
|
67
|
+
...fileNamesExtensions.size > 0 ?
|
|
68
|
+
[ImprovedGlob.createMultipleFilenameExtensionsGlobPostfix(fileNamesExtensions)] : []
|
|
69
|
+
].join("");
|
|
70
|
+
}
|
|
71
|
+
static buildAllFilesInCurrentDirectoryAndBelowGlobSelector(polymorphicParameter) {
|
|
72
|
+
let basicDirectoryPath;
|
|
73
|
+
let fileNamesPostfixes = new Set();
|
|
74
|
+
let fileNamesExtensions = new Set();
|
|
75
|
+
let penultimateFileNamesExtensions = new Set();
|
|
76
|
+
if ((0, es_extensions_1.isString)(polymorphicParameter)) {
|
|
77
|
+
basicDirectoryPath = polymorphicParameter;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
basicDirectoryPath = polymorphicParameter.basicDirectoryPath;
|
|
81
|
+
if (polymorphicParameter.fileNamesPostfixes instanceof Set) {
|
|
82
|
+
fileNamesPostfixes = polymorphicParameter.fileNamesPostfixes;
|
|
83
|
+
}
|
|
84
|
+
else if (Array.isArray(polymorphicParameter.fileNamesPostfixes)) {
|
|
85
|
+
fileNamesPostfixes = new Set(polymorphicParameter.fileNamesPostfixes);
|
|
86
|
+
}
|
|
87
|
+
if (polymorphicParameter.fileNamesExtensions instanceof Set) {
|
|
88
|
+
fileNamesExtensions = polymorphicParameter.fileNamesExtensions;
|
|
89
|
+
}
|
|
90
|
+
else if (Array.isArray(polymorphicParameter.fileNamesExtensions)) {
|
|
91
|
+
fileNamesExtensions = new Set(polymorphicParameter.fileNamesExtensions);
|
|
92
|
+
}
|
|
93
|
+
if (polymorphicParameter.penultimateFileNamesExtensions instanceof Set) {
|
|
94
|
+
penultimateFileNamesExtensions = polymorphicParameter.penultimateFileNamesExtensions;
|
|
95
|
+
}
|
|
96
|
+
else if (Array.isArray(polymorphicParameter.penultimateFileNamesExtensions)) {
|
|
97
|
+
penultimateFileNamesExtensions = new Set(polymorphicParameter.penultimateFileNamesExtensions);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return [
|
|
101
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
102
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(basicDirectoryPath),
|
|
103
|
+
trailingCharacter: "/"
|
|
104
|
+
}),
|
|
105
|
+
"**/*",
|
|
106
|
+
...fileNamesPostfixes.size > 0 ?
|
|
107
|
+
[
|
|
108
|
+
`@(${Array.from(fileNamesPostfixes).
|
|
109
|
+
join("|").
|
|
110
|
+
replace(/\./gu, "")})`
|
|
111
|
+
] :
|
|
112
|
+
[],
|
|
113
|
+
...penultimateFileNamesExtensions.size > 0 ?
|
|
114
|
+
[
|
|
115
|
+
`.@(${Array.from(penultimateFileNamesExtensions).
|
|
116
|
+
map((penultimateFilenameExtension) => (0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
|
|
117
|
+
targetString: penultimateFilenameExtension,
|
|
118
|
+
targetCharacter: ".",
|
|
119
|
+
fromFirstPosition: true
|
|
120
|
+
})).
|
|
121
|
+
join("|")})`
|
|
122
|
+
] :
|
|
123
|
+
[],
|
|
124
|
+
...fileNamesExtensions.size > 0 ?
|
|
125
|
+
[ImprovedGlob.createMultipleFilenameExtensionsGlobPostfix(fileNamesExtensions)] :
|
|
126
|
+
penultimateFileNamesExtensions.size > 0 ? ["/*"] : []
|
|
127
|
+
].join("");
|
|
128
|
+
}
|
|
129
|
+
static buildExcludingOfDirectoryWithSubdirectoriesGlobSelector(polymorphicParameter) {
|
|
130
|
+
if ((0, es_extensions_1.isString)(polymorphicParameter)) {
|
|
131
|
+
return ImprovedGlob.includingGlobSelectorToExcludingOne(ImprovedGlob.buildAllFilesInCurrentDirectoryAndBelowGlobSelector(polymorphicParameter));
|
|
132
|
+
}
|
|
133
|
+
const { targetDirectoryPath, ...options } = polymorphicParameter;
|
|
134
|
+
return ImprovedGlob.includingGlobSelectorToExcludingOne(ImprovedGlob.buildAllFilesInCurrentDirectoryAndBelowGlobSelector({
|
|
135
|
+
basicDirectoryPath: targetDirectoryPath,
|
|
136
|
+
...options
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
static buildExcludingOfFilesWithSpecificPrefixesGlobSelector(compoundParameter) {
|
|
140
|
+
const filesNamesPrefixes = compoundParameter.filesNamesPrefixes instanceof Set ?
|
|
141
|
+
compoundParameter.filesNamesPrefixes : new Set(compoundParameter.filesNamesPrefixes);
|
|
142
|
+
if (filesNamesPrefixes.size === 0) {
|
|
143
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
144
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({
|
|
145
|
+
parameterName: "compoundParameter.filesNamesPrefixes",
|
|
146
|
+
parameterNumber: 1,
|
|
147
|
+
messageSpecificPart: "At least one file name prefix must be specified."
|
|
148
|
+
}),
|
|
149
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
150
|
+
occurrenceLocation: "ImprovedGlob.buildExcludingOfFilesWithSpecificPrefixesGlobSelector(compoundParameter)"
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
const filesNamesExtensions = compoundParameter.filesNamesExtensions instanceof Set ?
|
|
154
|
+
compoundParameter.filesNamesExtensions : new Set(compoundParameter.filesNamesExtensions);
|
|
155
|
+
if (filesNamesExtensions.size === 0) {
|
|
156
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
157
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({
|
|
158
|
+
parameterName: "compoundParameter.filesNamesExtensions",
|
|
159
|
+
parameterNumber: 1,
|
|
160
|
+
messageSpecificPart: "At least on file name extension must be specified."
|
|
161
|
+
}),
|
|
162
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
163
|
+
occurrenceLocation: "ImprovedGlob.buildExcludingOfFilesWithSpecificPrefixesGlobSelector(compoundParameter)"
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return [
|
|
167
|
+
"!",
|
|
168
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
169
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.basicDirectoryPath),
|
|
170
|
+
trailingCharacter: "/"
|
|
171
|
+
}),
|
|
172
|
+
"**/",
|
|
173
|
+
`@(${Array.from(filesNamesPrefixes).join("|")})*`,
|
|
174
|
+
ImprovedGlob.createMultipleFilenameExtensionsGlobPostfix(compoundParameter.filesNamesExtensions)
|
|
175
|
+
].join("");
|
|
176
|
+
}
|
|
177
|
+
static buildExcludingOfFilesInSubdirectoriesWithSpecificPrefixesGlobSelector(compoundParameter) {
|
|
178
|
+
const subdirectoriesPrefixes = compoundParameter.subdirectoriesPrefixes instanceof Set ?
|
|
179
|
+
compoundParameter.subdirectoriesPrefixes : new Set(compoundParameter.subdirectoriesPrefixes);
|
|
180
|
+
let filesNamesExtensions;
|
|
181
|
+
if ((0, es_extensions_1.isUndefined)(compoundParameter.filesNamesExtensions)) {
|
|
182
|
+
filesNamesExtensions = new Set();
|
|
183
|
+
}
|
|
184
|
+
else if (compoundParameter.filesNamesExtensions instanceof Set) {
|
|
185
|
+
filesNamesExtensions = compoundParameter.filesNamesExtensions;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
filesNamesExtensions = new Set(compoundParameter.filesNamesExtensions);
|
|
189
|
+
}
|
|
190
|
+
if (filesNamesExtensions.size === 0) {
|
|
191
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
192
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({
|
|
193
|
+
parameterName: "compoundParameter.subdirectoriesPrefixes",
|
|
194
|
+
parameterNumber: 1,
|
|
195
|
+
messageSpecificPart: "The property \"subdirectoriesPrefixes\" must be defined with non-empty array."
|
|
196
|
+
}),
|
|
197
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
198
|
+
occurrenceLocation: "ImprovedGlob." +
|
|
199
|
+
"buildExcludingOfFilesInSubdirectoriesWithSpecificPrefixesGlobSelector(compoundParameter)"
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
return [
|
|
203
|
+
"!",
|
|
204
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
205
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.basicDirectoryPath),
|
|
206
|
+
trailingCharacter: "/"
|
|
207
|
+
}),
|
|
208
|
+
"**/",
|
|
209
|
+
`@(${Array.from(subdirectoriesPrefixes).join("|")})*/**/*`,
|
|
210
|
+
...(0, es_extensions_1.isNonEmptyArray)(compoundParameter.filesNamesExtensions) ?
|
|
211
|
+
[ImprovedGlob.createMultipleFilenameExtensionsGlobPostfix(compoundParameter.filesNamesExtensions)] : []
|
|
212
|
+
].join("");
|
|
213
|
+
}
|
|
214
|
+
static buildExcludingOfFilesInSpecificSubdirectoriesGlobSelector(compoundParameter) {
|
|
215
|
+
const subdirectoriesNames = compoundParameter.subdirectoriesNames instanceof Set ?
|
|
216
|
+
compoundParameter.subdirectoriesNames : new Set(compoundParameter.subdirectoriesNames);
|
|
217
|
+
if (subdirectoriesNames.size === 0) {
|
|
218
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
219
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({
|
|
220
|
+
parameterName: "compoundParameter.subdirectoriesNames",
|
|
221
|
+
parameterNumber: 1,
|
|
222
|
+
messageSpecificPart: "The property \"subdirectoriesNames\" must be defined with non-empty array."
|
|
223
|
+
}),
|
|
224
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
225
|
+
occurrenceLocation: "ImprovedGlob.buildExcludingOfFilesInSpecificSubdirectoriesGlobSelector(compoundParameter)"
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
let filesNamesExtensions;
|
|
229
|
+
if ((0, es_extensions_1.isUndefined)(compoundParameter.filesNamesExtensions)) {
|
|
230
|
+
filesNamesExtensions = new Set();
|
|
231
|
+
}
|
|
232
|
+
else if (compoundParameter.filesNamesExtensions instanceof Set) {
|
|
233
|
+
filesNamesExtensions = compoundParameter.filesNamesExtensions;
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
filesNamesExtensions = new Set(compoundParameter.filesNamesExtensions);
|
|
237
|
+
}
|
|
238
|
+
return [
|
|
239
|
+
"!",
|
|
240
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
241
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.basicDirectoryPath),
|
|
242
|
+
trailingCharacter: "/"
|
|
243
|
+
}),
|
|
244
|
+
`**/@(${Array.from(subdirectoriesNames).join("|")})/**/*`,
|
|
245
|
+
...filesNamesExtensions.size > 0 ?
|
|
246
|
+
[ImprovedGlob.createMultipleFilenameExtensionsGlobPostfix(filesNamesExtensions)] : []
|
|
247
|
+
].join("");
|
|
248
|
+
}
|
|
249
|
+
static createMultipleFilenameExtensionsGlobPostfix(fileNamesExtensions) {
|
|
250
|
+
return `.@(${(Array.isArray(fileNamesExtensions) ?
|
|
251
|
+
fileNamesExtensions :
|
|
252
|
+
Array.from(fileNamesExtensions)).join("|").replace(/\./gu, "")})`;
|
|
253
|
+
}
|
|
254
|
+
static buildAbsolutePathBasedGlob(compoundParameter) {
|
|
255
|
+
return [
|
|
256
|
+
compoundParameter.isExclusive === true ? ["!"] : [],
|
|
257
|
+
(0, appendCharacterIfItDoesNotPresentInLastPosition_1.default)({
|
|
258
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.basicDirectoryPath),
|
|
259
|
+
trailingCharacter: "/"
|
|
260
|
+
}),
|
|
261
|
+
(0, es_extensions_1.removeSpecificCharacterFromCertainPosition)({
|
|
262
|
+
targetString: (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(compoundParameter.relativePathBasedGlob),
|
|
263
|
+
targetCharacter: "/",
|
|
264
|
+
fromLastPosition: true
|
|
265
|
+
})
|
|
266
|
+
].join("");
|
|
267
|
+
}
|
|
268
|
+
static includingGlobSelectorToExcludingOne(targetIncludingGlobSelector) {
|
|
269
|
+
return targetIncludingGlobSelector.startsWith("!") ? targetIncludingGlobSelector : `!${targetIncludingGlobSelector}`;
|
|
270
|
+
}
|
|
271
|
+
static includingGlobSelectorsToExcludingOnes(targetIncludingGlobSelectors) {
|
|
272
|
+
return targetIncludingGlobSelectors.map((targetIncludingGlobSelector) => ImprovedGlob.includingGlobSelectorToExcludingOne(targetIncludingGlobSelector));
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
exports.default = ImprovedGlob;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import Path from "path";
|
|
2
|
+
declare abstract class ImprovedPath {
|
|
3
|
+
static joinPathSegments(pathSegments: ReadonlyArray<string>, options?: Readonly<{
|
|
4
|
+
alwaysForwardSlashSeparators: boolean;
|
|
5
|
+
}>): string;
|
|
6
|
+
static buildAbsolutePathFromCurrentWorkingDirectory(pathSegments: ReadonlyArray<string>, options?: Readonly<{
|
|
7
|
+
alwaysForwardSlashSeparators: boolean;
|
|
8
|
+
}>): string;
|
|
9
|
+
static computeRelativePath(namedParameters: Readonly<{
|
|
10
|
+
basePath: string;
|
|
11
|
+
comparedPath: string;
|
|
12
|
+
alwaysForwardSlashSeparators?: boolean;
|
|
13
|
+
}>): string;
|
|
14
|
+
static parsePath(targetPath: string): ImprovedPath.ParsingResult;
|
|
15
|
+
static replacePathSeparatorsToForwardSlashes(targetPath: string): string;
|
|
16
|
+
static explodePathToSegments(targetPath: string): Array<string>;
|
|
17
|
+
static doesPathEndWithFileNameExtension(namedParameters: Readonly<{
|
|
18
|
+
targetPath: string;
|
|
19
|
+
mustConsiderLasPathSegmentBeginsFromDotAsTheFileNameWithoutExtension: boolean;
|
|
20
|
+
}>): boolean;
|
|
21
|
+
static extractFileNameWithoutExtensionFromPath(namedParameters: Readonly<{
|
|
22
|
+
targetPath: string;
|
|
23
|
+
mustThrowErrorIfLastPathSegmentHasNoDots: false;
|
|
24
|
+
}>): string | null;
|
|
25
|
+
static extractFileNameWithoutExtensionFromPath(namedParameters: Readonly<{
|
|
26
|
+
targetPath: string;
|
|
27
|
+
mustThrowErrorIfLastPathSegmentHasNoDots: true;
|
|
28
|
+
}>): string;
|
|
29
|
+
static extractDirectoryFromFilePath(compoundParameter: Readonly<{
|
|
30
|
+
targetPath: string;
|
|
31
|
+
ambiguitiesResolution: Readonly<{
|
|
32
|
+
mustConsiderLastSegmentStartingWithDotAsDirectory: boolean;
|
|
33
|
+
mustConsiderLastSegmentWithNonLeadingDotAsDirectory: boolean;
|
|
34
|
+
mustConsiderLastSegmentWithoutDotsAsFileNameWithoutExtension: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
alwaysForwardSlashSeparators?: boolean;
|
|
37
|
+
}>): string;
|
|
38
|
+
}
|
|
39
|
+
declare namespace ImprovedPath {
|
|
40
|
+
class ParsingResult {
|
|
41
|
+
#private;
|
|
42
|
+
constructor(namedParameters: Readonly<{
|
|
43
|
+
rawPath: string;
|
|
44
|
+
nativeParsedPath: Path.ParsedPath;
|
|
45
|
+
}>);
|
|
46
|
+
get root(): string | null;
|
|
47
|
+
get root__forwardSlashesSeparators(): string | null;
|
|
48
|
+
getRootExpectedToExist(namedParameters?: Readonly<{
|
|
49
|
+
alwaysForwardSlashesSeparators: boolean;
|
|
50
|
+
}>): string;
|
|
51
|
+
get directory(): string | null;
|
|
52
|
+
get directory__forwardSlashesSeparators(): string | null;
|
|
53
|
+
getDirectoryExpectedToExist(namedParameters?: Readonly<{
|
|
54
|
+
alwaysForwardSlashesSeparators: boolean;
|
|
55
|
+
}>): string;
|
|
56
|
+
get directoryExplodedToPathSegments(): ReadonlyArray<string>;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
export default ImprovedPath;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const es_extensions_1 = require("@yamato-daiwa/es-extensions");
|
|
8
|
+
class ImprovedPath {
|
|
9
|
+
static joinPathSegments(pathSegments, options) {
|
|
10
|
+
try {
|
|
11
|
+
return options?.alwaysForwardSlashSeparators === true ?
|
|
12
|
+
(0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(path_1.default.join(...pathSegments)) :
|
|
13
|
+
path_1.default.join(...pathSegments);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
17
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({ parameterName: "pathSegments", parameterNumber: 1 }),
|
|
18
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
19
|
+
occurrenceLocation: "ImprovedPath.joinPathSegments(pathSegments, options)",
|
|
20
|
+
innerError: error
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
static buildAbsolutePathFromCurrentWorkingDirectory(pathSegments, options) {
|
|
25
|
+
const segmentsIncludingAbsolutePaths = pathSegments.
|
|
26
|
+
filter((pathSegment) => path_1.default.isAbsolute(pathSegment));
|
|
27
|
+
if (segmentsIncludingAbsolutePaths.length > 0) {
|
|
28
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
29
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({
|
|
30
|
+
parameterName: "pathSegments",
|
|
31
|
+
parameterNumber: 1,
|
|
32
|
+
messageSpecificPart: `${segmentsIncludingAbsolutePaths.length} path segment(s) including absolute path:\n` +
|
|
33
|
+
`${(0, es_extensions_1.stringifyAndFormatArbitraryValue)(segmentsIncludingAbsolutePaths)}\n` +
|
|
34
|
+
"As it follows from the method name, it builds absolute path from current working directory thus " +
|
|
35
|
+
"does not require the implicit absolute path. If you want join the arbitrary absolute path with other path " +
|
|
36
|
+
"segments, use 'joinPathSegments' method instead."
|
|
37
|
+
}),
|
|
38
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
39
|
+
occurrenceLocation: "ImprovedPath.buildAbsolutePathFromCurrentWorkingDirectory(pathSegments, options)"
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
return options?.alwaysForwardSlashSeparators === true ?
|
|
44
|
+
(0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(path_1.default.resolve(...pathSegments)) :
|
|
45
|
+
path_1.default.resolve(...pathSegments);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
49
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({ parameterName: "pathSegments", parameterNumber: 1 }),
|
|
50
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
51
|
+
occurrenceLocation: "ImprovedPath.buildAbsolutePathFromCurrentWorkingDirectory(pathSegments, options)",
|
|
52
|
+
innerError: error
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
static computeRelativePath(namedParameters) {
|
|
57
|
+
let operationingSystemDependentRelativePath;
|
|
58
|
+
try {
|
|
59
|
+
operationingSystemDependentRelativePath = path_1.default.relative(namedParameters.basePath, namedParameters.comparedPath);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
63
|
+
errorInstance: new es_extensions_1.InvalidParameterValueError({ parameterName: "namedParameters", parameterNumber: 1 }),
|
|
64
|
+
title: es_extensions_1.InvalidParameterValueError.localization.defaultTitle,
|
|
65
|
+
occurrenceLocation: "ImprovedPath.computeRelativePath(namedParameters)",
|
|
66
|
+
innerError: error
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return namedParameters.alwaysForwardSlashSeparators === true ?
|
|
70
|
+
(0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(operationingSystemDependentRelativePath) :
|
|
71
|
+
operationingSystemDependentRelativePath;
|
|
72
|
+
}
|
|
73
|
+
static parsePath(targetPath) {
|
|
74
|
+
const nativeParsedPath = path_1.default.parse(targetPath);
|
|
75
|
+
return new ImprovedPath.ParsingResult({
|
|
76
|
+
rawPath: targetPath,
|
|
77
|
+
nativeParsedPath
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
static replacePathSeparatorsToForwardSlashes(targetPath) {
|
|
81
|
+
return (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(targetPath);
|
|
82
|
+
}
|
|
83
|
+
static explodePathToSegments(targetPath) {
|
|
84
|
+
const normalizedPath = ImprovedPath.replacePathSeparatorsToForwardSlashes(path_1.default.normalize(targetPath));
|
|
85
|
+
return [
|
|
86
|
+
...normalizedPath.startsWith("/") ? ["/"] : [],
|
|
87
|
+
...(0, es_extensions_1.splitString)(normalizedPath, "/").filter((pathSegment) => pathSegment.length > 0)
|
|
88
|
+
];
|
|
89
|
+
}
|
|
90
|
+
static doesPathEndWithFileNameExtension(namedParameters) {
|
|
91
|
+
const lastPathSegment = ImprovedPath.explodePathToSegments(namedParameters.targetPath).at(-1);
|
|
92
|
+
if ((0, es_extensions_1.isUndefined)(lastPathSegment)) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (!lastPathSegment.includes(".") || lastPathSegment.endsWith(".")) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
if (lastPathSegment.startsWith(".")) {
|
|
99
|
+
return namedParameters.mustConsiderLasPathSegmentBeginsFromDotAsTheFileNameWithoutExtension;
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
static extractFileNameWithoutExtensionFromPath(namedParameters) {
|
|
104
|
+
let targetPathExplodedToSegments = ImprovedPath.explodePathToSegments(namedParameters.targetPath);
|
|
105
|
+
if (targetPathExplodedToSegments.length > 1 && targetPathExplodedToSegments[0] === ".") {
|
|
106
|
+
targetPathExplodedToSegments = [""];
|
|
107
|
+
}
|
|
108
|
+
const lastPathSegment = (0, es_extensions_1.getLastElementOfArray)(targetPathExplodedToSegments, { mustThrowErrorIfArrayIsEmpty: true });
|
|
109
|
+
const dotSeparatedSubsegmentsOfLastSegment = (0, es_extensions_1.splitString)(lastPathSegment, ".");
|
|
110
|
+
if (dotSeparatedSubsegmentsOfLastSegment[0].length > 0) {
|
|
111
|
+
return dotSeparatedSubsegmentsOfLastSegment[0];
|
|
112
|
+
}
|
|
113
|
+
if (namedParameters.mustThrowErrorIfLastPathSegmentHasNoDots) {
|
|
114
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
115
|
+
errorInstance: new es_extensions_1.UnexpectedEventError(`Contrary to expectations, the last segment of '${namedParameters.targetPath}' does not look like the ` +
|
|
116
|
+
"file name with extension."),
|
|
117
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
118
|
+
occurrenceLocation: "ImprovedPath.extractFileNameWithoutExtensionFromPath(namedParameters)"
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
static extractDirectoryFromFilePath(compoundParameter) {
|
|
124
|
+
const targetPath = ImprovedPath.replacePathSeparatorsToForwardSlashes(compoundParameter.targetPath);
|
|
125
|
+
const pathSegments = ImprovedPath.explodePathToSegments(targetPath);
|
|
126
|
+
if (pathSegments.length === 1 && pathSegments[0] === ".") {
|
|
127
|
+
return "/";
|
|
128
|
+
}
|
|
129
|
+
const lastPathSegment = (0, es_extensions_1.getLastElementOfArray)(pathSegments, { mustThrowErrorIfArrayIsEmpty: true });
|
|
130
|
+
if (lastPathSegment.startsWith(".")) {
|
|
131
|
+
if (compoundParameter.ambiguitiesResolution.mustConsiderLastSegmentStartingWithDotAsDirectory) {
|
|
132
|
+
return compoundParameter.alwaysForwardSlashSeparators === true ?
|
|
133
|
+
targetPath : path_1.default.normalize(targetPath);
|
|
134
|
+
}
|
|
135
|
+
return ImprovedPath.joinPathSegments(pathSegments.slice(0, -1), { alwaysForwardSlashSeparators: compoundParameter.alwaysForwardSlashSeparators === true });
|
|
136
|
+
}
|
|
137
|
+
if (lastPathSegment.includes(".")) {
|
|
138
|
+
if (compoundParameter.ambiguitiesResolution.mustConsiderLastSegmentWithNonLeadingDotAsDirectory) {
|
|
139
|
+
return compoundParameter.alwaysForwardSlashSeparators === true ? targetPath : path_1.default.normalize(targetPath);
|
|
140
|
+
}
|
|
141
|
+
return ImprovedPath.joinPathSegments(pathSegments.slice(0, -1), { alwaysForwardSlashSeparators: compoundParameter.alwaysForwardSlashSeparators === true });
|
|
142
|
+
}
|
|
143
|
+
if (compoundParameter.ambiguitiesResolution.mustConsiderLastSegmentWithoutDotsAsFileNameWithoutExtension) {
|
|
144
|
+
return ImprovedPath.joinPathSegments(pathSegments.slice(0, -1), { alwaysForwardSlashSeparators: compoundParameter.alwaysForwardSlashSeparators === true });
|
|
145
|
+
}
|
|
146
|
+
return compoundParameter.alwaysForwardSlashSeparators === true ? targetPath : path_1.default.normalize(targetPath);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
(function (ImprovedPath) {
|
|
150
|
+
class ParsingResult {
|
|
151
|
+
#rawPath;
|
|
152
|
+
#root;
|
|
153
|
+
#root__forwardSlashesSeparators;
|
|
154
|
+
#directory;
|
|
155
|
+
#directory__forwardSlashesSeparators;
|
|
156
|
+
#directoryExplodedToPathSegments;
|
|
157
|
+
constructor(namedParameters) {
|
|
158
|
+
this.#rawPath = namedParameters.rawPath;
|
|
159
|
+
if (namedParameters.nativeParsedPath.root.length > 0) {
|
|
160
|
+
this.#root = namedParameters.nativeParsedPath.root;
|
|
161
|
+
this.#root__forwardSlashesSeparators = (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(this.#root);
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
this.#root = null;
|
|
165
|
+
this.#root__forwardSlashesSeparators = null;
|
|
166
|
+
}
|
|
167
|
+
if (namedParameters.nativeParsedPath.dir.length > 0) {
|
|
168
|
+
this.#directory = namedParameters.nativeParsedPath.dir;
|
|
169
|
+
this.#directory__forwardSlashesSeparators = (0, es_extensions_1.replaceDoubleBackslashesWithForwardSlashes)(this.#directory);
|
|
170
|
+
this.#directoryExplodedToPathSegments = [
|
|
171
|
+
...this.#directory__forwardSlashesSeparators.startsWith("/") ? ["/"] : [],
|
|
172
|
+
...(0, es_extensions_1.splitString)(this.#directory__forwardSlashesSeparators, "/").
|
|
173
|
+
filter((pathSegment) => pathSegment.length > 0)
|
|
174
|
+
];
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
this.#directory = null;
|
|
178
|
+
this.#directory__forwardSlashesSeparators = null;
|
|
179
|
+
this.#directoryExplodedToPathSegments = [];
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
get root() {
|
|
183
|
+
return this.#root;
|
|
184
|
+
}
|
|
185
|
+
get root__forwardSlashesSeparators() {
|
|
186
|
+
return this.#root__forwardSlashesSeparators;
|
|
187
|
+
}
|
|
188
|
+
getRootExpectedToExist(namedParameters) {
|
|
189
|
+
const root = namedParameters?.alwaysForwardSlashesSeparators === true ?
|
|
190
|
+
this.#root__forwardSlashesSeparators : this.#root;
|
|
191
|
+
if ((0, es_extensions_1.isNull)(root)) {
|
|
192
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
193
|
+
errorInstance: new es_extensions_1.UnexpectedEventError(`Contrary to expectations, the root is not exists on path '${this.#rawPath}'.`),
|
|
194
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
195
|
+
occurrenceLocation: "ImprovedPath.ParsedPath.getRootExpectedToBeExists(namedParameters)"
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return root;
|
|
199
|
+
}
|
|
200
|
+
get directory() {
|
|
201
|
+
return this.#directory;
|
|
202
|
+
}
|
|
203
|
+
get directory__forwardSlashesSeparators() {
|
|
204
|
+
return this.#directory__forwardSlashesSeparators;
|
|
205
|
+
}
|
|
206
|
+
getDirectoryExpectedToExist(namedParameters) {
|
|
207
|
+
const directory = namedParameters?.alwaysForwardSlashesSeparators === true ?
|
|
208
|
+
this.#directory__forwardSlashesSeparators : this.#directory;
|
|
209
|
+
if ((0, es_extensions_1.isNull)(directory)) {
|
|
210
|
+
es_extensions_1.Logger.throwErrorWithFormattedMessage({
|
|
211
|
+
errorInstance: new es_extensions_1.UnexpectedEventError(`Contrary to expectations, the directory is not exists on path '${this.#rawPath}'.`),
|
|
212
|
+
title: es_extensions_1.UnexpectedEventError.localization.defaultTitle,
|
|
213
|
+
occurrenceLocation: "ImprovedPath.ParsedPath.getDirectoryExpectedToExist(namedParameters)"
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
return directory;
|
|
217
|
+
}
|
|
218
|
+
get directoryExplodedToPathSegments() {
|
|
219
|
+
return this.#directoryExplodedToPathSegments;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
ImprovedPath.ParsingResult = ParsingResult;
|
|
223
|
+
})(ImprovedPath || (ImprovedPath = {}));
|
|
224
|
+
exports.default = ImprovedPath;
|