ovr 7.0.0-next.3 → 7.0.0-next.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # ovr
2
2
 
3
+ ## 7.0.0-next.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 554b09d: A field's description joined with more, such as a date's format, always ends as a sentence, whether or not the description has its own period.
8
+
3
9
  ## 7.0.0-next.3
4
10
 
5
11
  ### Patch Changes
@@ -198,8 +198,8 @@ export declare class Time {
198
198
  export declare class Prose {
199
199
  /**
200
200
  * Joins parts of a description into sentences. A part without its own
201
- * end gets a period before the next, and when any part ends as a
202
- * sentence, so does the whole.
201
+ * end gets a period before the next, and parts joined end as a sentence.
202
+ * A single part is kept as written.
203
203
  *
204
204
  * @param parts Parts, empty ones skipped
205
205
  * @returns The description, or an empty string
@@ -337,8 +337,8 @@ export class Time {
337
337
  export class Prose {
338
338
  /**
339
339
  * Joins parts of a description into sentences. A part without its own
340
- * end gets a period before the next, and when any part ends as a
341
- * sentence, so does the whole.
340
+ * end gets a period before the next, and parts joined end as a sentence.
341
+ * A single part is kept as written.
342
342
  *
343
343
  * @param parts Parts, empty ones skipped
344
344
  * @returns The description, or an empty string
@@ -347,7 +347,7 @@ export class Prose {
347
347
  const given = parts.filter((part) => Boolean(part));
348
348
  const ended = (part) => /[.!?]$/.test(part);
349
349
  let joined = given.reduce((text, part) => text ? `${text}${ended(text) ? "" : "."} ${part}` : part, "");
350
- if (given.some(ended) && !ended(joined))
350
+ if (given.length > 1 && !ended(joined))
351
351
  joined += ".";
352
352
  return joined;
353
353
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ovr",
3
3
  "description": "Web apps anyone can use. Each route serves people a page and agents Markdown and MCP tools, with forms, Postgres, and passkey sign-in built in.",
4
- "version": "7.0.0-next.3",
4
+ "version": "7.0.0-next.4",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
package/src/util/index.ts CHANGED
@@ -400,8 +400,8 @@ export class Time {
400
400
  export class Prose {
401
401
  /**
402
402
  * Joins parts of a description into sentences. A part without its own
403
- * end gets a period before the next, and when any part ends as a
404
- * sentence, so does the whole.
403
+ * end gets a period before the next, and parts joined end as a sentence.
404
+ * A single part is kept as written.
405
405
  *
406
406
  * @param parts Parts, empty ones skipped
407
407
  * @returns The description, or an empty string
@@ -414,7 +414,7 @@ export class Prose {
414
414
  text ? `${text}${ended(text) ? "" : "."} ${part}` : part,
415
415
  "",
416
416
  );
417
- if (given.some(ended) && !ended(joined)) joined += ".";
417
+ if (given.length > 1 && !ended(joined)) joined += ".";
418
418
  return joined;
419
419
  }
420
420
  }