@catbee/utils 2.0.0-next.1 → 2.0.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.
Files changed (87) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +55 -38
  3. package/array/index.cjs +37 -5
  4. package/array/index.d.ts +59 -8
  5. package/array/index.mjs +32 -4
  6. package/async/index.cjs +24 -3
  7. package/async/index.d.ts +18 -2
  8. package/async/index.mjs +24 -4
  9. package/cache/index.cjs +1 -1
  10. package/cache/index.d.ts +1 -1
  11. package/cache/index.mjs +1 -1
  12. package/config/index.cjs +8 -8
  13. package/config/index.d.ts +1 -1
  14. package/config/index.mjs +4 -4
  15. package/context-store/index.cjs +2 -3
  16. package/context-store/index.d.ts +1 -1
  17. package/context-store/index.mjs +2 -3
  18. package/crypto/index.cjs +55 -5
  19. package/crypto/index.d.ts +63 -2
  20. package/crypto/index.mjs +52 -7
  21. package/date/index.cjs +630 -1
  22. package/date/index.d.ts +487 -2
  23. package/date/index.mjs +621 -2
  24. package/{decorators → decorator}/index.cjs +425 -304
  25. package/{decorators → decorator}/index.d.ts +3 -2
  26. package/{decorators → decorator}/index.mjs +425 -304
  27. package/{dir → directory}/index.cjs +1 -1
  28. package/{dir → directory}/index.d.ts +1 -1
  29. package/{dir → directory}/index.mjs +1 -1
  30. package/env/index.cjs +90 -42
  31. package/env/index.d.ts +12 -1
  32. package/env/index.mjs +90 -42
  33. package/exception/index.cjs +1 -1
  34. package/exception/index.d.ts +1 -1
  35. package/exception/index.mjs +1 -1
  36. package/fs/index.cjs +1 -1
  37. package/fs/index.d.ts +1 -1
  38. package/fs/index.mjs +1 -1
  39. package/http-status-codes/index.cjs +1 -1
  40. package/http-status-codes/index.d.ts +1 -1
  41. package/http-status-codes/index.mjs +1 -1
  42. package/id/index.cjs +1 -1
  43. package/id/index.d.ts +1 -1
  44. package/id/index.mjs +1 -1
  45. package/index.cjs +10 -10
  46. package/index.d.ts +4 -4
  47. package/index.mjs +4 -4
  48. package/logger/index.cjs +2 -4
  49. package/logger/index.d.ts +2 -2
  50. package/logger/index.mjs +2 -4
  51. package/middleware/index.cjs +1 -1
  52. package/middleware/index.d.ts +1 -1
  53. package/middleware/index.mjs +1 -1
  54. package/{obj → object}/index.cjs +182 -108
  55. package/{obj → object}/index.d.ts +38 -2
  56. package/{obj → object}/index.mjs +180 -109
  57. package/package.json +31 -13
  58. package/performance/index.cjs +2 -2
  59. package/performance/index.d.ts +1 -1
  60. package/performance/index.mjs +2 -2
  61. package/request/index.cjs +36 -24
  62. package/request/index.d.ts +1 -1
  63. package/request/index.mjs +36 -24
  64. package/response/index.cjs +1 -1
  65. package/response/index.d.ts +1 -1
  66. package/response/index.mjs +1 -1
  67. package/server/index.cjs +233 -131
  68. package/server/index.d.ts +81 -1
  69. package/server/index.mjs +229 -127
  70. package/stream/index.cjs +1 -1
  71. package/stream/index.d.ts +1 -1
  72. package/stream/index.mjs +1 -1
  73. package/string/index.cjs +34 -1
  74. package/string/index.d.ts +45 -2
  75. package/string/index.mjs +31 -2
  76. package/type/index.cjs +18 -1
  77. package/type/index.d.ts +38 -2
  78. package/type/index.mjs +16 -2
  79. package/types/index.cjs +1 -1
  80. package/types/index.d.ts +10 -3
  81. package/types/index.mjs +1 -1
  82. package/url/index.cjs +61 -1
  83. package/url/index.d.ts +59 -2
  84. package/url/index.mjs +57 -2
  85. package/validation/index.cjs +3 -3
  86. package/validation/index.d.ts +1 -1
  87. package/validation/index.mjs +3 -3
package/date/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * The MIT License
3
3
  *
