@kubb/ast 5.0.0-beta.91 → 5.0.0-beta.94

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.cjs CHANGED
@@ -150,29 +150,6 @@ const schemaTypes = {
150
150
  never: "never"
151
151
  };
152
152
  //#endregion
153
- //#region src/defineDialect.ts
154
- /**
155
- * Types a {@link Dialect} for an adapter. Adds no runtime behavior and only pins the
156
- * dialect's type for inference.
157
- *
158
- * @example
159
- * ```ts
160
- * export const oasDialect = defineDialect({
161
- * name: 'oas',
162
- * schema: {
163
- * isNullable,
164
- * isReference,
165
- * isDiscriminator,
166
- * isBinary: (schema) => schema.type === 'string' && schema.contentMediaType === 'application/octet-stream',
167
- * resolveRef,
168
- * },
169
- * })
170
- * ```
171
- */
172
- function defineDialect(dialect) {
173
- return dialect;
174
- }
175
- //#endregion
176
153
  //#region src/guards.ts
177
154
  /**
178
155
  * Narrows a `SchemaNode` to the variant that matches `type`.
@@ -1172,10 +1149,11 @@ function transformChildren(node, visitor, recurse) {
1172
1149
  if (next !== value) (updates ??= {})[key] = next;
1173
1150
  }
1174
1151
  }
1175
- return updates ? {
1152
+ if (!updates) return node;
1153
+ return {
1176
1154
  ...node,
1177
1155
  ...updates
1178
- } : node;
1156
+ };
1179
1157
  }
1180
1158
  /**
1181
1159
  * Lazy depth-first collection pass. Yields every non-null value returned by
@@ -1442,7 +1420,7 @@ function extractRefName(ref) {
1442
1420
  */
1443
1421
  function resolveRefName(node) {
1444
1422
  if (!node || node.type !== "ref") return null;
1445
- if (node.ref) return extractRefName(node.ref) ?? node.name ?? node.schema?.name ?? null;
1423
+ if (node.ref) return extractRefName(node.ref);
1446
1424
  return node.name ?? node.schema?.name ?? null;
1447
1425
  }
1448
1426
  /**
@@ -1498,7 +1476,7 @@ function syncSchemaRef(node) {
1498
1476
  });
1499
1477
  }
1500
1478
  /**
1501
- * Type guard that returns `true` when a schema emits as a plain `string` type.
1479
+ * Returns `true` when a schema emits as a plain `string` type.
1502
1480
  *
1503
1481
  * Covers `string`, `uuid`, `email`, `url`, and `datetime` types. For `date` and `time`
1504
1482
  * types, returns `true` only when `representation` is `'string'` rather than `'date'`.
@@ -1874,7 +1852,6 @@ var exports_exports = /* @__PURE__ */ __exportAll({
1874
1852
  containsCircularRef: () => containsCircularRef,
1875
1853
  contentDef: () => contentDef,
1876
1854
  createPrinter: () => createPrinter,
1877
- defineDialect: () => defineDialect,
1878
1855
  defineMacro: () => defineMacro,
1879
1856
  defineNode: () => defineNode,
1880
1857
  enumPropName: () => enumPropName,
@@ -1935,7 +1912,6 @@ exports.constDef = constDef;
1935
1912
  exports.containsCircularRef = containsCircularRef;
1936
1913
  exports.contentDef = contentDef;
1937
1914
  exports.createPrinter = createPrinter;
1938
- exports.defineDialect = defineDialect;
1939
1915
  exports.defineMacro = defineMacro;
1940
1916
  exports.defineNode = defineNode;
1941
1917
  exports.enumPropName = enumPropName;