@postrun/js 2.5.0 → 2.7.0

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
@@ -6078,6 +6078,20 @@ function linkedinPollDurationLabel(value) {
6078
6078
  }
6079
6079
  }
6080
6080
 
6081
+ // src/x.ts
6082
+ function plural(n, unit) {
6083
+ return `${n} ${unit}${n === 1 ? "" : "s"} left`;
6084
+ }
6085
+ function xPollDurationLabel(durationMinutes) {
6086
+ if (durationMinutes >= 1440) {
6087
+ return plural(Math.floor(durationMinutes / 1440), "day");
6088
+ }
6089
+ if (durationMinutes >= 60) {
6090
+ return plural(Math.floor(durationMinutes / 60), "hour");
6091
+ }
6092
+ return plural(durationMinutes, "minute");
6093
+ }
6094
+
6081
6095
  // src/tiktok-options.ts
6082
6096
  var TIKTOK_CAPTION_MAX = { video: 2200, photo: 4e3 };
6083
6097
  function captionMaxFor(postType) {
@@ -6505,5 +6519,6 @@ exports.webhooksListEndpoints = webhooksListEndpoints;
6505
6519
  exports.webhooksListEventTypes = webhooksListEventTypes;
6506
6520
  exports.webhooksPing = webhooksPing;
6507
6521
  exports.webhooksUpdateEndpoint = webhooksUpdateEndpoint;
6522
+ exports.xPollDurationLabel = xPollDurationLabel;
6508
6523
  //# sourceMappingURL=index.cjs.map
6509
6524
  //# sourceMappingURL=index.cjs.map