@moshevents/copy 0.7.1 → 0.7.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.
package/lib/copy.d.ts CHANGED
@@ -72,14 +72,14 @@ export declare const copy: {
72
72
  readonly onTheList: "You're on the list";
73
73
  readonly goingRowSolo: "You're going";
74
74
  readonly goingRowOthers: (p: {
75
- count: string | number;
75
+ count: number;
76
76
  }) => string;
77
77
  readonly goingRowNamedOnly: (p: {
78
78
  names: string | number;
79
79
  }) => string;
80
80
  readonly goingRowNamed: (p: {
81
+ count: number;
81
82
  names: string | number;
82
- count: string | number;
83
83
  }) => string;
84
84
  readonly goingCount: (p: {
85
85
  count: string | number;
package/lib/copy.js CHANGED
@@ -65,9 +65,19 @@ export const copy = {
65
65
  goingCheck: "Going ✓",
66
66
  onTheList: "You're on the list",
67
67
  goingRowSolo: "You're going",
68
- goingRowOthers: (p) => `You and ${p.count} others are going`,
68
+ goingRowOthers: (p) => {
69
+ const n = Number(p.count);
70
+ if (n === 1)
71
+ return `You and ${p.count} other are going`;
72
+ return `You and ${p.count} others are going`;
73
+ },
69
74
  goingRowNamedOnly: (p) => `You, ${p.names} are going`,
70
- goingRowNamed: (p) => `You, ${p.names} and ${p.count} friends are going`,
75
+ goingRowNamed: (p) => {
76
+ const n = Number(p.count);
77
+ if (n === 1)
78
+ return `You, ${p.names} and ${p.count} friend are going`;
79
+ return `You, ${p.names} and ${p.count} friends are going`;
80
+ },
71
81
  goingCount: (p) => `${p.count} going`,
72
82
  wentCount: (p) => `${p.count} went`,
73
83
  invite: "+ Invite",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moshevents/copy",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Mosh — single source of truth for user-facing copy. Typed `copy` for web/admin; iOS consumes the SwiftPM target.",
5
5
  "type": "module",
6
6
  "files": [