@kubb/core 1.13.0-canary.20231018T144635 → 1.13.0-canary.20231018T171206

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/dist/index.d.cts CHANGED
@@ -521,6 +521,11 @@ type KubbConfig = {
521
521
  * the defined root option.
522
522
  */
523
523
  path: string;
524
+ } | {
525
+ /**
526
+ * String or object containing the data that you would normally import.
527
+ */
528
+ data: string | unknown;
524
529
  };
525
530
  output: {
526
531
  /**
package/dist/index.d.ts CHANGED
@@ -521,6 +521,11 @@ type KubbConfig = {
521
521
  * the defined root option.
522
522
  */
523
523
  path: string;
524
+ } | {
525
+ /**
526
+ * String or object containing the data that you would normally import.
527
+ */
528
+ data: string | unknown;
524
529
  };
525
530
  output: {
526
531
  /**
package/dist/index.js CHANGED
@@ -763,7 +763,7 @@ var FunctionParams = class {
763
763
  acc.push(`${type}${rest.default ? ` = ${rest.default}` : ""}`);
764
764
  return acc;
765
765
  }
766
- const parameterName = camelCase(name, { delimiter: "", transform: camelCaseTransformMerge });
766
+ const parameterName = name.startsWith("{") ? name : camelCase(name, { delimiter: "", transform: camelCaseTransformMerge });
767
767
  if (type) {
768
768
  if (required) {
769
769
  acc.push(`${parameterName}: ${type}${rest.default ? ` = ${rest.default}` : ""}`);
@@ -1571,16 +1571,18 @@ async function transformReducer(_previousCode, result, _plugin) {
1571
1571
  async function build(options) {
1572
1572
  const { config, logLevel, logger = createLogger() } = options;
1573
1573
  try {
1574
- if (!URLPath.isURL(config.input.path)) {
1574
+ if ("path" in config.input && !URLPath.isURL(config.input.path)) {
1575
1575
  await read(config.input.path);
1576
1576
  }
1577
1577
  } catch (e) {
1578
- throw new Error(
1579
- "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc3.dim(config.input.path),
1580
- {
1581
- cause: e
1582
- }
1583
- );
1578
+ if ("path" in config.input) {
1579
+ throw new Error(
1580
+ "Cannot read file/URL defined in `input.path` or set with `kubb generate PATH` in the CLI of your Kubb config " + pc3.dim(config.input.path),
1581
+ {
1582
+ cause: e
1583
+ }
1584
+ );
1585
+ }
1584
1586
  }
1585
1587
  if (config.output.clean) {
1586
1588
  await clean(config.output.path);