@hop-top/kit 0.5.0-alpha.6 → 0.5.0-alpha.8

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.
Files changed (72) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/LICENSE-cobra.txt +174 -0
  3. package/NOTICE +15 -0
  4. package/README.md +3 -3
  5. package/dist/alias-D9_qFlyP.d.ts +174 -0
  6. package/dist/alias.d.ts +1 -1
  7. package/dist/alias.js +10 -2
  8. package/dist/chunk-263IZ6Z6.js +915 -0
  9. package/dist/{chunk-S45UHXQF.js → chunk-BLS2OBIQ.js} +106 -25
  10. package/dist/{chunk-7FDIN5KE.js → chunk-GHPJJV5L.js} +8 -4
  11. package/dist/chunk-JKMQSAJP.js +174 -0
  12. package/dist/chunk-JZ22ZUFA.js +1131 -0
  13. package/dist/{chunk-GAZPYCQD.js → chunk-NLMS7HGP.js} +93 -35
  14. package/dist/chunk-QQQYCWSC.js +240 -0
  15. package/dist/chunk-XJTRY453.js +868 -0
  16. package/dist/cli.js +6 -4
  17. package/dist/completion-csVun6SP.d.ts +112 -0
  18. package/dist/completion-values-By-mnjNt.d.ts +142 -0
  19. package/dist/completion-values.d.ts +1 -0
  20. package/dist/completion-values.js +29 -0
  21. package/dist/completion.d.ts +2 -1
  22. package/dist/completion.js +23 -2
  23. package/dist/compliance-AxFf-uMy.d.ts +60 -0
  24. package/dist/compliance.d.ts +1 -0
  25. package/dist/compliance.js +17 -0
  26. package/dist/config-CaK60ByQ.d.ts +241 -0
  27. package/dist/config.d.ts +1 -1
  28. package/dist/config.js +4 -2
  29. package/dist/index.d.ts +7 -5
  30. package/dist/index.js +26 -18
  31. package/dist/log-CkaxMX3U.d.ts +115 -0
  32. package/dist/log.d.ts +1 -1
  33. package/dist/log.js +2 -2
  34. package/dist/toolspec-UrWnoJ3Y.d.ts +336 -0
  35. package/dist/toolspec.d.ts +2 -1
  36. package/dist/toolspec.js +27 -2
  37. package/package.json +19 -3
  38. package/src/alias.conformance.test.ts +250 -0
  39. package/src/alias.test.ts +206 -2
  40. package/src/alias.ts +196 -21
  41. package/src/cli.ts +5 -0
  42. package/src/completion-scripts.ts +16 -0
  43. package/src/completion-values.test.ts +70 -10
  44. package/src/completion-values.ts +170 -66
  45. package/src/completion.conformance.test.ts +297 -0
  46. package/src/completion.test.ts +256 -145
  47. package/src/completion.ts +767 -121
  48. package/src/config-merge.test.ts +425 -0
  49. package/src/config.test.ts +41 -0
  50. package/src/config.ts +265 -18
  51. package/src/index.test.ts +2 -1
  52. package/src/index.ts +5 -1
  53. package/src/log.test.ts +270 -1
  54. package/src/log.ts +172 -44
  55. package/src/published-types.test.ts +18 -0
  56. package/src/toolspec-internal.ts +197 -0
  57. package/src/toolspec-manifest.test.ts +82 -0
  58. package/src/toolspec-manifest.ts +404 -0
  59. package/src/toolspec-spec-schemas.ts +12 -0
  60. package/src/toolspec-spec.test.ts +273 -0
  61. package/src/toolspec-spec.ts +458 -0
  62. package/src/toolspec.from-command.test.ts +216 -0
  63. package/src/toolspec.ts +159 -0
  64. package/test/toolspec/fixture.ts +73 -0
  65. package/dist/alias-BOj0-VAr.d.ts +0 -88
  66. package/dist/chunk-6RFRV4VP.js +0 -128
  67. package/dist/chunk-IQXEISMC.js +0 -142
  68. package/dist/chunk-W7ERKNSQ.js +0 -171
  69. package/dist/completion-CVnPcWMZ.d.ts +0 -32
  70. package/dist/config-Bm9fBXch.d.ts +0 -134
  71. package/dist/log-uKjHsK-c.d.ts +0 -62
  72. package/dist/toolspec-DPBr18Ub.d.ts +0 -106
