aboutsummaryrefslogtreecommitdiff
path: root/node_modules/prompts/dist/dateparts
diff options
context:
space:
mode:
authorScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
committerScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
commita927497b43cbe1438f3d7478932f3f7d03ea347c (patch)
tree0a3c88978b4294fb30afad58daa86c46fbedc2f6 /node_modules/prompts/dist/dateparts
parentba5fa694351774f2684c1aefdc215da5c6f39ba6 (diff)
parentf0db5bbbcd623812a391862d217519afafe197c6 (diff)
downloadtwilight-trunk.tar.gz
twilight-trunk.tar.bz2
twilight-trunk.zip
Merge branch 'deprecation' into 'trunk'HEADtrunk
Disable the Twilight Package Manager See merge request minteck/twilight!1
Diffstat (limited to 'node_modules/prompts/dist/dateparts')
-rw-r--r--node_modules/prompts/dist/dateparts/datepart.js39
-rw-r--r--node_modules/prompts/dist/dateparts/day.js35
-rw-r--r--node_modules/prompts/dist/dateparts/hours.js30
-rw-r--r--node_modules/prompts/dist/dateparts/index.js13
-rw-r--r--node_modules/prompts/dist/dateparts/meridiem.js25
-rw-r--r--node_modules/prompts/dist/dateparts/milliseconds.js28
-rw-r--r--node_modules/prompts/dist/dateparts/minutes.js29
-rw-r--r--node_modules/prompts/dist/dateparts/month.js31
-rw-r--r--node_modules/prompts/dist/dateparts/seconds.js29
-rw-r--r--node_modules/prompts/dist/dateparts/year.js29
10 files changed, 0 insertions, 288 deletions
diff --git a/node_modules/prompts/dist/dateparts/datepart.js b/node_modules/prompts/dist/dateparts/datepart.js
deleted file mode 100644
index b954c5e..0000000
--- a/node_modules/prompts/dist/dateparts/datepart.js
+++ /dev/null
@@ -1,39 +0,0 @@
-'use strict';
-
-class DatePart {
- constructor({
- token,
- date,
- parts,
- locales
- }) {
- this.token = token;
- this.date = date || new Date();
- this.parts = parts || [this];
- this.locales = locales || {};
- }
-
- up() {}
-
- down() {}
-
- next() {
- const currentIdx = this.parts.indexOf(this);
- return this.parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
- }
-
- setTo(val) {}
-
- prev() {
- let parts = [].concat(this.parts).reverse();
- const currentIdx = parts.indexOf(this);
- return parts.find((part, idx) => idx > currentIdx && part instanceof DatePart);
- }
-
- toString() {
- return String(this.date);
- }
-
-}
-
-module.exports = DatePart; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/day.js b/node_modules/prompts/dist/dateparts/day.js
deleted file mode 100644
index a525e92..0000000
--- a/node_modules/prompts/dist/dateparts/day.js
+++ /dev/null
@@ -1,35 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-const pos = n => {
- n = n % 10;
- return n === 1 ? 'st' : n === 2 ? 'nd' : n === 3 ? 'rd' : 'th';
-};
-
-class Day extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setDate(this.date.getDate() + 1);
- }
-
- down() {
- this.date.setDate(this.date.getDate() - 1);
- }
-
- setTo(val) {
- this.date.setDate(parseInt(val.substr(-2)));
- }
-
- toString() {
- let date = this.date.getDate();
- let day = this.date.getDay();
- return this.token === 'DD' ? String(date).padStart(2, '0') : this.token === 'Do' ? date + pos(date) : this.token === 'd' ? day + 1 : this.token === 'ddd' ? this.locales.weekdaysShort[day] : this.token === 'dddd' ? this.locales.weekdays[day] : date;
- }
-
-}
-
-module.exports = Day; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/hours.js b/node_modules/prompts/dist/dateparts/hours.js
deleted file mode 100644
index 7743632..0000000
--- a/node_modules/prompts/dist/dateparts/hours.js
+++ /dev/null
@@ -1,30 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Hours extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setHours(this.date.getHours() + 1);
- }
-
- down() {
- this.date.setHours(this.date.getHours() - 1);
- }
-
- setTo(val) {
- this.date.setHours(parseInt(val.substr(-2)));
- }
-
- toString() {
- let hours = this.date.getHours();
- if (/h/.test(this.token)) hours = hours % 12 || 12;
- return this.token.length > 1 ? String(hours).padStart(2, '0') : hours;
- }
-
-}
-
-module.exports = Hours; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/index.js b/node_modules/prompts/dist/dateparts/index.js
deleted file mode 100644
index 754516e..0000000
--- a/node_modules/prompts/dist/dateparts/index.js
+++ /dev/null
@@ -1,13 +0,0 @@
-'use strict';
-
-module.exports = {
- DatePart: require('./datepart'),
- Meridiem: require('./meridiem'),
- Day: require('./day'),
- Hours: require('./hours'),
- Milliseconds: require('./milliseconds'),
- Minutes: require('./minutes'),
- Month: require('./month'),
- Seconds: require('./seconds'),
- Year: require('./year')
-}; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/meridiem.js b/node_modules/prompts/dist/dateparts/meridiem.js
deleted file mode 100644
index 5bc8dd7..0000000
--- a/node_modules/prompts/dist/dateparts/meridiem.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Meridiem extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setHours((this.date.getHours() + 12) % 24);
- }
-
- down() {
- this.up();
- }
-
- toString() {
- let meridiem = this.date.getHours() > 12 ? 'pm' : 'am';
- return /\A/.test(this.token) ? meridiem.toUpperCase() : meridiem;
- }
-
-}
-
-module.exports = Meridiem; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/milliseconds.js b/node_modules/prompts/dist/dateparts/milliseconds.js
deleted file mode 100644
index 3440e3a..0000000
--- a/node_modules/prompts/dist/dateparts/milliseconds.js
+++ /dev/null
@@ -1,28 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Milliseconds extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setMilliseconds(this.date.getMilliseconds() + 1);
- }
-
- down() {
- this.date.setMilliseconds(this.date.getMilliseconds() - 1);
- }
-
- setTo(val) {
- this.date.setMilliseconds(parseInt(val.substr(-this.token.length)));
- }
-
- toString() {
- return String(this.date.getMilliseconds()).padStart(4, '0').substr(0, this.token.length);
- }
-
-}
-
-module.exports = Milliseconds; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/minutes.js b/node_modules/prompts/dist/dateparts/minutes.js
deleted file mode 100644
index 2b8ef1f..0000000
--- a/node_modules/prompts/dist/dateparts/minutes.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Minutes extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setMinutes(this.date.getMinutes() + 1);
- }
-
- down() {
- this.date.setMinutes(this.date.getMinutes() - 1);
- }
-
- setTo(val) {
- this.date.setMinutes(parseInt(val.substr(-2)));
- }
-
- toString() {
- let m = this.date.getMinutes();
- return this.token.length > 1 ? String(m).padStart(2, '0') : m;
- }
-
-}
-
-module.exports = Minutes; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/month.js b/node_modules/prompts/dist/dateparts/month.js
deleted file mode 100644
index f9d4e13..0000000
--- a/node_modules/prompts/dist/dateparts/month.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Month extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setMonth(this.date.getMonth() + 1);
- }
-
- down() {
- this.date.setMonth(this.date.getMonth() - 1);
- }
-
- setTo(val) {
- val = parseInt(val.substr(-2)) - 1;
- this.date.setMonth(val < 0 ? 0 : val);
- }
-
- toString() {
- let month = this.date.getMonth();
- let tl = this.token.length;
- return tl === 2 ? String(month + 1).padStart(2, '0') : tl === 3 ? this.locales.monthsShort[month] : tl === 4 ? this.locales.months[month] : String(month + 1);
- }
-
-}
-
-module.exports = Month; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/seconds.js b/node_modules/prompts/dist/dateparts/seconds.js
deleted file mode 100644
index e16f030..0000000
--- a/node_modules/prompts/dist/dateparts/seconds.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Seconds extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setSeconds(this.date.getSeconds() + 1);
- }
-
- down() {
- this.date.setSeconds(this.date.getSeconds() - 1);
- }
-
- setTo(val) {
- this.date.setSeconds(parseInt(val.substr(-2)));
- }
-
- toString() {
- let s = this.date.getSeconds();
- return this.token.length > 1 ? String(s).padStart(2, '0') : s;
- }
-
-}
-
-module.exports = Seconds; \ No newline at end of file
diff --git a/node_modules/prompts/dist/dateparts/year.js b/node_modules/prompts/dist/dateparts/year.js
deleted file mode 100644
index cd62677..0000000
--- a/node_modules/prompts/dist/dateparts/year.js
+++ /dev/null
@@ -1,29 +0,0 @@
-'use strict';
-
-const DatePart = require('./datepart');
-
-class Year extends DatePart {
- constructor(opts = {}) {
- super(opts);
- }
-
- up() {
- this.date.setFullYear(this.date.getFullYear() + 1);
- }
-
- down() {
- this.date.setFullYear(this.date.getFullYear() - 1);
- }
-
- setTo(val) {
- this.date.setFullYear(val.substr(-4));
- }
-
- toString() {
- let year = String(this.date.getFullYear()).padStart(4, '0');
- return this.token.length === 2 ? year.substr(-2) : year;
- }
-
-}
-
-module.exports = Year; \ No newline at end of file