aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/esm/intervalToDuration
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/date-fns/esm/intervalToDuration
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/date-fns/esm/intervalToDuration')
-rw-r--r--node_modules/date-fns/esm/intervalToDuration/index.d.ts4
-rw-r--r--node_modules/date-fns/esm/intervalToDuration/index.js64
-rw-r--r--node_modules/date-fns/esm/intervalToDuration/index.js.flow52
-rw-r--r--node_modules/date-fns/esm/intervalToDuration/package.json4
4 files changed, 0 insertions, 124 deletions
diff --git a/node_modules/date-fns/esm/intervalToDuration/index.d.ts b/node_modules/date-fns/esm/intervalToDuration/index.d.ts
deleted file mode 100644
index ce7bc76..0000000
--- a/node_modules/date-fns/esm/intervalToDuration/index.d.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
-
-import { intervalToDuration } from 'date-fns'
-export default intervalToDuration
diff --git a/node_modules/date-fns/esm/intervalToDuration/index.js b/node_modules/date-fns/esm/intervalToDuration/index.js
deleted file mode 100644
index 410ebe1..0000000
--- a/node_modules/date-fns/esm/intervalToDuration/index.js
+++ /dev/null
@@ -1,64 +0,0 @@
-import compareAsc from "../compareAsc/index.js";
-import add from "../add/index.js";
-import differenceInDays from "../differenceInDays/index.js";
-import differenceInHours from "../differenceInHours/index.js";
-import differenceInMinutes from "../differenceInMinutes/index.js";
-import differenceInMonths from "../differenceInMonths/index.js";
-import differenceInSeconds from "../differenceInSeconds/index.js";
-import differenceInYears from "../differenceInYears/index.js";
-import toDate from "../toDate/index.js";
-import requiredArgs from "../_lib/requiredArgs/index.js";
-/**
- * @name intervalToDuration
- * @category Common Helpers
- * @summary Convert interval to duration
- *
- * @description
- * Convert a interval object to a duration object.
- *
- * @param {Interval} interval - the interval to convert to duration
- *
- * @returns {Duration} The duration Object
- * @throws {TypeError} Requires 2 arguments
- * @throws {RangeError} `start` must not be Invalid Date
- * @throws {RangeError} `end` must not be Invalid Date
- *
- * @example
- * // Get the duration between January 15, 1929 and April 4, 1968.
- * intervalToDuration({
- * start: new Date(1929, 0, 15, 12, 0, 0),
- * end: new Date(1968, 3, 4, 19, 5, 0)
- * })
- * // => { years: 39, months: 2, days: 20, hours: 7, minutes: 5, seconds: 0 }
- */
-export default function intervalToDuration(interval) {
- requiredArgs(1, arguments);
- var start = toDate(interval.start);
- var end = toDate(interval.end);
- if (isNaN(start.getTime())) throw new RangeError('Start Date is invalid');
- if (isNaN(end.getTime())) throw new RangeError('End Date is invalid');
- var duration = {};
- duration.years = Math.abs(differenceInYears(end, start));
- var sign = compareAsc(end, start);
- var remainingMonths = add(start, {
- years: sign * duration.years
- });
- duration.months = Math.abs(differenceInMonths(end, remainingMonths));
- var remainingDays = add(remainingMonths, {
- months: sign * duration.months
- });
- duration.days = Math.abs(differenceInDays(end, remainingDays));
- var remainingHours = add(remainingDays, {
- days: sign * duration.days
- });
- duration.hours = Math.abs(differenceInHours(end, remainingHours));
- var remainingMinutes = add(remainingHours, {
- hours: sign * duration.hours
- });
- duration.minutes = Math.abs(differenceInMinutes(end, remainingMinutes));
- var remainingSeconds = add(remainingMinutes, {
- minutes: sign * duration.minutes
- });
- duration.seconds = Math.abs(differenceInSeconds(end, remainingSeconds));
- return duration;
-} \ No newline at end of file
diff --git a/node_modules/date-fns/esm/intervalToDuration/index.js.flow b/node_modules/date-fns/esm/intervalToDuration/index.js.flow
deleted file mode 100644
index dbd61ee..0000000
--- a/node_modules/date-fns/esm/intervalToDuration/index.js.flow
+++ /dev/null
@@ -1,52 +0,0 @@
-// @flow
-// This file is generated automatically by `scripts/build/typings.js`. Please, don't change it.
-
-export type Interval = {
- start: Date | number,
- end: Date | number,
-}
-
-export type Locale = {
- code?: string,
- formatDistance?: (...args: Array<any>) => any,
- formatRelative?: (...args: Array<any>) => any,
- localize?: {
- ordinalNumber: (...args: Array<any>) => any,
- era: (...args: Array<any>) => any,
- quarter: (...args: Array<any>) => any,
- month: (...args: Array<any>) => any,
- day: (...args: Array<any>) => any,
- dayPeriod: (...args: Array<any>) => any,
- },
- formatLong?: {
- date: (...args: Array<any>) => any,
- time: (...args: Array<any>) => any,
- dateTime: (...args: Array<any>) => any,
- },
- match?: {
- ordinalNumber: (...args: Array<any>) => any,
- era: (...args: Array<any>) => any,
- quarter: (...args: Array<any>) => any,
- month: (...args: Array<any>) => any,
- day: (...args: Array<any>) => any,
- dayPeriod: (...args: Array<any>) => any,
- },
- options?: {
- weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6,
- firstWeekContainsDate?: 1 | 2 | 3 | 4 | 5 | 6 | 7,
- },
-}
-
-export type Duration = {
- years?: number,
- months?: number,
- weeks?: number,
- days?: number,
- hours?: number,
- minutes?: number,
- seconds?: number,
-}
-
-export type Day = 0 | 1 | 2 | 3 | 4 | 5 | 6
-
-declare module.exports: (interval: Interval) => Duration
diff --git a/node_modules/date-fns/esm/intervalToDuration/package.json b/node_modules/date-fns/esm/intervalToDuration/package.json
deleted file mode 100644
index b109f05..0000000
--- a/node_modules/date-fns/esm/intervalToDuration/package.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "sideEffects": false,
- "typings": "../../typings.d.ts"
-} \ No newline at end of file
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage