aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/date-fns/esm/set
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/date-fns/esm/set')
-rw-r--r--node_modules/date-fns/esm/set/index.d.ts4
-rw-r--r--node_modules/date-fns/esm/set/index.js77
-rw-r--r--node_modules/date-fns/esm/set/index.js.flow63
-rw-r--r--node_modules/date-fns/esm/set/package.json4
4 files changed, 0 insertions, 148 deletions
diff --git a/node_modules/date-fns/esm/set/index.d.ts b/node_modules/date-fns/esm/set/index.d.ts
deleted file mode 100644
index d30347b..0000000
--- a/node_modules/date-fns/esm/set/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 { set } from 'date-fns'
-export default set
diff --git a/node_modules/date-fns/esm/set/index.js b/node_modules/date-fns/esm/set/index.js
deleted file mode 100644
index 094704e..0000000
--- a/node_modules/date-fns/esm/set/index.js
+++ /dev/null
@@ -1,77 +0,0 @@
-import _typeof from "@babel/runtime/helpers/esm/typeof";
-import toDate from "../toDate/index.js";
-import setMonth from "../setMonth/index.js";
-import toInteger from "../_lib/toInteger/index.js";
-import requiredArgs from "../_lib/requiredArgs/index.js";
-/**
- * @name set
- * @category Common Helpers
- * @summary Set date values to a given date.
- *
- * @description
- * Set date values to a given date.
- *
- * Sets time values to date from object `values`.
- * A value is not set if it is undefined or null or doesn't exist in `values`.
- *
- * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts
- * to use native `Date#setX` methods. If you use this function, you may not want to include the
- * other `setX` functions that date-fns provides if you are concerned about the bundle size.
- *
- * @param {Date|Number} date - the date to be changed
- * @param {Object} values - an object with options
- * @param {Number} [values.year] - the number of years to be set
- * @param {Number} [values.month] - the number of months to be set
- * @param {Number} [values.date] - the number of days to be set
- * @param {Number} [values.hours] - the number of hours to be set
- * @param {Number} [values.minutes] - the number of minutes to be set
- * @param {Number} [values.seconds] - the number of seconds to be set
- * @param {Number} [values.milliseconds] - the number of milliseconds to be set
- * @returns {Date} the new date with options set
- * @throws {TypeError} 2 arguments required
- * @throws {RangeError} `values` must be an object
- *
- * @example
- * // Transform 1 September 2014 into 20 October 2015 in a single line:
- * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })
- * //=> Tue Oct 20 2015 00:00:00
- *
- * @example
- * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:
- * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })
- * //=> Mon Sep 01 2014 12:23:45
- */
-export default function set(dirtyDate, values) {
- requiredArgs(2, arguments);
- if (_typeof(values) !== 'object' || values === null) {
- throw new RangeError('values parameter must be an object');
- }
- var date = toDate(dirtyDate);
-
- // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date
- if (isNaN(date.getTime())) {
- return new Date(NaN);
- }
- if (values.year != null) {
- date.setFullYear(values.year);
- }
- if (values.month != null) {
- date = setMonth(date, values.month);
- }
- if (values.date != null) {
- date.setDate(toInteger(values.date));
- }
- if (values.hours != null) {
- date.setHours(toInteger(values.hours));
- }
- if (values.minutes != null) {
- date.setMinutes(toInteger(values.minutes));
- }
- if (values.seconds != null) {
- date.setSeconds(toInteger(values.seconds));
- }
- if (values.milliseconds != null) {
- date.setMilliseconds(toInteger(values.milliseconds));
- }
- return date;
-} \ No newline at end of file
diff --git a/node_modules/date-fns/esm/set/index.js.flow b/node_modules/date-fns/esm/set/index.js.flow
deleted file mode 100644
index 384f137..0000000
--- a/node_modules/date-fns/esm/set/index.js.flow
+++ /dev/null
@@ -1,63 +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: (
- date: Date | number,
- values: {
- year?: number,
- month?: number,
- date?: number,
- hours?: number,
- minutes?: number,
- seconds?: number,
- milliseconds?: number,
- }
-) => Date
diff --git a/node_modules/date-fns/esm/set/package.json b/node_modules/date-fns/esm/set/package.json
deleted file mode 100644
index b109f05..0000000
--- a/node_modules/date-fns/esm/set/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