@turndown/library 0.1.28 → 0.1.29

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
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
8
11
  var __export = (target, all) => {
9
12
  for (var name in all)
10
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -27,6 +30,366 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
27
30
  ));
28
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
32
 
33
+ // node_modules/dayjs/dayjs.min.js
34
+ var require_dayjs_min = __commonJS({
35
+ "node_modules/dayjs/dayjs.min.js"(exports2, module2) {
36
+ "use strict";
37
+ !(function(t, e) {
38
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
39
+ })(exports2, (function() {
40
+ "use strict";
41
+ var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
42
+ var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
43
+ return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
44
+ } }, m = function(t2, e2, n2) {
45
+ var r2 = String(t2);
46
+ return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
47
+ }, v = { s: m, z: function(t2) {
48
+ var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
49
+ return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
50
+ }, m: function t2(e2, n2) {
51
+ if (e2.date() < n2.date()) return -t2(n2, e2);
52
+ var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
53
+ return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
54
+ }, a: function(t2) {
55
+ return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
56
+ }, p: function(t2) {
57
+ return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
58
+ }, u: function(t2) {
59
+ return void 0 === t2;
60
+ } }, g = "en", D = {};
61
+ D[g] = M;
62
+ var p = "$isDayjsObject", S = function(t2) {
63
+ return t2 instanceof _ || !(!t2 || !t2[p]);
64
+ }, w = function t2(e2, n2, r2) {
65
+ var i2;
66
+ if (!e2) return g;
67
+ if ("string" == typeof e2) {
68
+ var s2 = e2.toLowerCase();
69
+ D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
70
+ var u2 = e2.split("-");
71
+ if (!i2 && u2.length > 1) return t2(u2[0]);
72
+ } else {
73
+ var a2 = e2.name;
74
+ D[a2] = e2, i2 = a2;
75
+ }
76
+ return !r2 && i2 && (g = i2), i2 || !r2 && g;
77
+ }, O = function(t2, e2) {
78
+ if (S(t2)) return t2.clone();
79
+ var n2 = "object" == typeof e2 ? e2 : {};
80
+ return n2.date = t2, n2.args = arguments, new _(n2);
81
+ }, b = v;
82
+ b.l = w, b.i = S, b.w = function(t2, e2) {
83
+ return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
84
+ };
85
+ var _ = (function() {
86
+ function M2(t2) {
87
+ this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
88
+ }
89
+ var m2 = M2.prototype;
90
+ return m2.parse = function(t2) {
91
+ this.$d = (function(t3) {
92
+ var e2 = t3.date, n2 = t3.utc;
93
+ if (null === e2) return /* @__PURE__ */ new Date(NaN);
94
+ if (b.u(e2)) return /* @__PURE__ */ new Date();
95
+ if (e2 instanceof Date) return new Date(e2);
96
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
97
+ var r2 = e2.match($);
98
+ if (r2) {
99
+ var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
100
+ return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
101
+ }
102
+ }
103
+ return new Date(e2);
104
+ })(t2), this.init();
105
+ }, m2.init = function() {
106
+ var t2 = this.$d;
107
+ this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
108
+ }, m2.$utils = function() {
109
+ return b;
110
+ }, m2.isValid = function() {
111
+ return !(this.$d.toString() === l);
112
+ }, m2.isSame = function(t2, e2) {
113
+ var n2 = O(t2);
114
+ return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
115
+ }, m2.isAfter = function(t2, e2) {
116
+ return O(t2) < this.startOf(e2);
117
+ }, m2.isBefore = function(t2, e2) {
118
+ return this.endOf(e2) < O(t2);
119
+ }, m2.$g = function(t2, e2, n2) {
120
+ return b.u(t2) ? this[e2] : this.set(n2, t2);
121
+ }, m2.unix = function() {
122
+ return Math.floor(this.valueOf() / 1e3);
123
+ }, m2.valueOf = function() {
124
+ return this.$d.getTime();
125
+ }, m2.startOf = function(t2, e2) {
126
+ var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
127
+ var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
128
+ return r2 ? i2 : i2.endOf(a);
129
+ }, $2 = function(t3, e3) {
130
+ return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
131
+ }, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
132
+ switch (f2) {
133
+ case h:
134
+ return r2 ? l2(1, 0) : l2(31, 11);
135
+ case c:
136
+ return r2 ? l2(1, M3) : l2(0, M3 + 1);
137
+ case o:
138
+ var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
139
+ return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
140
+ case a:
141
+ case d:
142
+ return $2(v2 + "Hours", 0);
143
+ case u:
144
+ return $2(v2 + "Minutes", 1);
145
+ case s:
146
+ return $2(v2 + "Seconds", 2);
147
+ case i:
148
+ return $2(v2 + "Milliseconds", 3);
149
+ default:
150
+ return this.clone();
151
+ }
152
+ }, m2.endOf = function(t2) {
153
+ return this.startOf(t2, false);
154
+ }, m2.$set = function(t2, e2) {
155
+ var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
156
+ if (o2 === c || o2 === h) {
157
+ var y2 = this.clone().set(d, 1);
158
+ y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
159
+ } else l2 && this.$d[l2]($2);
160
+ return this.init(), this;
161
+ }, m2.set = function(t2, e2) {
162
+ return this.clone().$set(t2, e2);
163
+ }, m2.get = function(t2) {
164
+ return this[b.p(t2)]();
165
+ }, m2.add = function(r2, f2) {
166
+ var d2, l2 = this;
167
+ r2 = Number(r2);
168
+ var $2 = b.p(f2), y2 = function(t2) {
169
+ var e2 = O(l2);
170
+ return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
171
+ };
172
+ if ($2 === c) return this.set(c, this.$M + r2);
173
+ if ($2 === h) return this.set(h, this.$y + r2);
174
+ if ($2 === a) return y2(1);
175
+ if ($2 === o) return y2(7);
176
+ var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
177
+ return b.w(m3, this);
178
+ }, m2.subtract = function(t2, e2) {
179
+ return this.add(-1 * t2, e2);
180
+ }, m2.format = function(t2) {
181
+ var e2 = this, n2 = this.$locale();
182
+ if (!this.isValid()) return n2.invalidDate || l;
183
+ var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
184
+ return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
185
+ }, d2 = function(t3) {
186
+ return b.s(s2 % 12 || 12, t3, "0");
187
+ }, $2 = f2 || function(t3, e3, n3) {
188
+ var r3 = t3 < 12 ? "AM" : "PM";
189
+ return n3 ? r3.toLowerCase() : r3;
190
+ };
191
+ return r2.replace(y, (function(t3, r3) {
192
+ return r3 || (function(t4) {
193
+ switch (t4) {
194
+ case "YY":
195
+ return String(e2.$y).slice(-2);
196
+ case "YYYY":
197
+ return b.s(e2.$y, 4, "0");
198
+ case "M":
199
+ return a2 + 1;
200
+ case "MM":
201
+ return b.s(a2 + 1, 2, "0");
202
+ case "MMM":
203
+ return h2(n2.monthsShort, a2, c2, 3);
204
+ case "MMMM":
205
+ return h2(c2, a2);
206
+ case "D":
207
+ return e2.$D;
208
+ case "DD":
209
+ return b.s(e2.$D, 2, "0");
210
+ case "d":
211
+ return String(e2.$W);
212
+ case "dd":
213
+ return h2(n2.weekdaysMin, e2.$W, o2, 2);
214
+ case "ddd":
215
+ return h2(n2.weekdaysShort, e2.$W, o2, 3);
216
+ case "dddd":
217
+ return o2[e2.$W];
218
+ case "H":
219
+ return String(s2);
220
+ case "HH":
221
+ return b.s(s2, 2, "0");
222
+ case "h":
223
+ return d2(1);
224
+ case "hh":
225
+ return d2(2);
226
+ case "a":
227
+ return $2(s2, u2, true);
228
+ case "A":
229
+ return $2(s2, u2, false);
230
+ case "m":
231
+ return String(u2);
232
+ case "mm":
233
+ return b.s(u2, 2, "0");
234
+ case "s":
235
+ return String(e2.$s);
236
+ case "ss":
237
+ return b.s(e2.$s, 2, "0");
238
+ case "SSS":
239
+ return b.s(e2.$ms, 3, "0");
240
+ case "Z":
241
+ return i2;
242
+ }
243
+ return null;
244
+ })(t3) || i2.replace(":", "");
245
+ }));
246
+ }, m2.utcOffset = function() {
247
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
248
+ }, m2.diff = function(r2, d2, l2) {
249
+ var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
250
+ return b.m(y2, m3);
251
+ };
252
+ switch (M3) {
253
+ case h:
254
+ $2 = D2() / 12;
255
+ break;
256
+ case c:
257
+ $2 = D2();
258
+ break;
259
+ case f:
260
+ $2 = D2() / 3;
261
+ break;
262
+ case o:
263
+ $2 = (g2 - v2) / 6048e5;
264
+ break;
265
+ case a:
266
+ $2 = (g2 - v2) / 864e5;
267
+ break;
268
+ case u:
269
+ $2 = g2 / n;
270
+ break;
271
+ case s:
272
+ $2 = g2 / e;
273
+ break;
274
+ case i:
275
+ $2 = g2 / t;
276
+ break;
277
+ default:
278
+ $2 = g2;
279
+ }
280
+ return l2 ? $2 : b.a($2);
281
+ }, m2.daysInMonth = function() {
282
+ return this.endOf(c).$D;
283
+ }, m2.$locale = function() {
284
+ return D[this.$L];
285
+ }, m2.locale = function(t2, e2) {
286
+ if (!t2) return this.$L;
287
+ var n2 = this.clone(), r2 = w(t2, e2, true);
288
+ return r2 && (n2.$L = r2), n2;
289
+ }, m2.clone = function() {
290
+ return b.w(this.$d, this);
291
+ }, m2.toDate = function() {
292
+ return new Date(this.valueOf());
293
+ }, m2.toJSON = function() {
294
+ return this.isValid() ? this.toISOString() : null;
295
+ }, m2.toISOString = function() {
296
+ return this.$d.toISOString();
297
+ }, m2.toString = function() {
298
+ return this.$d.toUTCString();
299
+ }, M2;
300
+ })(), k = _.prototype;
301
+ return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
302
+ k[t2[1]] = function(e2) {
303
+ return this.$g(e2, t2[0], t2[1]);
304
+ };
305
+ })), O.extend = function(t2, e2) {
306
+ return t2.$i || (t2(e2, _, O), t2.$i = true), O;
307
+ }, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
308
+ return O(1e3 * t2);
309
+ }, O.en = D[g], O.Ls = D, O.p = {}, O;
310
+ }));
311
+ }
312
+ });
313
+
314
+ // node_modules/dayjs/plugin/isoWeek.js
315
+ var require_isoWeek = __commonJS({
316
+ "node_modules/dayjs/plugin/isoWeek.js"(exports2, module2) {
317
+ "use strict";
318
+ !(function(e, t) {
319
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_isoWeek = t();
320
+ })(exports2, (function() {
321
+ "use strict";
322
+ var e = "day";
323
+ return function(t, i, s) {
324
+ var a = function(t2) {
325
+ return t2.add(4 - t2.isoWeekday(), e);
326
+ }, d = i.prototype;
327
+ d.isoWeekYear = function() {
328
+ return a(this).year();
329
+ }, d.isoWeek = function(t2) {
330
+ if (!this.$utils().u(t2)) return this.add(7 * (t2 - this.isoWeek()), e);
331
+ var i2, d2, n2, o, r = a(this), u = (i2 = this.isoWeekYear(), d2 = this.$u, n2 = (d2 ? s.utc : s)().year(i2).startOf("year"), o = 4 - n2.isoWeekday(), n2.isoWeekday() > 4 && (o += 7), n2.add(o, e));
332
+ return r.diff(u, "week") + 1;
333
+ }, d.isoWeekday = function(e2) {
334
+ return this.$utils().u(e2) ? this.day() || 7 : this.day(this.day() % 7 ? e2 : e2 - 7);
335
+ };
336
+ var n = d.startOf;
337
+ d.startOf = function(e2, t2) {
338
+ var i2 = this.$utils(), s2 = !!i2.u(t2) || t2;
339
+ return "isoweek" === i2.p(e2) ? s2 ? this.date(this.date() - (this.isoWeekday() - 1)).startOf("day") : this.date(this.date() - 1 - (this.isoWeekday() - 1) + 7).endOf("day") : n.bind(this)(e2, t2);
340
+ };
341
+ };
342
+ }));
343
+ }
344
+ });
345
+
346
+ // node_modules/dayjs/plugin/relativeTime.js
347
+ var require_relativeTime = __commonJS({
348
+ "node_modules/dayjs/plugin/relativeTime.js"(exports2, module2) {
349
+ "use strict";
350
+ !(function(r, e) {
351
+ "object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (r = "undefined" != typeof globalThis ? globalThis : r || self).dayjs_plugin_relativeTime = e();
352
+ })(exports2, (function() {
353
+ "use strict";
354
+ return function(r, e, t) {
355
+ r = r || {};
356
+ var n = e.prototype, o = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
357
+ function i(r2, e2, t2, o2) {
358
+ return n.fromToBase(r2, e2, t2, o2);
359
+ }
360
+ t.en.relativeTime = o, n.fromToBase = function(e2, n2, i2, d2, u) {
361
+ for (var f, a, s, l = i2.$locale().relativeTime || o, h = r.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], m = h.length, c = 0; c < m; c += 1) {
362
+ var y = h[c];
363
+ y.d && (f = d2 ? t(e2).diff(i2, y.d, true) : i2.diff(e2, y.d, true));
364
+ var p = (r.rounding || Math.round)(Math.abs(f));
365
+ if (s = f > 0, p <= y.r || !y.r) {
366
+ p <= 1 && c > 0 && (y = h[c - 1]);
367
+ var v = l[y.l];
368
+ u && (p = u("" + p)), a = "string" == typeof v ? v.replace("%d", p) : v(p, n2, y.l, s);
369
+ break;
370
+ }
371
+ }
372
+ if (n2) return a;
373
+ var M = s ? l.future : l.past;
374
+ return "function" == typeof M ? M(a) : M.replace("%s", a);
375
+ }, n.to = function(r2, e2) {
376
+ return i(r2, e2, this, true);
377
+ }, n.from = function(r2, e2) {
378
+ return i(r2, e2, this);
379
+ };
380
+ var d = function(r2) {
381
+ return r2.$u ? t.utc() : t();
382
+ };
383
+ n.toNow = function(r2) {
384
+ return this.to(d(this), r2);
385
+ }, n.fromNow = function(r2) {
386
+ return this.from(d(this), r2);
387
+ };
388
+ };
389
+ }));
390
+ }
391
+ });
392
+
30
393
  // src/index.ts
31
394
  var index_exports = {};
32
395
  __export(index_exports, {
@@ -163,9 +526,9 @@ __export(index_exports, {
163
526
  module.exports = __toCommonJS(index_exports);
164
527
 
165
528
  // src/helpers/date/index.ts
166
- var import_dayjs = __toESM(require("dayjs"), 1);
167
- var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"), 1);
168
- var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"), 1);
529
+ var import_dayjs = __toESM(require_dayjs_min(), 1);
530
+ var import_isoWeek = __toESM(require_isoWeek(), 1);
531
+ var import_relativeTime = __toESM(require_relativeTime(), 1);
169
532
  import_dayjs.default.extend(import_relativeTime.default);
170
533
  import_dayjs.default.extend(import_isoWeek.default);
171
534
  var defaultDateFallback = "--";
@@ -1353,3 +1716,4 @@ var CHECKLIST_EXECUTION_STATUS = {
1353
1716
  validPath,
1354
1717
  wordCount
1355
1718
  });
1719
+ //# sourceMappingURL=index.cjs.map