@h3ravel/support 0.17.0-alpha.8 → 1.29.0-alpha.11
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.
- package/dist/{RuntimeException-Bt4SxSOi.js → RuntimeException-BgZJ6pEc.js} +1 -2
- package/dist/{RuntimeException-BlF2onMq.cjs → RuntimeException-vs-j61-c.cjs} +6 -8
- package/dist/{Time-DXrqE9Zj.js → Time-BOROqEXk.js} +6 -8
- package/dist/{Time-H1gLMvCJ.cjs → Time-CjHXeIZv.cjs} +48 -59
- package/dist/facades.cjs +5 -12
- package/dist/facades.js +2 -9
- package/dist/index.cjs +100 -305
- package/dist/index.d.ts +103 -99
- package/dist/index.js +77 -284
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/traits.cjs +6 -7
- package/dist/traits.d.ts +2 -3
- package/dist/traits.js +3 -5
- package/package.json +5 -5
- package/dist/Time-DY_lqAIR.d.ts +0 -166
- package/dist/chunk-CGA-kHjv.js +0 -20
- /package/dist/{Time-CSQCyEfN.d.ts → Time-D96uToox.d.ts} +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
//#region src/Exceptions/RuntimeException.ts
|
|
3
2
|
/**
|
|
4
3
|
* Exception thrown if an error which can only be found on runtime occurs.
|
|
@@ -9,11 +8,10 @@ var RuntimeException = class extends Error {
|
|
|
9
8
|
this.name = "RuntimeException";
|
|
10
9
|
}
|
|
11
10
|
};
|
|
12
|
-
|
|
13
11
|
//#endregion
|
|
14
|
-
Object.defineProperty(exports,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
12
|
+
Object.defineProperty(exports, "RuntimeException", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function() {
|
|
15
|
+
return RuntimeException;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
@@ -7,7 +7,6 @@ import isLeapYear from "dayjs/plugin/isLeapYear.js";
|
|
|
7
7
|
import relativeTime from "dayjs/plugin/relativeTime.js";
|
|
8
8
|
import timezone from "dayjs/plugin/timezone.js";
|
|
9
9
|
import utc from "dayjs/plugin/utc.js";
|
|
10
|
-
|
|
11
10
|
//#region src/Helpers/Time.ts
|
|
12
11
|
dayjs.extend(utc);
|
|
13
12
|
dayjs.extend(timezone);
|
|
@@ -17,17 +16,17 @@ dayjs.extend(isLeapYear);
|
|
|
17
16
|
dayjs.extend(relativeTime);
|
|
18
17
|
dayjs.extend(advancedFormat);
|
|
19
18
|
dayjs.extend(customParseFormat);
|
|
20
|
-
const phpToDayjsTokens = (format
|
|
19
|
+
const phpToDayjsTokens = (format) => format.replace(/Y/g, "YYYY").replace(/m/g, "MM").replace(/d/g, "DD").replace(/H/g, "HH").replace(/i/g, "mm").replace(/s/g, "ss");
|
|
21
20
|
function format(date, fmt) {
|
|
22
21
|
return dayjs(date).format(phpToDayjsTokens(fmt));
|
|
23
22
|
}
|
|
24
23
|
const TimeClass = class {};
|
|
25
24
|
var DateTime = class DateTime extends TimeClass {
|
|
26
25
|
instance;
|
|
27
|
-
constructor(config, format
|
|
26
|
+
constructor(config, format, locale, strict) {
|
|
28
27
|
super(config);
|
|
29
28
|
if (config instanceof DateTime) config = config.instance;
|
|
30
|
-
this.instance = dayjs(config, format
|
|
29
|
+
this.instance = dayjs(config, format, locale, strict);
|
|
31
30
|
return new Proxy(this, { get: (target, prop, receiver) => {
|
|
32
31
|
if (prop in target) return Reflect.get(target, prop, receiver);
|
|
33
32
|
const value = Reflect.get(this.instance, prop, receiver);
|
|
@@ -52,8 +51,8 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
52
51
|
* @param timezone
|
|
53
52
|
* @returns
|
|
54
53
|
*/
|
|
55
|
-
setTimezone(timezone
|
|
56
|
-
return new DateTime(this.tz(timezone
|
|
54
|
+
setTimezone(timezone, keepLocalTime) {
|
|
55
|
+
return new DateTime(this.tz(timezone, keepLocalTime));
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* Returns a cloned Day.js object with a specified amount of time added.
|
|
@@ -237,6 +236,5 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
237
236
|
return new DateTime(time).lastDayOfMonth();
|
|
238
237
|
}
|
|
239
238
|
};
|
|
240
|
-
|
|
241
239
|
//#endregion
|
|
242
|
-
export { format as n, DateTime as t };
|
|
240
|
+
export { format as n, DateTime as t };
|
|
@@ -1,34 +1,26 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
9
|
let target = {};
|
|
10
|
-
for (var name in all) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
if (symbols) {
|
|
17
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
18
|
-
}
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
19
15
|
return target;
|
|
20
16
|
};
|
|
21
17
|
var __copyProps = (to, from, except, desc) => {
|
|
22
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
32
24
|
}
|
|
33
25
|
return to;
|
|
34
26
|
};
|
|
@@ -36,27 +28,25 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
36
28
|
value: mod,
|
|
37
29
|
enumerable: true
|
|
38
30
|
}) : target, mod));
|
|
39
|
-
|
|
40
31
|
//#endregion
|
|
41
32
|
let dayjs = require("dayjs");
|
|
42
|
-
dayjs = __toESM(dayjs);
|
|
33
|
+
dayjs = __toESM(dayjs, 1);
|
|
43
34
|
let dayjs_plugin_advancedFormat_js = require("dayjs/plugin/advancedFormat.js");
|
|
44
|
-
dayjs_plugin_advancedFormat_js = __toESM(dayjs_plugin_advancedFormat_js);
|
|
35
|
+
dayjs_plugin_advancedFormat_js = __toESM(dayjs_plugin_advancedFormat_js, 1);
|
|
45
36
|
let dayjs_plugin_customParseFormat_js = require("dayjs/plugin/customParseFormat.js");
|
|
46
|
-
dayjs_plugin_customParseFormat_js = __toESM(dayjs_plugin_customParseFormat_js);
|
|
37
|
+
dayjs_plugin_customParseFormat_js = __toESM(dayjs_plugin_customParseFormat_js, 1);
|
|
47
38
|
let dayjs_plugin_dayOfYear_js = require("dayjs/plugin/dayOfYear.js");
|
|
48
|
-
dayjs_plugin_dayOfYear_js = __toESM(dayjs_plugin_dayOfYear_js);
|
|
39
|
+
dayjs_plugin_dayOfYear_js = __toESM(dayjs_plugin_dayOfYear_js, 1);
|
|
49
40
|
let dayjs_plugin_isBetween_js = require("dayjs/plugin/isBetween.js");
|
|
50
|
-
dayjs_plugin_isBetween_js = __toESM(dayjs_plugin_isBetween_js);
|
|
41
|
+
dayjs_plugin_isBetween_js = __toESM(dayjs_plugin_isBetween_js, 1);
|
|
51
42
|
let dayjs_plugin_isLeapYear_js = require("dayjs/plugin/isLeapYear.js");
|
|
52
|
-
dayjs_plugin_isLeapYear_js = __toESM(dayjs_plugin_isLeapYear_js);
|
|
43
|
+
dayjs_plugin_isLeapYear_js = __toESM(dayjs_plugin_isLeapYear_js, 1);
|
|
53
44
|
let dayjs_plugin_relativeTime_js = require("dayjs/plugin/relativeTime.js");
|
|
54
|
-
dayjs_plugin_relativeTime_js = __toESM(dayjs_plugin_relativeTime_js);
|
|
45
|
+
dayjs_plugin_relativeTime_js = __toESM(dayjs_plugin_relativeTime_js, 1);
|
|
55
46
|
let dayjs_plugin_timezone_js = require("dayjs/plugin/timezone.js");
|
|
56
|
-
dayjs_plugin_timezone_js = __toESM(dayjs_plugin_timezone_js);
|
|
47
|
+
dayjs_plugin_timezone_js = __toESM(dayjs_plugin_timezone_js, 1);
|
|
57
48
|
let dayjs_plugin_utc_js = require("dayjs/plugin/utc.js");
|
|
58
|
-
dayjs_plugin_utc_js = __toESM(dayjs_plugin_utc_js);
|
|
59
|
-
|
|
49
|
+
dayjs_plugin_utc_js = __toESM(dayjs_plugin_utc_js, 1);
|
|
60
50
|
//#region src/Helpers/Time.ts
|
|
61
51
|
dayjs.default.extend(dayjs_plugin_utc_js.default);
|
|
62
52
|
dayjs.default.extend(dayjs_plugin_timezone_js.default);
|
|
@@ -66,17 +56,17 @@ dayjs.default.extend(dayjs_plugin_isLeapYear_js.default);
|
|
|
66
56
|
dayjs.default.extend(dayjs_plugin_relativeTime_js.default);
|
|
67
57
|
dayjs.default.extend(dayjs_plugin_advancedFormat_js.default);
|
|
68
58
|
dayjs.default.extend(dayjs_plugin_customParseFormat_js.default);
|
|
69
|
-
const phpToDayjsTokens = (format
|
|
59
|
+
const phpToDayjsTokens = (format) => format.replace(/Y/g, "YYYY").replace(/m/g, "MM").replace(/d/g, "DD").replace(/H/g, "HH").replace(/i/g, "mm").replace(/s/g, "ss");
|
|
70
60
|
function format(date, fmt) {
|
|
71
61
|
return (0, dayjs.default)(date).format(phpToDayjsTokens(fmt));
|
|
72
62
|
}
|
|
73
63
|
const TimeClass = class {};
|
|
74
64
|
var DateTime = class DateTime extends TimeClass {
|
|
75
65
|
instance;
|
|
76
|
-
constructor(config, format
|
|
66
|
+
constructor(config, format, locale, strict) {
|
|
77
67
|
super(config);
|
|
78
68
|
if (config instanceof DateTime) config = config.instance;
|
|
79
|
-
this.instance = (0, dayjs.default)(config, format
|
|
69
|
+
this.instance = (0, dayjs.default)(config, format, locale, strict);
|
|
80
70
|
return new Proxy(this, { get: (target, prop, receiver) => {
|
|
81
71
|
if (prop in target) return Reflect.get(target, prop, receiver);
|
|
82
72
|
const value = Reflect.get(this.instance, prop, receiver);
|
|
@@ -101,8 +91,8 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
101
91
|
* @param timezone
|
|
102
92
|
* @returns
|
|
103
93
|
*/
|
|
104
|
-
setTimezone(timezone
|
|
105
|
-
return new DateTime(this.tz(timezone
|
|
94
|
+
setTimezone(timezone, keepLocalTime) {
|
|
95
|
+
return new DateTime(this.tz(timezone, keepLocalTime));
|
|
106
96
|
}
|
|
107
97
|
/**
|
|
108
98
|
* Returns a cloned Day.js object with a specified amount of time added.
|
|
@@ -286,29 +276,28 @@ var DateTime = class DateTime extends TimeClass {
|
|
|
286
276
|
return new DateTime(time).lastDayOfMonth();
|
|
287
277
|
}
|
|
288
278
|
};
|
|
289
|
-
|
|
290
279
|
//#endregion
|
|
291
|
-
Object.defineProperty(exports,
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
280
|
+
Object.defineProperty(exports, "DateTime", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: function() {
|
|
283
|
+
return DateTime;
|
|
284
|
+
}
|
|
296
285
|
});
|
|
297
|
-
Object.defineProperty(exports,
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
286
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
get: function() {
|
|
289
|
+
return __exportAll;
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(exports, "__toESM", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: function() {
|
|
295
|
+
return __toESM;
|
|
296
|
+
}
|
|
302
297
|
});
|
|
303
|
-
Object.defineProperty(exports,
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
298
|
+
Object.defineProperty(exports, "format", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get: function() {
|
|
301
|
+
return format;
|
|
302
|
+
}
|
|
308
303
|
});
|
|
309
|
-
Object.defineProperty(exports, 'format', {
|
|
310
|
-
enumerable: true,
|
|
311
|
-
get: function () {
|
|
312
|
-
return format;
|
|
313
|
-
}
|
|
314
|
-
});
|
package/dist/facades.cjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
const require_RuntimeException = require(
|
|
3
|
-
let
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_RuntimeException = require("./RuntimeException-vs-j61-c.cjs");
|
|
3
|
+
let _h3ravel_shared = require("@h3ravel/shared");
|
|
5
4
|
//#region src/Facades/Facades.ts
|
|
6
5
|
var Facades = class {
|
|
7
6
|
/**
|
|
@@ -86,7 +85,7 @@ var Facades = class {
|
|
|
86
85
|
static __callStatic(method, args) {
|
|
87
86
|
const instance = this.getFacadeRoot();
|
|
88
87
|
if (!instance) throw new Error("Facade root not resolved.");
|
|
89
|
-
if (typeof instance[method] === "function" && !(0,
|
|
88
|
+
if (typeof instance[method] === "function" && !(0, _h3ravel_shared.isInternal)(instance, method)) return Reflect.apply(instance[method], instance, args);
|
|
90
89
|
if (typeof instance.__call === "function") return instance.__call(method, args);
|
|
91
90
|
throw new Error(`Method [${method}] does not exist on [${instance.constructor.name}] facade root.`);
|
|
92
91
|
}
|
|
@@ -96,7 +95,6 @@ var Facades = class {
|
|
|
96
95
|
} });
|
|
97
96
|
}
|
|
98
97
|
};
|
|
99
|
-
|
|
100
98
|
//#endregion
|
|
101
99
|
//#region src/Facades/HashFacade.ts
|
|
102
100
|
var HashFacade = class extends Facades {
|
|
@@ -105,7 +103,6 @@ var HashFacade = class extends Facades {
|
|
|
105
103
|
}
|
|
106
104
|
};
|
|
107
105
|
const Hash = HashFacade.createFacade();
|
|
108
|
-
|
|
109
106
|
//#endregion
|
|
110
107
|
//#region src/Facades/RequestFacade.ts
|
|
111
108
|
var RequestFacade = class extends Facades {
|
|
@@ -114,7 +111,6 @@ var RequestFacade = class extends Facades {
|
|
|
114
111
|
}
|
|
115
112
|
};
|
|
116
113
|
const Request = RequestFacade.createFacade();
|
|
117
|
-
|
|
118
114
|
//#endregion
|
|
119
115
|
//#region src/Facades/ResponseFacade.ts
|
|
120
116
|
var ResponseFacade = class extends Facades {
|
|
@@ -123,7 +119,6 @@ var ResponseFacade = class extends Facades {
|
|
|
123
119
|
}
|
|
124
120
|
};
|
|
125
121
|
const Response = ResponseFacade.createFacade();
|
|
126
|
-
|
|
127
122
|
//#endregion
|
|
128
123
|
//#region src/Facades/RouteFacade.ts
|
|
129
124
|
var RouteFacade = class extends Facades {
|
|
@@ -132,7 +127,6 @@ var RouteFacade = class extends Facades {
|
|
|
132
127
|
}
|
|
133
128
|
};
|
|
134
129
|
const Route = RouteFacade.createFacade();
|
|
135
|
-
|
|
136
130
|
//#endregion
|
|
137
131
|
//#region src/Facades/URLFacade.ts
|
|
138
132
|
var URLFacade = class extends Facades {
|
|
@@ -141,11 +135,10 @@ var URLFacade = class extends Facades {
|
|
|
141
135
|
}
|
|
142
136
|
};
|
|
143
137
|
const URL = URLFacade.createFacade();
|
|
144
|
-
|
|
145
138
|
//#endregion
|
|
146
139
|
exports.Facades = Facades;
|
|
147
140
|
exports.Hash = Hash;
|
|
148
141
|
exports.Request = Request;
|
|
149
142
|
exports.Response = Response;
|
|
150
143
|
exports.Route = Route;
|
|
151
|
-
exports.URL = URL;
|
|
144
|
+
exports.URL = URL;
|
package/dist/facades.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { t as RuntimeException } from "./RuntimeException-
|
|
1
|
+
import { t as RuntimeException } from "./RuntimeException-BgZJ6pEc.js";
|
|
2
2
|
import { isInternal } from "@h3ravel/shared";
|
|
3
|
-
|
|
4
3
|
//#region src/Facades/Facades.ts
|
|
5
4
|
var Facades = class {
|
|
6
5
|
/**
|
|
@@ -95,7 +94,6 @@ var Facades = class {
|
|
|
95
94
|
} });
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
|
-
|
|
99
97
|
//#endregion
|
|
100
98
|
//#region src/Facades/HashFacade.ts
|
|
101
99
|
var HashFacade = class extends Facades {
|
|
@@ -104,7 +102,6 @@ var HashFacade = class extends Facades {
|
|
|
104
102
|
}
|
|
105
103
|
};
|
|
106
104
|
const Hash = HashFacade.createFacade();
|
|
107
|
-
|
|
108
105
|
//#endregion
|
|
109
106
|
//#region src/Facades/RequestFacade.ts
|
|
110
107
|
var RequestFacade = class extends Facades {
|
|
@@ -113,7 +110,6 @@ var RequestFacade = class extends Facades {
|
|
|
113
110
|
}
|
|
114
111
|
};
|
|
115
112
|
const Request = RequestFacade.createFacade();
|
|
116
|
-
|
|
117
113
|
//#endregion
|
|
118
114
|
//#region src/Facades/ResponseFacade.ts
|
|
119
115
|
var ResponseFacade = class extends Facades {
|
|
@@ -122,7 +118,6 @@ var ResponseFacade = class extends Facades {
|
|
|
122
118
|
}
|
|
123
119
|
};
|
|
124
120
|
const Response = ResponseFacade.createFacade();
|
|
125
|
-
|
|
126
121
|
//#endregion
|
|
127
122
|
//#region src/Facades/RouteFacade.ts
|
|
128
123
|
var RouteFacade = class extends Facades {
|
|
@@ -131,7 +126,6 @@ var RouteFacade = class extends Facades {
|
|
|
131
126
|
}
|
|
132
127
|
};
|
|
133
128
|
const Route = RouteFacade.createFacade();
|
|
134
|
-
|
|
135
129
|
//#endregion
|
|
136
130
|
//#region src/Facades/URLFacade.ts
|
|
137
131
|
var URLFacade = class extends Facades {
|
|
@@ -140,6 +134,5 @@ var URLFacade = class extends Facades {
|
|
|
140
134
|
}
|
|
141
135
|
};
|
|
142
136
|
const URL = URLFacade.createFacade();
|
|
143
|
-
|
|
144
137
|
//#endregion
|
|
145
|
-
export { Facades, Hash, Request, Response, Route, URL };
|
|
138
|
+
export { Facades, Hash, Request, Response, Route, URL };
|