eser 4.0.6 → 4.0.7
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/eser.js +123 -20
- package/package.json +1 -1
package/eser.js
CHANGED
|
@@ -7291,12 +7291,125 @@ var init_mod7 = __esm({
|
|
|
7291
7291
|
}
|
|
7292
7292
|
});
|
|
7293
7293
|
|
|
7294
|
+
// pkg/@eser/fp/get.ts
|
|
7295
|
+
var get;
|
|
7296
|
+
var init_get = __esm({
|
|
7297
|
+
"pkg/@eser/fp/get.ts"() {
|
|
7298
|
+
get = (object, path, defaultValue) => {
|
|
7299
|
+
if (object === null || object === void 0) {
|
|
7300
|
+
return defaultValue;
|
|
7301
|
+
}
|
|
7302
|
+
const length = path.length;
|
|
7303
|
+
if (length === 0) {
|
|
7304
|
+
return object;
|
|
7305
|
+
}
|
|
7306
|
+
let current = object;
|
|
7307
|
+
for (let i = 0; i < length; i++) {
|
|
7308
|
+
if (current === null || current === void 0) {
|
|
7309
|
+
return defaultValue;
|
|
7310
|
+
}
|
|
7311
|
+
const key = path[i];
|
|
7312
|
+
current = current[key];
|
|
7313
|
+
}
|
|
7314
|
+
return current === void 0 ? defaultValue : current;
|
|
7315
|
+
};
|
|
7316
|
+
}
|
|
7317
|
+
});
|
|
7318
|
+
|
|
7319
|
+
// pkg/@eser/fp/deep-merge.ts
|
|
7320
|
+
var DEEP_MERGE_DEFAULT_MAX_DEPTH, DeepMergeError, deepMerge2;
|
|
7321
|
+
var init_deep_merge2 = __esm({
|
|
7322
|
+
"pkg/@eser/fp/deep-merge.ts"() {
|
|
7323
|
+
DEEP_MERGE_DEFAULT_MAX_DEPTH = 100;
|
|
7324
|
+
DeepMergeError = class extends Error {
|
|
7325
|
+
constructor(message) {
|
|
7326
|
+
super(message);
|
|
7327
|
+
this.name = "DeepMergeError";
|
|
7328
|
+
}
|
|
7329
|
+
};
|
|
7330
|
+
deepMerge2 = (instance, other, options) => {
|
|
7331
|
+
const maxDepth = options?.maxDepth ?? DEEP_MERGE_DEFAULT_MAX_DEPTH;
|
|
7332
|
+
const seenInstance = /* @__PURE__ */ new WeakSet();
|
|
7333
|
+
const seenOther = /* @__PURE__ */ new WeakSet();
|
|
7334
|
+
const mergeRecursive = (inst, oth, currentDepth) => {
|
|
7335
|
+
if (!(inst instanceof Object)) {
|
|
7336
|
+
return inst;
|
|
7337
|
+
}
|
|
7338
|
+
if (seenInstance.has(inst)) {
|
|
7339
|
+
throw new DeepMergeError("Circular reference detected in first argument: cannot deep merge objects with circular references");
|
|
7340
|
+
}
|
|
7341
|
+
if (oth instanceof Object && seenOther.has(oth)) {
|
|
7342
|
+
throw new DeepMergeError("Circular reference detected in second argument: cannot deep merge objects with circular references");
|
|
7343
|
+
}
|
|
7344
|
+
if (currentDepth > maxDepth) {
|
|
7345
|
+
throw new DeepMergeError(`Maximum recursion depth exceeded (${maxDepth}). Objects are too deeply nested or contain circular references.`);
|
|
7346
|
+
}
|
|
7347
|
+
seenInstance.add(inst);
|
|
7348
|
+
if (oth instanceof Object) {
|
|
7349
|
+
seenOther.add(oth);
|
|
7350
|
+
}
|
|
7351
|
+
try {
|
|
7352
|
+
const Type = inst.constructor;
|
|
7353
|
+
const result = new Type();
|
|
7354
|
+
const instKeys = Object.keys(inst);
|
|
7355
|
+
const processedKeys = /* @__PURE__ */ new Set();
|
|
7356
|
+
for (let i = 0, len = instKeys.length; i < len; i++) {
|
|
7357
|
+
const itemKey = instKeys[i];
|
|
7358
|
+
const recordValue = inst[itemKey];
|
|
7359
|
+
const otherKeyExists = oth !== void 0 && itemKey in oth;
|
|
7360
|
+
const otherValue = oth?.[itemKey];
|
|
7361
|
+
processedKeys.add(itemKey);
|
|
7362
|
+
if (recordValue instanceof Object && recordValue.constructor !== Array) {
|
|
7363
|
+
let mergedValue;
|
|
7364
|
+
if (otherKeyExists && otherValue instanceof Object && otherValue.constructor !== Array) {
|
|
7365
|
+
mergedValue = mergeRecursive(recordValue, otherValue, currentDepth + 1);
|
|
7366
|
+
} else if (otherKeyExists) {
|
|
7367
|
+
mergedValue = otherValue;
|
|
7368
|
+
} else {
|
|
7369
|
+
mergedValue = mergeRecursive(recordValue, {}, currentDepth + 1);
|
|
7370
|
+
}
|
|
7371
|
+
result[itemKey] = mergedValue;
|
|
7372
|
+
} else {
|
|
7373
|
+
result[itemKey] = otherKeyExists ? otherValue : recordValue;
|
|
7374
|
+
}
|
|
7375
|
+
}
|
|
7376
|
+
if (oth === void 0) {
|
|
7377
|
+
return result;
|
|
7378
|
+
}
|
|
7379
|
+
const otherKeys = Object.keys(oth);
|
|
7380
|
+
for (let i = 0, len = otherKeys.length; i < len; i++) {
|
|
7381
|
+
const itemKey = otherKeys[i];
|
|
7382
|
+
if (processedKeys.has(itemKey)) {
|
|
7383
|
+
continue;
|
|
7384
|
+
}
|
|
7385
|
+
const otherValue = oth[itemKey];
|
|
7386
|
+
if (otherValue instanceof Object && otherValue.constructor !== Array) {
|
|
7387
|
+
result[itemKey] = mergeRecursive({}, otherValue, currentDepth + 1);
|
|
7388
|
+
} else {
|
|
7389
|
+
result[itemKey] = otherValue;
|
|
7390
|
+
}
|
|
7391
|
+
}
|
|
7392
|
+
return result;
|
|
7393
|
+
} finally {
|
|
7394
|
+
seenInstance.delete(inst);
|
|
7395
|
+
if (oth instanceof Object) {
|
|
7396
|
+
seenOther.delete(oth);
|
|
7397
|
+
}
|
|
7398
|
+
}
|
|
7399
|
+
};
|
|
7400
|
+
return mergeRecursive(instance, other, 0);
|
|
7401
|
+
};
|
|
7402
|
+
}
|
|
7403
|
+
});
|
|
7404
|
+
|
|
7294
7405
|
// pkg/@eser/codebase/package/loader.ts
|
|
7295
7406
|
var PackageLoadError, tryLoadConfigFile, findConfigFiles, getPropertyByPath, extractField, mergeFieldMappings, sortByPriority, load, tryLoad, getFilesWithField, getBaseDir;
|
|
7296
7407
|
var init_loader2 = __esm({
|
|
7297
7408
|
"pkg/@eser/codebase/package/loader.ts"() {
|
|
7298
7409
|
init_mod4();
|
|
7299
7410
|
init_mod7();
|
|
7411
|
+
init_get();
|
|
7412
|
+
init_deep_merge2();
|
|
7300
7413
|
init_mod2();
|
|
7301
7414
|
init_types3();
|
|
7302
7415
|
PackageLoadError = class extends Error {
|
|
@@ -7343,15 +7456,7 @@ var init_loader2 = __esm({
|
|
|
7343
7456
|
return results;
|
|
7344
7457
|
};
|
|
7345
7458
|
getPropertyByPath = (obj, path) => {
|
|
7346
|
-
|
|
7347
|
-
let current = obj;
|
|
7348
|
-
for (const part of parts) {
|
|
7349
|
-
if (current === null || current === void 0 || typeof current !== "object") {
|
|
7350
|
-
return void 0;
|
|
7351
|
-
}
|
|
7352
|
-
current = current[part];
|
|
7353
|
-
}
|
|
7354
|
-
return current;
|
|
7459
|
+
return get(obj, path.split("."));
|
|
7355
7460
|
};
|
|
7356
7461
|
extractField = (fieldName, loadedFiles, fieldMappings) => {
|
|
7357
7462
|
let primaryValue;
|
|
@@ -7391,16 +7496,7 @@ var init_loader2 = __esm({
|
|
|
7391
7496
|
if (customMappings === void 0) {
|
|
7392
7497
|
return DEFAULT_FIELD_MAPPINGS;
|
|
7393
7498
|
}
|
|
7394
|
-
|
|
7395
|
-
...DEFAULT_FIELD_MAPPINGS
|
|
7396
|
-
};
|
|
7397
|
-
for (const [field, mapping] of Object.entries(customMappings)) {
|
|
7398
|
-
merged[field] = {
|
|
7399
|
-
...merged[field],
|
|
7400
|
-
...mapping
|
|
7401
|
-
};
|
|
7402
|
-
}
|
|
7403
|
-
return merged;
|
|
7499
|
+
return deepMerge2(DEFAULT_FIELD_MAPPINGS, customMappings);
|
|
7404
7500
|
};
|
|
7405
7501
|
sortByPriority = (files) => {
|
|
7406
7502
|
return [
|
|
@@ -8587,11 +8683,18 @@ var init_licenses = __esm({
|
|
|
8587
8683
|
}
|
|
8588
8684
|
});
|
|
8589
8685
|
|
|
8686
|
+
// pkg/@eser/fp/group-by.ts
|
|
8687
|
+
var init_group_by = __esm({
|
|
8688
|
+
"pkg/@eser/fp/group-by.ts"() {
|
|
8689
|
+
}
|
|
8690
|
+
});
|
|
8691
|
+
|
|
8590
8692
|
// pkg/@eser/codebase/check-package-configs.ts
|
|
8591
8693
|
var deepEqual, getFieldValue, isNpmJsrSpec, fromNpmJsrToDeno, convertPkgDepToDenoImport, isWorkspaceDep, checkDependencies, checkPackage, checkPackageConfigs;
|
|
8592
8694
|
var init_check_package_configs = __esm({
|
|
8593
8695
|
async "pkg/@eser/codebase/check-package-configs.ts"() {
|
|
8594
8696
|
init_colors();
|
|
8697
|
+
init_group_by();
|
|
8595
8698
|
init_mod2();
|
|
8596
8699
|
init_mod8();
|
|
8597
8700
|
init_types3();
|
|
@@ -12080,7 +12183,7 @@ var systemCommand = new Command("system").description("Commands related with thi
|
|
|
12080
12183
|
// pkg/@eser/cli/package.json
|
|
12081
12184
|
var package_default = {
|
|
12082
12185
|
name: "@eser/cli",
|
|
12083
|
-
version: "4.0.
|
|
12186
|
+
version: "4.0.7",
|
|
12084
12187
|
type: "module",
|
|
12085
12188
|
exports: "./main.ts",
|
|
12086
12189
|
bin: {
|