@workos/oagen 0.22.0 → 0.22.2

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.
@@ -4758,7 +4758,7 @@ async function writeFiles(files, outputDir, options) {
4758
4758
  }
4759
4759
  const adapter = language ? getMergeAdapter(language) : void 0;
4760
4760
  if (adapter?.testFilePatterns ? adapter.testFilePatterns.some((p) => p.test(file.path)) : isDefaultTestFile(file.path)) {
4761
- if (!(header && existingContent.startsWith(header))) {
4761
+ if (!(header && existingContent.startsWith(header)) && !file.overwriteExisting) {
4762
4762
  result.skipped.push(file.path);
4763
4763
  continue;
4764
4764
  }
@@ -4926,7 +4926,8 @@ async function overwriteWithPreservedRegions(existingContent, generatedContent,
4926
4926
  const info = className ? effectiveClassEndLines.get(className) : void 0;
4927
4927
  for (const entry of classBlocks) {
4928
4928
  let insertLine;
4929
- if (entry.anchor && !entry.anchor.includes("@oagen-ignore") && /[a-zA-Z]|^\/\*|^\/\//.test(entry.anchor)) {
4929
+ const isAmbiguousAnchor = /^end[;)\s]*$/.test(entry.anchor);
4930
+ if (entry.anchor && !entry.anchor.includes("@oagen-ignore") && !isAmbiguousAnchor && /[a-zA-Z]|^\/\*|^\/\//.test(entry.anchor)) {
4930
4931
  for (let li = 0; li < result.length; li++) if (result[li].trimStart() === entry.anchor) {
4931
4932
  insertLine = li;
4932
4933
  break;