@@ -18,40 +18,86 @@ var CHERRY = [237, 74, 94];
18
18
  var YAM = [229, 161, 78];
19
19
  var SQUID = [133, 129, 131];
20
20
  var SMOKE = [191, 188, 200];
21
+ var GUAC = [82, 207, 132];
21
22
  function fg(rgb, text) {
22
23
  return `\x1B[38;2;${rgb[0]};${rgb[1]};${rgb[2]}m${text}\x1B[0m`;
23
24
  }
24
25
  function bold(text) {
25
26
  return `\x1B[1m${text}\x1B[22m`;
26
27
  }
28
+ var SUCCESS_LEVEL = 31;
27
29
  var LEVEL_STYLES = {
28
30
  10: { label: "TRAC", color: SMOKE, bold: false },
29
31
  20: { label: "DEBU", color: SMOKE, bold: false },
30
32
  30: { label: "INFO", color: SQUID, bold: false },
33
+ [SUCCESS_LEVEL]: { label: "SUCC", color: GUAC, bold: false },
31
34
  40: { label: "WARN", color: YAM, bold: true },
32
35
  50: { label: "ERRO", color: CHERRY, bold: true },
33
36
  60: { label: "ERRO", color: CHERRY, bold: true }
34
37
  };
35
- function kitTransport(noColor) {
38
+ var LEVEL_NAMES = {
39
+ 10: "trace",
40
+ 20: "debug",
41
+ 30: "info",
42
+ [SUCCESS_LEVEL]: "info",
43
+ 40: "warn",
44
+ 50: "error",
45
+ 60: "fatal"
46
+ };
47
+ var RESERVED_KEYS = /* @__PURE__ */ new Set(["level", "time", "pid", "hostname", "msg", "v"]);
48
+ function parseRecord(chunk) {
49
+ const obj = JSON.parse(chunk);
50
+ const fields = {};
51
+ for (const [k, v] of Object.entries(obj)) {
52
+ if (!RESERVED_KEYS.has(k)) fields[k] = v;
53
+ }
54
+ const levelNum = LEVEL_STYLES[obj.level] ? obj.level : 30;
55
+ return {
56
+ levelNum,
57
+ level: LEVEL_NAMES[levelNum],
58
+ msg: _nullishCoalesce(obj.msg, () => ( "")),
59
+ fields,
60
+ ...levelNum === SUCCESS_LEVEL ? { kind: "success" } : {}
61
+ };
62
+ }
63
+ function renderText(rec, noColor) {
64
+ const style = LEVEL_STYLES[rec.levelNum];
65
+ let prefix = noColor ? style.label : fg(style.color, style.label);
66
+ if (style.bold && !noColor) prefix = bold(prefix);
67
+ const kvParts = [];
68
+ for (const [k, v] of Object.entries(rec.fields)) {
69
+ const sv = String(v);
70
+ kvParts.push(sv.includes(" ") ? `${k}="${sv}"` : `${k}=${sv}`);
71
+ }
72
+ const kv = kvParts.length ? " " + kvParts.join(" ") : "";
73
+ return `${prefix} ${rec.msg}${kv}
74
+ `;
75
+ }
76
+ function renderJSON(rec) {
77
+ const out = { level: rec.level, msg: rec.msg };
78
+ if (rec.kind) out.kind = rec.kind;
79
+ Object.assign(out, rec.fields);
80
+ if (rec.kind) out.kind = rec.kind;
81
+ return JSON.stringify(out) + "\n";
82
+ }
83
+ function renderCustom(rec, formatter) {
84
+ const { levelNum: _levelNum, ...pub } = rec;
85
+ const line = formatter(pub);
86
+ return line.endsWith("\n") ? line : line + "\n";
87
+ }
88
+ function render(rec, o) {
89
+ if (o.formatter) return renderCustom(rec, o.formatter);
90
+ return o.format === "json" ? renderJSON(rec) : renderText(rec, o.noColor);
91
+ }
92
+ function kitTransport(o) {
93
+ const out = () => _nullishCoalesce(o.output, () => ( process.stderr));
36
94
  return {
37
95
  write(chunk) {
38
96
  try {
39
- const obj = JSON.parse(chunk);
40
- const style = _nullishCoalesce(LEVEL_STYLES[obj.level], () => ( LEVEL_STYLES[30]));
41
- let prefix = noColor ? style.label : fg(style.color, style.label);
42
- if (style.bold && !noColor) prefix = bold(prefix);
43
- const msg = _nullishCoalesce(obj.msg, () => ( ""));
44
- const kvParts = [];
45
- for (const [k, v] of Object.entries(obj)) {
46
- if (["level", "time", "pid", "hostname", "msg", "v"].includes(k)) continue;
47
- const sv = String(v);
48
- kvParts.push(sv.includes(" ") ? `${k}="${sv}"` : `${k}=${sv}`);
49
- }
50
- const kv = kvParts.length ? " " + kvParts.join(" ") : "";
51
- process.stderr.write(`${prefix} ${msg}${kv}
52
- `);
97
+ const rec = parseRecord(chunk);
98
+ out().write(render(rec, o));
53
99
  } catch (e) {
54
- process.stderr.write(chunk);
100
+ out().write(chunk);
55
101
  }
56
102
  }
57
103
  };
@@ -82,33 +128,45 @@ function verbosityLevel(d, verbose) {
82
128
  function quietLevel(d) {
83
129
  return _nullishCoalesce(levelByName(_nullishCoalesce(_optionalChain([d, 'access', _3 => _3.verbosity, 'optionalAccess', _4 => _4.quiet_override]), () => ( ""))), () => ( "warn"));
84
130
  }
85
- function createLogger(opts) {
86
- const quiet = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _5 => _5.quiet]), () => ( false));
87
- const noColor = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _6 => _6.noColor]), () => ( false));
88
- const p = _pino2.default.call(void 0, {
89
- level: quiet ? quietLevel(_chunkQPUCXQXTjs.parity) : "debug"
90
- }, kitTransport(noColor));
131
+ var LEVEL_RANK = {
132
+ trace: 10,
133
+ debug: 20,
134
+ info: 30,
135
+ warn: 40,
136
+ error: 50,
137
+ fatal: 60,
138
+ silent: Infinity
139
+ };
140
+ function applyQuiet(level, quiet) {
141
+ if (!quiet) return level;
142
+ const q = quietLevel(_chunkQPUCXQXTjs.parity);
143
+ return LEVEL_RANK[level] < LEVEL_RANK[q] ? q : level;
144
+ }
145
+ function build(opts, defaultLevel) {
146
+ const level = applyQuiet(_nullishCoalesce(opts.level, () => ( defaultLevel)), _nullishCoalesce(opts.quiet, () => ( false)));
147
+ const p = _pino2.default.call(void 0,
148
+ { level, customLevels: { success: SUCCESS_LEVEL } },
149
+ kitTransport({
150
+ noColor: _nullishCoalesce(opts.noColor, () => ( false)),
151
+ format: _nullishCoalesce(opts.format, () => ( "text")),
152
+ formatter: opts.formatter,
153
+ output: opts.output
154
+ })
155
+ );
91
156
  return {
92
157
  info: (msg, ...kv) => p.info(kvToObj(kv), msg),
93
158
  warn: (msg, ...kv) => p.warn(kvToObj(kv), msg),
94
159
  error: (msg, ...kv) => p.error(kvToObj(kv), msg),
95
160
  debug: (msg, ...kv) => p.debug(kvToObj(kv), msg),
96
- trace: (msg, ...kv) => p.trace(kvToObj(kv), msg)
161
+ trace: (msg, ...kv) => p.trace(kvToObj(kv), msg),
162
+ success: (msg, ...kv) => p.success(kvToObj(kv), msg)
97
163
  };
98
164
  }
