@velvetmonkey/flywheel-crank 0.9.2 → 0.10.1
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.js +40 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -146,17 +146,50 @@ function formatContent(content, format) {
|
|
|
146
146
|
switch (format) {
|
|
147
147
|
case "plain":
|
|
148
148
|
return trimmed;
|
|
149
|
-
case "bullet":
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
149
|
+
case "bullet": {
|
|
150
|
+
const lines = trimmed.split("\n");
|
|
151
|
+
return lines.map((line, i) => {
|
|
152
|
+
if (i === 0)
|
|
153
|
+
return `- ${line}`;
|
|
154
|
+
if (line === "")
|
|
155
|
+
return "";
|
|
156
|
+
return ` ${line}`;
|
|
157
|
+
}).join("\n");
|
|
158
|
+
}
|
|
159
|
+
case "task": {
|
|
160
|
+
const lines = trimmed.split("\n");
|
|
161
|
+
return lines.map((line, i) => {
|
|
162
|
+
if (i === 0)
|
|
163
|
+
return `- [ ] ${line}`;
|
|
164
|
+
if (line === "")
|
|
165
|
+
return "";
|
|
166
|
+
return ` ${line}`;
|
|
167
|
+
}).join("\n");
|
|
168
|
+
}
|
|
169
|
+
case "numbered": {
|
|
170
|
+
const lines = trimmed.split("\n");
|
|
171
|
+
return lines.map((line, i) => {
|
|
172
|
+
if (i === 0)
|
|
173
|
+
return `1. ${line}`;
|
|
174
|
+
if (line === "")
|
|
175
|
+
return "";
|
|
176
|
+
return ` ${line}`;
|
|
177
|
+
}).join("\n");
|
|
178
|
+
}
|
|
155
179
|
case "timestamp-bullet": {
|
|
156
180
|
const now = /* @__PURE__ */ new Date();
|
|
157
181
|
const hours = String(now.getHours()).padStart(2, "0");
|
|
158
182
|
const minutes = String(now.getMinutes()).padStart(2, "0");
|
|
159
|
-
|
|
183
|
+
const prefix = `- **${hours}:${minutes}** `;
|
|
184
|
+
const lines = trimmed.split("\n");
|
|
185
|
+
const indent = " ";
|
|
186
|
+
return lines.map((line, i) => {
|
|
187
|
+
if (i === 0)
|
|
188
|
+
return `${prefix}${line}`;
|
|
189
|
+
if (line === "")
|
|
190
|
+
return "";
|
|
191
|
+
return `${indent}${line}`;
|
|
192
|
+
}).join("\n");
|
|
160
193
|
}
|
|
161
194
|
default:
|
|
162
195
|
return trimmed;
|