@amimpact/willy-utils 4.3.0 → 4.5.0

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.
@@ -1,15 +1,6 @@
1
- "use strict";
2
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
- if (ar || !(i in from)) {
5
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
- ar[i] = from[i];
7
- }
8
- }
9
- return to.concat(ar || Array.prototype.slice.call(from));
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.slugify = exports.isAsset = exports.isCraftActionUrl = exports.isExternalUrl = exports.isInternalLink = void 0;
1
+ declare let window: any;
2
+ declare let FW: any;
3
+
13
4
  /**
14
5
  * Bepalen of een link een intern is, zodat bij Vue apps bijv een router-link gemaakt kan worden
15
6
  * https://dennisreimann.de/articles/delegating-html-links-to-vue-router.html
@@ -17,74 +8,84 @@ exports.slugify = exports.isAsset = exports.isCraftActionUrl = exports.isExterna
17
8
  * @param {string} url
18
9
  * @param {PointerEvent} ev
19
10
  */
20
- var isInternalLink = function (url, ev) {
11
+ export const isInternalLink = (url: string, ev: PointerEvent) => {
21
12
  if (ev) {
22
13
  // some sanity checks taken from vue-router:
23
14
  // https://github.com/vuejs/vue-router/blob/dev/src/components/link.js#L106
24
- var altKey = ev.altKey, ctrlKey = ev.ctrlKey, metaKey = ev.metaKey, shiftKey = ev.shiftKey, button = ev.button, defaultPrevented = ev.defaultPrevented;
15
+ const { altKey, ctrlKey, metaKey, shiftKey, button, defaultPrevented } = ev;
16
+
25
17
  // don't handle with control keys
26
18
  if (metaKey || altKey || ctrlKey || shiftKey) {
27
19
  return false;
28
20
  }
21
+
29
22
  // don't handle when preventDefault called
30
23
  if (defaultPrevented) {
31
24
  return false;
32
25
  }
26
+
33
27
  // don't handle right clicks
34
28
  if (button !== undefined && button !== 0) {
35
29
  return false;
36
30
  }
37
31
  }
38
- return (!(0, exports.isExternalUrl)(url) && !isDifferentProtocolLink(url) && !(0, exports.isAsset)(url));
32
+
33
+ return !isExternalUrl(url) && !isDifferentProtocolLink(url) && !isAsset(url);
39
34
  };
40
- exports.isInternalLink = isInternalLink;
35
+
41
36
  /**
42
37
  * Bepalen of het om een externe url gaat
43
38
  */
44
- var isExternalUrl = function (url) {
39
+ export const isExternalUrl = (url: string) => {
45
40
  if (!url) {
46
41
  return false;
47
42
  }
43
+
48
44
  /**
49
45
  * Plugin urls zijn actions en dit kunnen redirects zijn
50
46
  * Deze actions urls dus altijd in een externe tab openen
51
47
  */
52
- if (url.startsWith("".concat(window.location.origin, "/actions/"))) {
48
+ if (url.startsWith(`${window.location.origin}/actions/`)) {
53
49
  return true;
54
50
  }
51
+
55
52
  return url.startsWith('http') && !url.startsWith(window.location.origin);
56
53
  };
57
- exports.isExternalUrl = isExternalUrl;
54
+
58
55
  /**
59
56
  * Bepalen of het om een craft action url gaat
60
57
  */
61
- var isCraftActionUrl = function (url) {
58
+ export const isCraftActionUrl = (url: string) => {
62
59
  if (!url) {
63
60
  return false;
64
61
  }
62
+
65
63
  return url.indexOf('/index.php/actions/') !== -1;
66
64
  };
67
- exports.isCraftActionUrl = isCraftActionUrl;
65
+
68
66
  /**
69
67
  * Checken of het om een ander protocol gaat bijv. tel of mailto
70
68
  * (kan niet met bovenstaande omdat je bij tel of mailto bijvoorbeeld geen target blank wilt gebruiken)
71
69
  */
72
- var isDifferentProtocolLink = function (url) {
70
+ const isDifferentProtocolLink = (url: string) => {
73
71
  if (!url) {
74
72
  return false;
75
73
  }
76
- var DEFAULT_PROTOCOLS = ['mailto', 'tel', 'rdp', 'ms-rd'];
77
- return DEFAULT_PROTOCOLS.findIndex(function (p) { return url.startsWith("".concat(p, ":")); }) > -1;
74
+
75
+ const DEFAULT_PROTOCOLS = ['mailto', 'tel', 'rdp', 'ms-rd'];
76
+
77
+ return DEFAULT_PROTOCOLS.findIndex((p) => url.startsWith(`${p}:`)) > -1;
78
78
  };
79
+
79
80
  /**
80
81
  * Checken of url een bestand is, om deze ook in een nieuw venster te openen
81
82
  */
82
- var isAsset = function (url) {
83
- var _a;
83
+ export const isAsset = (url: string) => {
84
84
  if (!url) {
85
85
  return false;
86
86
  }
87
- var DEFAULT_EXTENSIONS = [
87
+
88
+ const DEFAULT_EXTENSIONS = [
88
89
  'csv',
89
90
  'doc',
90
91
  'docx',
@@ -106,24 +107,31 @@ var isAsset = function (url) {
106
107
  'xls',
107
108
  'xlsx',
108
109
  ];
109
- var CONFIG_EXTENSIONS = ((_a = FW === null || FW === void 0 ? void 0 : FW.config) === null || _a === void 0 ? void 0 : _a.allowedFileExtensions) || [];
110
- var extensions = __spreadArray(__spreadArray([], DEFAULT_EXTENSIONS, true), CONFIG_EXTENSIONS, true);
111
- var slug = url.split('/').pop();
112
- var slugParts = slug ? slug.split('.') : [];
110
+
111
+ const CONFIG_EXTENSIONS = FW?.config?.allowedFileExtensions || [];
112
+
113
+ const extensions = [...DEFAULT_EXTENSIONS, ...CONFIG_EXTENSIONS];
114
+
115
+ const slug = url.split('/').pop();
116
+ const slugParts = slug ? slug.split('.') : [];
117
+
113
118
  if (slugParts.length < 2) {
114
119
  return false;
115
120
  }
116
- var lastSlugPart = slugParts ? slugParts.pop() || '' : '';
121
+
122
+ const lastSlugPart = slugParts ? slugParts.pop() || '' : '';
123
+
117
124
  if (extensions.includes(lastSlugPart.toLowerCase())) {
118
125
  return true;
119
126
  }
127
+
120
128
  return false;
121
129
  };
122
- exports.isAsset = isAsset;
130
+
123
131
  /**
124
132
  * Maak een slug van een string
125
133
  */
126
- var slugify = function (str) {
134
+ export const slugify = (str: string) => {
127
135
  return str
128
136
  .toLowerCase()
129
137
  .trim()
@@ -131,4 +139,3 @@ var slugify = function (str) {
131
139
  .replace(/[\s_-]+/g, '-')
132
140
  .replace(/^-+|-+$/g, '');
133
141
  };
134
- exports.slugify = slugify;
package/.eslintrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
-
3
- }
package/.prettierrc DELETED
@@ -1,5 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "tabWidth": 4,
4
- "trailingComma": "all"
5
- }
package/dist/cookie.d.ts DELETED
@@ -1,15 +0,0 @@
1
- /**
2
- * Create Cookie
3
- * source: http://www.quirksmode.org/js/cookies.html
4
- */
5
- export declare const createCookie: (name: string, value: string | boolean, days?: number) => void;
6
- /**
7
- * Read Cookie
8
- * source: http://www.quirksmode.org/js/cookies.html
9
- */
10
- export declare const readCookie: (name: string) => string | null;
11
- /**
12
- * Erase Cookie
13
- * source: http://www.quirksmode.org/js/cookies.html
14
- */
15
- export declare const eraseCookie: (name: string) => void;
package/dist/cookie.js DELETED
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.eraseCookie = exports.readCookie = exports.createCookie = void 0;
4
- /**
5
- * Create Cookie
6
- * source: http://www.quirksmode.org/js/cookies.html
7
- */
8
- var createCookie = function (name, value, days) {
9
- var expires = '';
10
- if (days) {
11
- var date = new Date();
12
- date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
13
- expires = "; expires=".concat(date.toUTCString());
14
- }
15
- document.cookie = "".concat(name, "=").concat(value).concat(expires, "; path=/");
16
- };
17
- exports.createCookie = createCookie;
18
- /**
19
- * Read Cookie
20
- * source: http://www.quirksmode.org/js/cookies.html
21
- */
22
- var readCookie = function (name) {
23
- var nameEQ = "".concat(name, "=");
24
- var ca = document.cookie.split(';');
25
- for (var i = 0; i < ca.length; i++) {
26
- var c = ca[i];
27
- while (c.charAt(0) === ' ') {
28
- c = c.substring(1, c.length);
29
- }
30
- if (c.indexOf(nameEQ) === 0) {
31
- return c.substring(nameEQ.length, c.length);
32
- }
33
- }
34
- return null;
35
- };
36
- exports.readCookie = readCookie;
37
- /**
38
- * Erase Cookie
39
- * source: http://www.quirksmode.org/js/cookies.html
40
- */
41
- var eraseCookie = function (name) {
42
- (0, exports.createCookie)(name, '', -1);
43
- };
44
- exports.eraseCookie = eraseCookie;
package/dist/date.d.ts DELETED
@@ -1,138 +0,0 @@
1
- /**
2
- * Dates uit Craft mooi formatteren
3
- *
4
- * @param {Object} dateObject
5
- * @param {Object} options
6
- */
7
- interface CraftDate {
8
- date: string;
9
- timezone: string;
10
- timezone_type: number;
11
- }
12
- interface FormatCraftDateOptions {
13
- /**
14
- * Eigen formaat mee kunnen geven
15
- *
16
- * @type {string}
17
- * @memberof FormatCraftDateOptions
18
- */
19
- format: string;
20
- /**
21
- * i18n Locale mee kunnen geven
22
- *
23
- * @type {string}
24
- * @memberof FormatCraftDateOptions
25
- */
26
- locale: string;
27
- /**
28
- * Amerikaans formaat maken om in Craft op te kunnen slaan, anders Nederlands
29
- *
30
- * @type {boolean}
31
- * @memberof FormatCraftDateOptions
32
- */
33
- systemFormat: boolean;
34
- /**
35
- * Datum ook tonen
36
- *
37
- * @type {boolean}
38
- * @memberof FormatCraftDateOptions
39
- */
40
- showTime: boolean;
41
- }
42
- /**
43
- * Opties voor formatDateFromNow
44
- */
45
- interface FormatDateFromNowOptions {
46
- /**
47
- * Toon 'geleden' bij in de datum
48
- *
49
- * @type {boolean}
50
- * @memberof FormatDateFromNowOptions
51
- */
52
- addSuffix: boolean;
53
- /**
54
- * Secondes ook tonen
55
- *
56
- * @type {boolean}
57
- * @memberof FormatDateFromNowOptions
58
- */
59
- includeSeconds: boolean;
60
- /**
61
- * Toon datum voor oudere items
62
- *
63
- * @type {boolean}
64
- * @memberof FormatDateFromNowOptions
65
- */
66
- showDateForOld: boolean;
67
- /**
68
- * Format voor hoe de data getoont wordt
69
- *
70
- * @type {string}
71
- * @memberof FormatDateFromNowOptions
72
- */
73
- showDateForOldFormat: string;
74
- /**
75
- * Aantal dagen voor bovenstaan item
76
- *
77
- * @type {number}
78
- * @memberof FormatDateFromNowOptions
79
- */
80
- numberOfDaysShowDateForOld: number;
81
- /**
82
- * Toon datum in strict format, dus niet 'ongeveer' bijv
83
- * https://date-fns.org/v2.0.0-alpha.27/docs/formatDistanceStrict
84
- *
85
- * @type {boolean}
86
- * @memberof FormatDateFromNowOptions
87
- */
88
- strict: boolean;
89
- /**
90
- * Welke locale is default
91
- *
92
- * @type {any}
93
- * @memberof FormatDateFromNowOptions
94
- */
95
- locale: any;
96
- }
97
- /**
98
- * Opties voor parseISODuration
99
- */
100
- interface parseISODurationOptions {
101
- /**
102
- * Geef de duration als humanReadable terug
103
- * https://date-fns.org/v2.16.1/docs/formatDuration
104
- *
105
- * @type {boolean}
106
- * @memberof parseISODurationOptions
107
- */
108
- humanReadable: boolean;
109
- }
110
- /**
111
- * Format date object uit Craft naar iets leesbaars
112
- *
113
- * @param {CraftDate} dateObject
114
- * @param {FormatCraftDateOptions} options
115
- */
116
- export declare const formatCraftDate: (dateObject: CraftDate, options: FormatCraftDateOptions) => string;
117
- /**
118
- * Datum formatteren naar "x minuten etc. geleden"
119
- * @param {date, timezone, timezone_type} dateObject
120
- */
121
- export declare const formatDateFromNow: (dateObject: CraftDate, options: FormatDateFromNowOptions) => string;
122
- /**
123
- * New date maken op basis van timezone
124
- * @param {date, timezone, timezone_type} dateObject
125
- */
126
- export declare const formatNewDate: (dateObject: CraftDate) => Date | "";
127
- /**
128
- * Convert datum
129
- * @param {Date} date
130
- */
131
- export declare const formatUTCDate: (date: Date) => Date;
132
- /**
133
- * ISO duration naar object ombuigen. Bijv P4W
134
- * @param {string} duration
135
- * @param {parseISODurationOptions} options
136
- */
137
- export declare const parseISODuration: (duration: string, options: parseISODurationOptions) => string | import("./includes/tinyduration").Duration;
138
- export {};
package/dist/date.js DELETED
@@ -1,154 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseISODuration = exports.formatUTCDate = exports.formatNewDate = exports.formatDateFromNow = exports.formatCraftDate = void 0;
4
- var format_1 = require("date-fns/format");
5
- var formatDistance_1 = require("date-fns/formatDistance");
6
- var formatDistanceStrict_1 = require("date-fns/formatDistanceStrict");
7
- var formatDuration_1 = require("date-fns/formatDuration");
8
- var isBefore_1 = require("date-fns/isBefore");
9
- var subDays_1 = require("date-fns/subDays");
10
- var locale_1 = require("date-fns/locale");
11
- var date_fns_tz_1 = require("date-fns-tz");
12
- var tinyduration_1 = require("./includes/tinyduration");
13
- /**
14
- * Momenteel beschikbare locales
15
- * Engels is default (leeg)
16
- */
17
- var availableLocales = {
18
- en: '',
19
- nl: locale_1.nl,
20
- };
21
- /**
22
- * Format date object uit Craft naar iets leesbaars
23
- *
24
- * @param {CraftDate} dateObject
25
- * @param {FormatCraftDateOptions} options
26
- */
27
- var formatCraftDate = function (dateObject, options) {
28
- var dateFormat = options && options.systemFormat ? 'yyyy-MM-dd' : 'dd-MM-yyyy';
29
- var localeString = 'nl';
30
- if (options && options.showTime) {
31
- dateFormat += ' HH:mm';
32
- }
33
- // Eigen format mee kunnen geven
34
- if (options && options.format) {
35
- dateFormat = options.format;
36
- }
37
- // Locale mee kunnen geven
38
- if (options && options.locale) {
39
- localeString = options.locale;
40
- }
41
- if (!dateObject || !dateObject.date) {
42
- return '';
43
- }
44
- /**
45
- * De date uit Craft heeft het volgende format: "2019-11-14 08:00:00.000000"
46
- * Safari begrijpt dit niet en geeft dan een NaN met new Date(date)
47
- * Safari begrijpt het wel als alle - vervangen worden door /, en het laatste gedeelte achter de punt weg is
48
- */
49
- var dateToFormat = dateObject.date.replace(/-/g, '/').split('.')[0];
50
- // De spatie tussen datum en tijd vervangen door 'T', anders snapt IE het niet
51
- return (0, format_1.default)(new Date(dateToFormat), dateFormat, {
52
- locale: availableLocales[localeString],
53
- });
54
- };
55
- exports.formatCraftDate = formatCraftDate;
56
- /**
57
- * Datum formatteren naar "x minuten etc. geleden"
58
- * @param {date, timezone, timezone_type} dateObject
59
- */
60
- var formatDateFromNow = function (dateObject, options) {
61
- var defaultOptions = {
62
- addSuffix: true,
63
- includeSeconds: true,
64
- showDateForOld: false,
65
- showDateForOldFormat: 'dd-MM-yyyy',
66
- numberOfDaysShowDateForOld: 7,
67
- strict: false,
68
- locale: locale_1.nl,
69
- };
70
- var opts = defaultOptions;
71
- if (options) {
72
- opts = Object.assign({}, defaultOptions, options);
73
- }
74
- if (!dateObject || !dateObject.date) {
75
- return '';
76
- }
77
- var parsed = (0, date_fns_tz_1.zonedTimeToUtc)(dateObject.date, dateObject.timezone);
78
- /**
79
- * Datum tonen voor ouder dan x tijd
80
- */
81
- if (opts.showDateForOld &&
82
- (0, isBefore_1.default)(parsed, (0, subDays_1.default)(new Date(), opts.numberOfDaysShowDateForOld))) {
83
- return (0, format_1.default)(new Date(dateObject.date.replace(' ', 'T')), opts.showDateForOldFormat, {
84
- locale: availableLocales[opts.locale],
85
- });
86
- }
87
- else {
88
- var formatDistanceOptions = {
89
- includeSeconds: opts.includeSeconds,
90
- addSuffix: opts.addSuffix,
91
- locale: availableLocales[opts.locale],
92
- };
93
- /**
94
- * De postdate moet bepaald worden met timezone erbij. Anders krijg je in Engeland bijv de melding 'over ongeveer een uur'
95
- * Daarom moet date-fns wel de posttime getransformeerd hebben tot de lokale timezone
96
- */
97
- if (opts.strict) {
98
- return (0, formatDistanceStrict_1.default)(parsed, new Date(), formatDistanceOptions);
99
- }
100
- else {
101
- return (0, formatDistance_1.default)(parsed, new Date(), formatDistanceOptions);
102
- }
103
- }
104
- };
105
- exports.formatDateFromNow = formatDateFromNow;
106
- /**
107
- * New date maken op basis van timezone
108
- * @param {date, timezone, timezone_type} dateObject
109
- */
110
- var formatNewDate = function (dateObject) {
111
- if (!dateObject || !dateObject.date) {
112
- return '';
113
- }
114
- /**
115
- * De date uit Craft heeft het volgende format: "2019-11-14 08:00:00.000000"
116
- * Safari begrijpt dit niet en geeft dan een NaN met new Date(date)
117
- * Safari begrijpt het wel als alle - vervangen worden door /, en het laatste gedeelte achter de punt weg is
118
- */
119
- // const dateString = dateObject.date.replace(/-/g, '/').split('.')[0];
120
- var parsed = (0, date_fns_tz_1.zonedTimeToUtc)(dateObject.date, dateObject.timezone);
121
- return new Date(parsed);
122
- };
123
- exports.formatNewDate = formatNewDate;
124
- /**
125
- * Convert datum
126
- * @param {Date} date
127
- */
128
- var formatUTCDate = function (date) {
129
- var d = new Date(date);
130
- return new Date(Date.UTC(d.getFullYear(), d.getMonth(), d.getDate(), d.getHours(), d.getMinutes(), d.getSeconds()));
131
- };
132
- exports.formatUTCDate = formatUTCDate;
133
- /**
134
- * ISO duration naar object ombuigen. Bijv P4W
135
- * @param {string} duration
136
- * @param {parseISODurationOptions} options
137
- */
138
- var parseISODuration = function (duration, options) {
139
- var defaultOptions = {
140
- humanReadable: false,
141
- };
142
- var opts = defaultOptions;
143
- if (options) {
144
- opts = Object.assign({}, defaultOptions, options);
145
- }
146
- var durationObject = (0, tinyduration_1.parse)(duration);
147
- if (opts.humanReadable) {
148
- return (0, formatDuration_1.default)(durationObject, {
149
- locale: locale_1.nl,
150
- });
151
- }
152
- return durationObject;
153
- };
154
- exports.parseISODuration = parseISODuration;
package/dist/form.d.ts DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Creeert een FormData object vanuit een object
3
- * https://gist.github.com/ghinda/8442a57f22099bdb2e34#gistcomment-2719686
4
- *
5
- * @param {Object} data
6
- * @param {FormData} form
7
- * @param {String} namespace
8
- */
9
- export declare const convertObjectToFormData: (data?: any, form?: FormData | null, namespace?: string) => FormData;
package/dist/form.js DELETED
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.convertObjectToFormData = void 0;
15
- /**
16
- * Creeert een FormData object vanuit een object
17
- * https://gist.github.com/ghinda/8442a57f22099bdb2e34#gistcomment-2719686
18
- *
19
- * @param {Object} data
20
- * @param {FormData} form
21
- * @param {String} namespace
22
- */
23
- var convertObjectToFormData = function (data, form, namespace) {
24
- if (data === void 0) { data = {}; }
25
- if (form === void 0) { form = null; }
26
- if (namespace === void 0) { namespace = ''; }
27
- var model = __assign({}, data);
28
- var formData = form || new FormData();
29
- var _loop_1 = function (propertyName) {
30
- if (!model.hasOwnProperty(propertyName) ||
31
- ((model[propertyName] === null || model[propertyName] === undefined) &&
32
- typeof model[propertyName] !== 'string')) {
33
- return "continue";
34
- }
35
- var formKey = namespace ? "".concat(namespace, "[").concat(propertyName, "]") : propertyName;
36
- // Date
37
- if (model[propertyName] instanceof Date)
38
- formData.append(formKey, model[propertyName].toISOString());
39
- // File
40
- else if (model[propertyName] instanceof File) {
41
- formData.append(formKey, model[propertyName]);
42
- // Array
43
- }
44
- else if (model[propertyName] instanceof Array) {
45
- if (model[propertyName].length === 0) {
46
- formData.append(formKey, '');
47
- }
48
- else {
49
- model[propertyName].forEach(function (element, index) {
50
- var tempFormKey = "".concat(formKey, "[").concat(index, "]");
51
- if (element instanceof File) {
52
- formData.append(tempFormKey, element);
53
- }
54
- else {
55
- if (typeof element === 'object') {
56
- (0, exports.convertObjectToFormData)(element, formData, tempFormKey);
57
- }
58
- else {
59
- formData.append(tempFormKey, element.toString());
60
- }
61
- }
62
- });
63
- }
64
- // Object en geen File
65
- }
66
- else if (typeof model[propertyName] === 'object' &&
67
- !(model[propertyName] instanceof File)) {
68
- (0, exports.convertObjectToFormData)(model[propertyName], formData, formKey);
69
- }
70
- else {
71
- var val = model[propertyName];
72
- var formDataValue = typeof val === 'boolean' ? (val ? '1' : '0') : val;
73
- formData.append(formKey, formDataValue.toString());
74
- }
75
- };
76
- for (var propertyName in model) {
77
- _loop_1(propertyName);
78
- }
79
- // for (let propertyName in files) {
80
- // if (files.hasOwnProperty(propertyName)) {
81
- // // formData.append(propertyName, files[propertyName]);
82
- // formData.append(`fields[${propertyName}]`, files[propertyName]);
83
- // }
84
- // }
85
- return formData;
86
- };
87
- exports.convertObjectToFormData = convertObjectToFormData;
@@ -1,20 +0,0 @@
1
- /**
2
- * https://github.com/MelleB/tinyduration
3
- * v 3.2.0
4
- */
5
- interface DurationValues {
6
- years?: number;
7
- months?: number;
8
- weeks?: number;
9
- days?: number;
10
- hours?: number;
11
- minutes?: number;
12
- seconds?: number;
13
- }
14
- export declare type Duration = {
15
- negative?: boolean;
16
- } & DurationValues;
17
- export declare const InvalidDurationError: Error;
18
- export declare function parse(durationStr: string): Duration;
19
- export declare function serialize(duration: Duration): string;
20
- export {};
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { createCookie, readCookie, eraseCookie } from './cookie';
2
- import { formatCraftDate, formatDateFromNow, formatNewDate, formatUTCDate, parseISODuration } from './date';
3
- import { convertObjectToFormData } from './form';
4
- import { bytesToSize, capitalize, checkForScrollbars, convertHexToRGBA, downloadFile, getNestedSet, getUrlsFromString, isHoverableDevice, isPlainObject, isTouchDevice, isValidUrl, observeResize, wrap } from './misc';
5
- import { $, $$, getParents } from './selectors';
6
- import { isCraftActionUrl, isInternalLink, isExternalUrl, isAsset, slugify } from './url';
7
- export { $, $$, bytesToSize, capitalize, checkForScrollbars, convertHexToRGBA, createCookie, downloadFile, eraseCookie, formatCraftDate, convertObjectToFormData, formatDateFromNow, formatNewDate, formatUTCDate, getNestedSet, getParents, getUrlsFromString, isAsset, isCraftActionUrl, isExternalUrl, isHoverableDevice, isInternalLink, isPlainObject, isTouchDevice, isValidUrl, observeResize, parseISODuration, readCookie, slugify, wrap, };