165
+ function createLogger(opts) {
166
+ return build(_nullishCoalesce(opts, () => ( {})), "debug");
167
+ }
99
168
  function withVerbose(opts) {
100
- const quiet = _nullishCoalesce(opts.quiet, () => ( false));
101
- const noColor = _nullishCoalesce(opts.noColor, () => ( false));
102
- const v = _nullishCoalesce(opts.verbose, () => ( 0));
103
- const level = quiet ? quietLevel(_chunkQPUCXQXTjs.parity) : verbosityLevel(_chunkQPUCXQXTjs.parity, v);
104
- const p = _pino2.default.call(void 0, { level }, kitTransport(noColor));
105
- return {
106
- info: (msg, ...kv) => p.info(kvToObj(kv), msg),
107
- warn: (msg, ...kv) => p.warn(kvToObj(kv), msg),
108
- error: (msg, ...kv) => p.error(kvToObj(kv), msg),
109
- debug: (msg, ...kv) => p.debug(kvToObj(kv), msg),
110
- trace: (msg, ...kv) => p.trace(kvToObj(kv), msg)
111
- };
169
+ return build(opts, verbosityLevel(_chunkQPUCXQXTjs.parity, _nullishCoalesce(opts.verbose, () => ( 0))));
112
170
  }
113
171
 
