@punks/backend-core 0.0.69 → 0.0.71

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/cjs/index.js CHANGED
@@ -188,6 +188,11 @@ const subtractTime = (date, offset) => {
188
188
  unit: offset.unit,
189
189
  });
190
190
  };
191
+ function floorDateToSecond(date) {
192
+ const flooredDate = new Date(date);
193
+ flooredDate.setMilliseconds(0);
194
+ return flooredDate;
195
+ }
191
196
 
192
197
  const DEFAULT_DELIMITER = ";";
193
198
  const splitRows = (data) => {
@@ -452,6 +457,9 @@ function serializeQueryString(obj) {
452
457
  }
453
458
  return queryString;
454
459
  }
460
+ const joinUrl = (base, path) => {
461
+ return `${base.replace(/\/$/, "")}/${path.replace(/^\//, "")}`;
462
+ };
455
463
  const buildUrl = (path, query) => {
456
464
  const queryString = serializeQueryString(query);
457
465
  return queryString ? `${path}?${queryString}` : path;
@@ -31228,6 +31236,7 @@ exports.excelBuild = excelBuild;
31228
31236
  exports.excelParse = excelParse;
31229
31237
  exports.first = first;
31230
31238
  exports.flatten = flatten;
31239
+ exports.floorDateToSecond = floorDateToSecond;
31231
31240
  exports.getDirectoryFilePaths = getDirectoryFilePaths;
31232
31241
  exports.getDirectoryPath = getDirectoryPath;
31233
31242
  exports.getQueryParameter = getQueryParameter;
@@ -31236,6 +31245,7 @@ exports.indexes = indexes;
31236
31245
  exports.isNullOrUndefined = isNullOrUndefined;
31237
31246
  exports.iterate = iterate;
31238
31247
  exports.joinPath = joinPath;
31248
+ exports.joinUrl = joinUrl;
31239
31249
  exports.jsonDistinct = jsonDistinct;
31240
31250
  exports.jsonSerialize = jsonSerialize;
31241
31251
  exports.last = last;