4
- * Copyright (c) 2025 Catbee Technologies. https://catbee.in/license
4
+ * Copyright (c) 2026 Catbee Technologies. https://catbee.in/license
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  * of this software and associated documentation files (the "Software"), to deal
@@ -324,8 +324,631 @@ function getDateFromDuration(input) {
324
324
  return new Date(Date.now() + ms);
325
325
  }
326
326
  __name(getDateFromDuration, "getDateFromDuration");
327
+ function isWeekend(date) {
328
+ const d = date instanceof Date ? date : new Date(date);
329
+ const day = d.getDay();
330
+ return day === 0 || day === 6;
331
+ }
332
+ __name(isWeekend, "isWeekend");
333
+ function isToday(date) {
334
+ const d = date instanceof Date ? date : new Date(date);
335
+ const today = /* @__PURE__ */ new Date();
336
+ return d.getFullYear() === today.getFullYear() && d.getMonth() === today.getMonth() && d.getDate() === today.getDate();
337
+ }
338
+ __name(isToday, "isToday");
339
+ function isFuture(date) {
340
+ const d = date instanceof Date ? date : new Date(date);
341
+ return d.getTime() > Date.now();
342
+ }
343
+ __name(isFuture, "isFuture");
344
+ function isPast(date) {
345
+ const d = date instanceof Date ? date : new Date(date);
346
+ return d.getTime() < Date.now();
347
+ }
348
+ __name(isPast, "isPast");
349
+ function addDays(date, days) {
350
+ const d = new Date(date instanceof Date ? date : new Date(date));
351
+ d.setDate(d.getDate() + days);
352
+ return d;
353
+ }
354
+ __name(addDays, "addDays");
355
+ function addMonths(date, months) {
356
+ const d = new Date(date instanceof Date ? date : new Date(date));
357
+ d.setMonth(d.getMonth() + months);
358
+ return d;
359
+ }
360
+ __name(addMonths, "addMonths");
361
+ function addYears(date, years) {
362
+ const d = new Date(date instanceof Date ? date : new Date(date));
363
+ d.setFullYear(d.getFullYear() + years);
364
+ return d;
365
+ }
366
+ __name(addYears, "addYears");
367
+ function quarterOf(date) {
368
+ const d = date instanceof Date ? date : new Date(date);
369
+ return Math.floor(d.getMonth() / 3) + 1;
370
+ }
371
+ __name(quarterOf, "quarterOf");
372
+ function weekOfYear(date) {
373
+ const d = new Date(date instanceof Date ? date : new Date(date));
374
+ d.setHours(0, 0, 0, 0);
375
+ d.setDate(d.getDate() + 4 - (d.getDay() || 7));
376
+ const yearStart = new Date(d.getFullYear(), 0, 1);
377
+ return Math.ceil(((d.getTime() - yearStart.getTime()) / 864e5 + 1) / 7);
378
+ }
379
+ __name(weekOfYear, "weekOfYear");
380
+
381
+ // src/date/date.builder.ts
382
+ var DateBuilder = class _DateBuilder {
383
+ static {
384
+ __name(this, "DateBuilder");
385
+ }
386
+ date;
387
+ /**
388
+ * Creates a new DateBuilder instance.
389
+ * @param date - Initial date (default: current date/time)
390
+ */
391
+ constructor(date) {
392
+ if (date === void 0) {
393
+ this.date = /* @__PURE__ */ new Date();
394
+ } else if (date instanceof Date) {
395
+ this.date = new Date(date);
396
+ } else if (typeof date === "number") {
397
+ this.date = new Date(date);
398
+ } else {
399
+ this.date = new Date(date);
400
+ }
401
+ }
402
+ /**
403
+ * Create a DateBuilder from an existing date.
404
+ * @param date - Date to build from
405
+ */
406
+ static from(date) {
407
+ return new _DateBuilder(date);
408
+ }
409
+ /**
410
+ * Create a DateBuilder for the current moment.
411
+ */
412
+ static now() {
413
+ return new _DateBuilder();
414
+ }
415
+ /**
416
+ * Create a DateBuilder for a specific date.
417
+ * @param year - Year
418
+ * @param month - Month (1-12, not 0-11)
419
+ * @param day - Day of month
420
+ * @param hour - Hour (default: 0)
421
+ * @param minute - Minute (default: 0)
422
+ * @param second - Second (default: 0)
423
+ * @param millisecond - Millisecond (default: 0)
424
+ */
425
+ static of(year, month, day, hour = 0, minute = 0, second = 0, millisecond = 0) {
426
+ const d = new Date(year, month - 1, day, hour, minute, second, millisecond);
427
+ return new _DateBuilder(d);
428
+ }
429
+ /**
430
+ * Parse a date string into a DateBuilder.
431
+ * @param dateString - Date string to parse
432
+ */
433
+ static parse(dateString) {
434
+ return new _DateBuilder(new Date(dateString));
435
+ }
436
+ /**
437
+ * Create a DateBuilder from a duration string (e.g., "5m", "2h", "1d" from now).
438
+ * @param duration - Duration string
439
+ */
440
+ static fromDuration(duration) {
441
+ return new _DateBuilder(getDateFromDuration(duration));
442
+ }
443
+ /**
444
+ * Clone this DateBuilder instance.
445
+ */
446
+ clone() {
447
+ return new _DateBuilder(this.date);
448
+ }
449
+ // ========== Setters (return new instance) ==========
450
+ /**
451
+ * Set the year.
452
+ * @param year - Year to set
453
+ */
454
+ year(year) {
455
+ const newDate = new Date(this.date);
456
+ newDate.setFullYear(year);
457
+ return new _DateBuilder(newDate);
458
+ }
459
+ /**
460
+ * Set the month (1-12, not 0-11).
461
+ * @param month - Month to set (1-12)
462
+ */
463
+ month(month) {
464
+ const newDate = new Date(this.date);
465
+ newDate.setMonth(month - 1);
466
+ return new _DateBuilder(newDate);
467
+ }
468
+ /**
469
+ * Set the day of the month.
470
+ * @param day - Day to set
471
+ */
472
+ day(day) {
473
+ const newDate = new Date(this.date);
474
+ newDate.setDate(day);
475
+ return new _DateBuilder(newDate);
476
+ }
477
+ /**
478
+ * Set the hour.
479
+ * @param hour - Hour to set
480
+ */
481
+ hour(hour) {
482
+ const newDate = new Date(this.date);
483
+ newDate.setHours(hour);
484
+ return new _DateBuilder(newDate);
485
+ }
486
+ /**
487
+ * Set the minute.
488
+ * @param minute - Minute to set
489
+ */
490
+ minute(minute) {
491
+ const newDate = new Date(this.date);
492
+ newDate.setMinutes(minute);
493
+ return new _DateBuilder(newDate);
494
+ }
495
+ /**
496
+ * Set the second.
497
+ * @param second - Second to set
498
+ */
499
+ second(second) {
500
+ const newDate = new Date(this.date);
501
+ newDate.setSeconds(second);
502
+ return new _DateBuilder(newDate);
503
+ }
504
+ /**
505
+ * Set the millisecond.
506
+ * @param millisecond - Millisecond to set
507
+ */
508
+ millisecond(millisecond) {
509
+ const newDate = new Date(this.date);
510
+ newDate.setMilliseconds(millisecond);
511
+ return new _DateBuilder(newDate);
512
+ }
513
+ // ========== Addition/Subtraction Methods ==========
514
+ /**
515
+ * Add years to the date.
516
+ * @param years - Number of years to add (can be negative)
517
+ */
518
+ addYears(years) {
519
+ return new _DateBuilder(addToDate(this.date, years, "years"));
520
+ }
521
+ /**
522
+ * Add months to the date.
523
+ * @param months - Number of months to add (can be negative)
524
+ */
525
+ addMonths(months) {
526
+ return new _DateBuilder(addToDate(this.date, months, "months"));
527
+ }
528
+ /**
529
+ * Add days to the date.
530
+ * @param days - Number of days to add (can be negative)
531
+ */
532
+ addDays(days) {
533
+ return new _DateBuilder(addToDate(this.date, days, "days"));
534
+ }
535
+ /**
536
+ * Add hours to the date.
537
+ * @param hours - Number of hours to add (can be negative)
538
+ */
539
+ addHours(hours) {
540
+ return new _DateBuilder(addToDate(this.date, hours, "hours"));
541
+ }
542
+ /**
543
+ * Add minutes to the date.
544
+ * @param minutes - Number of minutes to add (can be negative)
545
+ */
546
+ addMinutes(minutes) {
547
+ return new _DateBuilder(addToDate(this.date, minutes, "minutes"));
548
+ }
549
+ /**
550
+ * Add seconds to the date.
551
+ * @param seconds - Number of seconds to add (can be negative)
552
+ */
553
+ addSeconds(seconds) {
554
+ return new _DateBuilder(addToDate(this.date, seconds, "seconds"));
555
+ }
556
+ /**
557
+ * Add milliseconds to the date.
558
+ * @param milliseconds - Number of milliseconds to add (can be negative)
559
+ */
560
+ addMilliseconds(milliseconds) {
561
+ return new _DateBuilder(addToDate(this.date, milliseconds, "milliseconds"));
562
+ }
563
+ /**
564
+ * Subtract years from the date.
565
+ * @param years - Number of years to subtract
566
+ */
567
+ subtractYears(years) {
568
+ return this.addYears(-years);
569
+ }
570
+ /**
571
+ * Subtract months from the date.
572
+ * @param months - Number of months to subtract
573
+ */
574
+ subtractMonths(months) {
575
+ return this.addMonths(-months);
576
+ }
577
+ /**
578
+ * Subtract days from the date.
579
+ * @param days - Number of days to subtract
580
+ */
581
+ subtractDays(days) {
582
+ return this.addDays(-days);
583
+ }
584
+ /**
585
+ * Subtract hours from the date.
586
+ * @param hours - Number of hours to subtract
587
+ */
588
+ subtractHours(hours) {
589
+ return this.addHours(-hours);
590
+ }
591
+ /**
592
+ * Subtract minutes from the date.
593
+ * @param minutes - Number of minutes to subtract
594
+ */
595
+ subtractMinutes(minutes) {
596
+ return this.addMinutes(-minutes);
597
+ }
598
+ /**
599
+ * Subtract seconds from the date.
600
+ * @param seconds - Number of seconds to subtract
601
+ */
602
+ subtractSeconds(seconds) {
603
+ return this.addSeconds(-seconds);
604
+ }
605
+ // ========== Start/End of Period Methods ==========
606
+ /**
607
+ * Set to the start of the second.
608
+ */
609
+ startOfSecond() {
610
+ return new _DateBuilder(startOf(this.date, "second"));
611
+ }
612
+ /**
613
+ * Set to the start of the minute.
614
+ */
615
+ startOfMinute() {
616
+ return new _DateBuilder(startOf(this.date, "minute"));
617
+ }
618
+ /**
619
+ * Set to the start of the hour.
620
+ */
621
+ startOfHour() {
622
+ return new _DateBuilder(startOf(this.date, "hour"));
623
+ }
624
+ /**
625
+ * Set to the start of the day (midnight).
626
+ */
627
+ startOfDay() {
628
+ return new _DateBuilder(startOf(this.date, "day"));
629
+ }
630
+ /**
631
+ * Set to the start of the week (Sunday).
632
+ */
633
+ startOfWeek() {
634
+ return new _DateBuilder(startOf(this.date, "week"));
635
+ }
636
+ /**
637
+ * Set to the start of the month.
638
+ */
639
+ startOfMonth() {
640
+ return new _DateBuilder(startOf(this.date, "month"));
641
+ }
642
+ /**
643
+ * Set to the start of the quarter.
644
+ */
645
+ startOfQuarter() {
646
+ return new _DateBuilder(startOf(this.date, "quarter"));
647
+ }
648
+ /**
649
+ * Set to the start of the year.
650
+ */
651
+ startOfYear() {
652
+ return new _DateBuilder(startOf(this.date, "year"));
653
+ }
654
+ /**
655
+ * Set to the end of the second.
656
+ */
657
+ endOfSecond() {
658
+ return new _DateBuilder(endOf(this.date, "second"));
659
+ }
660
+ /**
661
+ * Set to the end of the minute.
662
+ */
663
+ endOfMinute() {
664
+ return new _DateBuilder(endOf(this.date, "minute"));
665
+ }
666
+ /**
667
+ * Set to the end of the hour.
668
+ */
669
+ endOfHour() {
670
+ return new _DateBuilder(endOf(this.date, "hour"));
671
+ }
672
+ /**
673
+ * Set to the end of the day (23:59:59.999).
674
+ */
675
+ endOfDay() {
676
+ return new _DateBuilder(endOf(this.date, "day"));
677
+ }
678
+ /**
679
+ * Set to the end of the week (Saturday).
680
+ */
681
+ endOfWeek() {
682
+ return new _DateBuilder(endOf(this.date, "week"));
683
+ }
684
+ /**
685
+ * Set to the end of the month.
686
+ */
687
+ endOfMonth() {
688
+ return new _DateBuilder(endOf(this.date, "month"));
689
+ }
690
+ /**
691
+ * Set to the end of the quarter.
692
+ */
693
+ endOfQuarter() {
694
+ return new _DateBuilder(endOf(this.date, "quarter"));
695
+ }
696
+ /**
697
+ * Set to the end of the year.
698
+ */
699
+ endOfYear() {
700
+ return new _DateBuilder(endOf(this.date, "year"));
701
+ }
702
+ // ========== Comparison Methods ==========
703
+ /**
704
+ * Check if the date is before another date.
705
+ * @param other - Date to compare with
706
+ */
707
+ isBefore(other) {
708
+ const otherDate = other instanceof _DateBuilder ? other.toDate() : other;
709
+ return this.date.getTime() < otherDate.getTime();
710
+ }
711
+ /**
712
+ * Check if the date is after another date.
713
+ * @param other - Date to compare with
714
+ */
715
+ isAfter(other) {
716
+ const otherDate = other instanceof _DateBuilder ? other.toDate() : other;
717
+ return this.date.getTime() > otherDate.getTime();
718
+ }
719
+ /**
720
+ * Check if the date is the same as another date.
721
+ * @param other - Date to compare with
722
+ */
723
+ isSame(other) {
724
+ const otherDate = other instanceof _DateBuilder ? other.toDate() : other;
725
+ return this.date.getTime() === otherDate.getTime();
726
+ }
727
+ /**
728
+ * Check if the date is between two dates.
729
+ * @param start - Start date
730
+ * @param end - End date
731
+ * @param inclusive - Whether to include boundaries
732
+ */
733
+ isBetween(start, end, inclusive = true) {
734
+ const startDate = start instanceof _DateBuilder ? start.toDate() : start;
735
+ const endDate = end instanceof _DateBuilder ? end.toDate() : end;
736
+ return isBetween(this.date, startDate, endDate, inclusive);
737
+ }
738
+ /**
739
+ * Check if the date is today.
740
+ */
741
+ isToday() {
742
+ return isToday(this.date);
743
+ }
744
+ /**
745
+ * Check if the date is in the future.
746
+ */
747
+ isFuture() {
748
+ return isFuture(this.date);
749
+ }
750
+ /**
751
+ * Check if the date is in the past.
752
+ */
753
+ isPast() {
754
+ return isPast(this.date);
755
+ }
756
+ /**
757
+ * Check if the date is on a weekend.
758
+ */
759
+ isWeekend() {
760
+ return isWeekend(this.date);
761
+ }
762
+ /**
763
+ * Check if the year is a leap year.
764
+ */
765
+ isLeapYear() {
766
+ return isLeapYear(this.date);
767
+ }
768
+ // ========== Getters ==========
769
+ /**
770
+ * Get the year.
771
+ */
772
+ getYear() {
773
+ return this.date.getFullYear();
774
+ }
775
+ /**
776
+ * Get the month (1-12, not 0-11).
777
+ */
778
+ getMonth() {
779
+ return this.date.getMonth() + 1;
780
+ }
781
+ /**
782
+ * Get the day of the month.
783
+ */
784
+ getDay() {
785
+ return this.date.getDate();
786
+ }
787
+ /**
788
+ * Get the day of the week (0-6, Sunday is 0).
789
+ */
790
+ getDayOfWeek() {
791
+ return this.date.getDay();
792
+ }
793
+ /**
794
+ * Get the hour.
795
+ */
796
+ getHour() {
797
+ return this.date.getHours();
798
+ }
799
+ /**
800
+ * Get the minute.
801
+ */
802
+ getMinute() {
803
+ return this.date.getMinutes();
804
+ }
805
+ /**
806
+ * Get the second.
807
+ */
808
+ getSecond() {
809
+ return this.date.getSeconds();
810
+ }
811
+ /**
812
+ * Get the millisecond.
813
+ */
814
+ getMillisecond() {
815
+ return this.date.getMilliseconds();
816
+ }
817
+ /**
818
+ * Get the quarter (1-4).
819
+ */
820
+ getQuarter() {
821
+ return quarterOf(this.date);
822
+ }
823
+ /**
824
+ * Get the ISO week number.
825
+ */
826
+ getWeekOfYear() {
827
+ return weekOfYear(this.date);
828
+ }
829
+ /**
830
+ * Get the number of days in the current month.
831
+ */
832
+ getDaysInMonth() {
833
+ return daysInMonth(this.date);
834
+ }
835
+ /**
836
+ * Get the Unix timestamp in milliseconds.
837
+ */
838
+ getTime() {
839
+ return this.date.getTime();
840
+ }
841
+ /**
842
+ * Get the Unix timestamp in seconds.
843
+ */
844
+ getUnixTimestamp() {
845
+ return Math.floor(this.date.getTime() / 1e3);
846
+ }
847
+ // ========== Difference Methods ==========
848
+ /**
849
+ * Calculate the difference from another date.
850
+ * @param other - Date to compare with
851
+ * @param unit - Unit of time
852
+ */
853
+ diff(other, unit = "milliseconds") {
854
+ const otherDate = other instanceof _DateBuilder ? other.toDate() : other;
855
+ return dateDiff(this.date, otherDate, unit);
856
+ }
857
+ /**
858
+ * Get the difference from now.
859
+ * @param unit - Unit of time
860
+ */
861
+ diffFromNow(unit = "milliseconds") {
862
+ return dateDiff(this.date, /* @__PURE__ */ new Date(), unit);
863
+ }
864
+ // ========== Formatting Methods ==========
865
+ /**
866
+ * Format the date.
867
+ * @param options - Formatting options
868
+ */
869
+ format(options) {
870
+ if (typeof options === "string") {
871
+ return formatDate(this.date, {
872
+ format: options
873
+ });
874
+ }
875
+ return formatDate(this.date, options);
876
+ }
877
+ /**
878
+ * Format as relative time (e.g., "5 minutes ago").
879
+ * @param locale - Locale for formatting
880
+ */
881
+ formatRelative(locale) {
882
+ return formatRelativeTime(this.date, /* @__PURE__ */ new Date(), locale);
883
+ }
884
+ /**
885
+ * Format as ISO 8601 string.
886
+ */
887
+ toISOString() {
888
+ return this.date.toISOString();
889
+ }
890
+ /**
891
+ * Format as UTC string.
892
+ */
893
+ toUTCString() {
894
+ return this.date.toUTCString();
895
+ }
896
+ /**
897
+ * Format as date string.
898
+ */
899
+ toDateString() {
900
+ return this.date.toDateString();
901
+ }
902
+ /**
903
+ * Format as time string.
904
+ */
905
+ toTimeString() {
906
+ return this.date.toTimeString();
907
+ }
908
+ /**
909
+ * Format as locale string.
910
+ */
911
+ toLocaleString(locales, options) {
912
+ return this.date.toLocaleString(locales, options);
913
+ }
914
+ /**
915
+ * Convert to JSON string.
916
+ */
917
+ toJSON() {
918
+ return this.date.toJSON();
919
+ }
920
+ // ========== Conversion Methods ==========
921
+ /**
922
+ * Build and return the Date object.
923
+ */
924
+ build() {
925
+ return new Date(this.date);
926
+ }
927
+ /**
928
+ * Get the Date object (alias for build).
929
+ */
930
+ toDate() {
931
+ return new Date(this.date);
932
+ }
933
+ /**
934
+ * Get the internal Date object value.
935
+ */
936
+ valueOf() {
937
+ return this.date.valueOf();
938
+ }
939
+ /**
940
+ * Convert to string.
941
+ */
942
+ toString() {
943
+ return this.date.toString();
944
+ }
945
+ };
327
946
 
947
+ exports.DateBuilder = DateBuilder;
948
+ exports.addDays = addDays;
949
+ exports.addMonths = addMonths;
328
950
  exports.addToDate = addToDate;
951
+ exports.addYears = addYears;
329
952
  exports.dateDiff = dateDiff;
330
953
  exports.daysInMonth = daysInMonth;
331
954
  exports.endOf = endOf;
@@ -334,7 +957,13 @@ exports.formatDuration = formatDuration;
334
957
  exports.formatRelativeTime = formatRelativeTime;
335
958
  exports.getDateFromDuration = getDateFromDuration;
336
959
  exports.isBetween = isBetween;
960
+ exports.isFuture = isFuture;
337
961
  exports.isLeapYear = isLeapYear;
962
+ exports.isPast = isPast;
963
+ exports.isToday = isToday;
964
+ exports.isWeekend = isWeekend;
338
965
  exports.parseDate = parseDate;
339
966
  exports.parseDuration = parseDuration;
967
+ exports.quarterOf = quarterOf;
340
968
  exports.startOf = startOf;
969
+ exports.weekOfYear = weekOfYear;