114
172
 
@@ -0,0 +1,240 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+ var _chunkR5U7XKVJjs = require('./chunk-R5U7XKVJ.js');
4
+
5
+ // src/config.ts
6
+ var config_exports = {};
7
+ _chunkR5U7XKVJjs.__export.call(void 0, config_exports, {
8
+ load: () => load2,
9
+ mergeLayers: () => mergeLayers
10
+ });
11
+ var _fs = require('fs'); var fs = _interopRequireWildcard(_fs);
12
+ var _path = require('path'); var path = _interopRequireWildcard(_path);
13
+ var _jsyaml = require('js-yaml'); var yaml = _interopRequireWildcard(_jsyaml);
14
+ function mergeLayers(layers, opts = {}) {
15
+ const policy = resolvePolicy(opts);
16
+ const out = {};
17
+ layers.forEach((layer, i) => {
18
+ if (!isPlainObject(layer)) return;
19
+ try {
20
+ checkBounds(layer);
21
+ } catch (err) {
22
+ throw new Error(`config: layer ${i}: ${errMessage(err)}`);
23
+ }
24
+ mergeInto(out, layer, policy, 0, "");
25
+ });
26
+ return out;
27
+ }
28
+ function load2(dst, opts = {}) {
29
+ const policy = resolvePolicy(_nullishCoalesce(opts.merge, () => ( {})));
30
+ const paths = [
31
+ opts.systemConfigPath,
32
+ opts.userConfigPath,
33
+ opts.projectConfigPath
34
+ ];
35
+ for (const p of paths) {
36
+ if (!p) continue;
37
+ mergeFile(dst, p, opts.parse, policy);
38
+ }
39
+ if (opts.envOverride) {
40
+ opts.envOverride(dst);
41
+ }
42
+ return dst;
43
+ }
44
+ function mergeFile(dst, filePath, parse, policy) {
45
+ let raw;
46
+ try {
47
+ raw = fs.readFileSync(filePath, "utf8");
48
+ } catch (err) {
49
+ if (isEnoent(err)) return;
50
+ throw err;
51
+ }
52
+ let parsed;
53
+ try {
54
+ const parser = parserFor(parse, filePath);
55
+ parsed = parser ? parser(raw, filePath) : yaml.load(raw);
56
+ checkBounds(parsed);
57
+ } catch (err) {
58
+ throw new Error(`config: failed to parse ${filePath}: ${errMessage(err)}`);
59
+ }
60
+ if (isPlainObject(parsed)) {
61
+ mergeInto(dst, parsed, policy, 0, "");
62
+ }
63
+ }
64
+ function parserFor(parse, filePath) {
65
+ if (parse === void 0) return void 0;
66
+ if (typeof parse === "function") return parse;
67
+ const ext = path.extname(filePath).toLowerCase();
68
+ return Object.prototype.hasOwnProperty.call(parse, ext) ? parse[ext] : void 0;
69
+ }
70
+ function errMessage(err) {
71
+ return err instanceof Error ? err.message : String(err);
72
+ }
73
+ var ARRAY_POLICIES = ["replace", "concat", "union"];
74
+ function resolvePolicy(opts) {
75
+ const { nullPolicy = "clear", maxDepth = Infinity, arrayPolicy = "replace", arrayPolicyByPath } = opts;
76
+ if (nullPolicy !== "clear" && nullPolicy !== "keep-lower") {
77
+ throw new Error(`config: invalid nullPolicy ${JSON.stringify(nullPolicy)}`);
78
+ }
79
+ if (maxDepth !== Infinity && !(Number.isInteger(maxDepth) && maxDepth >= 0)) {
80
+ throw new Error(`config: invalid maxDepth ${String(maxDepth)}: want a non-negative integer or Infinity`);
81
+ }
82
+ if (!ARRAY_POLICIES.includes(arrayPolicy)) {
83
+ throw new Error(`config: invalid arrayPolicy ${JSON.stringify(arrayPolicy)}`);
84
+ }
85
+ const byPath = /* @__PURE__ */ new Map();
86
+ const wildcards = [];
87
+ for (const [p, v] of Object.entries(_nullishCoalesce(arrayPolicyByPath, () => ( {})))) {
88
+ if (typeof v !== "function" && !ARRAY_POLICIES.includes(v)) {
89
+ throw new Error(`config: invalid arrayPolicyByPath[${JSON.stringify(p)}] ${JSON.stringify(v)}`);
90
+ }
91
+ const segs = p.split(".");
92
+ if (segs.includes("**")) {
93
+ throw new Error(`config: invalid arrayPolicyByPath[${JSON.stringify(p)}]: ** is not supported`);
94
+ }
95
+ byPath.set(p, v);
96
+ if (segs.includes("*")) wildcards.push({ pattern: p, segs, rule: v });
97
+ }
98
+ const stars = (segs) => segs.filter((x) => x === "*").length;
99
+ wildcards.sort(
100
+ (a, b) => stars(a.segs) - stars(b.segs) || (a.pattern < b.pattern ? -1 : a.pattern > b.pattern ? 1 : 0)
101
+ );
102
+ return { keepLower: nullPolicy === "keep-lower", maxDepth, array: arrayPolicy, byPath, wildcards };
103
+ }
104
+ var MAX_DEPTH = 100;
105
+ var ALIAS_MIN_ALIASES = 100;
106
+ var ALIAS_MIN_DECODED = 1e3;
107
+ var ALIAS_RATIO_LOW = 4e5;
108
+ var ALIAS_RATIO_HIGH = 4e6;
109
+ function allowedAliasRatio(decoded) {
110
+ if (decoded <= ALIAS_RATIO_LOW) return 0.99;
111
+ if (decoded >= ALIAS_RATIO_HIGH) return 0.1;
112
+ return 0.99 - 0.89 * ((decoded - ALIAS_RATIO_LOW) / (ALIAS_RATIO_HIGH - ALIAS_RATIO_LOW));
113
+ }
114
+ function checkBounds(root) {
115
+ const seen = /* @__PURE__ */ new WeakSet();
116
+ const stack = [[root, 1, false]];
117
+ let decoded = 0;
118
+ let aliased = 0;
119
+ while (stack.length > 0) {
120
+ const [node, depth, inAlias] = stack.pop();
121
+ let alias = inAlias;
122
+ const container = Array.isArray(node) || isPlainObject(node);
123
+ if (container) {
124
+ if (seen.has(node)) {
125
+ decoded++;
126
+ alias = true;
127
+ } else {
128
+ seen.add(node);
129
+ }
130
+ }
131
+ decoded++;
132
+ if (alias) aliased++;
133
+ if (aliased > ALIAS_MIN_ALIASES && decoded > ALIAS_MIN_DECODED && aliased / decoded > allowedAliasRatio(decoded)) {
134
+ throw new Error("document contains excessive aliasing");
135
+ }
136
+ if (!container) continue;
137
+ if (depth > MAX_DEPTH) {
138
+ throw new Error(`nesting exceeded maxDepth (${MAX_DEPTH})`);
139
+ }
140
+ if (Array.isArray(node)) {
141
+ for (let i = node.length - 1; i >= 0; i--) stack.push([node[i], depth + 1, alias]);
142
+ } else {
143
+ const keys = Object.keys(node);
144
+ for (let i = keys.length - 1; i >= 0; i--) {
145
+ decoded++;
146
+ if (alias) aliased++;
147
+ stack.push([node[keys[i]], depth + 1, alias]);
148
+ }
149
+ }
150
+ }
151
+ }
152
+ function mergeInto(dst, src, policy, depth, at) {
153
+ for (const key of Object.keys(src)) {
154
+ const next = src[key];
155
+ const has = Object.prototype.hasOwnProperty.call(dst, key);
156
+ const cur = has ? dst[key] : void 0;
157
+ if (next === null) {
158
+ if (policy.keepLower) continue;
159
+ if (has && cur !== null && cur !== void 0 && typeof cur !== "object") {
160
+ continue;
161
+ }
162
+ setOwn(dst, key, null);
163
+ } else if (isPlainObject(next) && isPlainObject(cur) && depth < policy.maxDepth) {
164
+ mergeInto(cur, next, policy, depth + 1, at === "" ? key : `${at}.${key}`);
165
+ } else if (Array.isArray(next) && Array.isArray(cur)) {
166
+ setOwn(dst, key, mergeArrays(cur, next, policy, at === "" ? key : `${at}.${key}`));
167
+ } else {
168
+ setOwn(dst, key, copy(next));
169
+ }
170
+ }
171
+ }
172
+ function mergeArrays(lower, higher, policy, at) {
173
+ const rule = _nullishCoalesce(_nullishCoalesce(policy.byPath.get(at), () => ( matchWildcard(policy, at))), () => ( policy.array));
174
+ const items = copy(higher);
175
+ if (typeof rule === "function") return rule(lower, items, at);
176
+ switch (rule) {
177
+ case "concat":
178
+ return [...lower, ...items];
179
+ case "union": {
180
+ const out = [];
181
+ for (const item of [...lower, ...items]) {
182
+ if (!out.some((o) => deepEqual(o, item))) out.push(item);
183
+ }
184
+ return out;
185
+ }
186
+ default:
187
+ return items;
188
+ }
189
+ }
190
+ function matchWildcard(policy, at) {
191
+ if (policy.wildcards.length === 0) return void 0;
192
+ const segs = at.split(".");
193
+ const hit = policy.wildcards.find(
194
+ (w) => w.segs.length === segs.length && w.segs.every((x, i) => x === "*" || x === segs[i])
195
+ );
196
+ return _optionalChain([hit, 'optionalAccess', _ => _.rule]);
197
+ }
198
+ function deepEqual(a, b) {
199
+ if (a === b || a !== a && b !== b) return true;
200
+ if (Array.isArray(a)) {
201
+ return Array.isArray(b) && a.length === b.length && a.every((v, i) => deepEqual(v, b[i]));
202
+ }
203
+ if (isPlainObject(a) && isPlainObject(b)) {
204
+ const ka = Object.keys(a);
205
+ if (ka.length !== Object.keys(b).length) return false;
206
+ return ka.every((k) => Object.prototype.hasOwnProperty.call(b, k) && deepEqual(a[k], b[k]));
207
+ }
208
+ return false;
209
+ }
210
+ function setOwn(dst, key, value) {
211
+ Object.defineProperty(dst, key, {
212
+ value,
213
+ writable: true,
214
+ enumerable: true,
215
+ configurable: true
216
+ });
217
+ }
218
+ function copy(v) {
219
+ if (Array.isArray(v)) return v.map(copy);
220
+ if (isPlainObject(v)) {
221
+ const out = {};
222
+ for (const k of Object.keys(v)) setOwn(out, k, copy(v[k]));
223
+ return out;
224
+ }
225
+ return v;
226
+ }
227
+ function isPlainObject(v) {
228
+ if (v === null || typeof v !== "object" || Array.isArray(v)) return false;
229
+ const proto = Object.getPrototypeOf(v);
230
+ return proto === Object.prototype || proto === null;
231
+ }
232
+ function isEnoent(err) {
233
+ return typeof err === "object" && err !== null && "code" in err && err.code === "ENOENT";
234
+ }
235
+
236
+
237
+
238
+
239
+
240
+ exports.mergeLayers = mergeLayers; exports.load = load2; exports.config_exports = config_exports;