@meltstudio/config-loader 3.2.0 → 3.3.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.
Files changed (2) hide show
  1. package/dist/index.js +13 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -654,6 +654,19 @@ var OptionBase = class {
654
654
  var ObjectOption = class extends OptionBase {
655
655
  item;
656
656
  constructor(params) {
657
+ if (!params.item) {
658
+ const hasOptionValues = Object.values(params).some(
659
+ (v) => v instanceof OptionBase
660
+ );
661
+ if (hasOptionValues) {
662
+ throw new Error(
663
+ "Invalid c.object() call: schema fields were passed directly instead of wrapped in { item: { ... } }. Use c.object({ item: { host: c.string() } }) instead of c.object({ host: c.string() })."
664
+ );
665
+ }
666
+ throw new Error(
667
+ "Invalid c.object() call: missing required 'item' property. Use c.object({ item: { host: c.string(), port: c.number() } })."
668
+ );
669
+ }
657
670
  super({
658
671
  kind: "object",
659
672
  env: null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meltstudio/config-loader",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "Type-safe configuration loader with full TypeScript inference. Load from YAML, JSON, .env, environment variables, and CLI args.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",