@h3ravel/arquebus 0.6.6 → 0.6.8
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/README.md +5 -4
- package/bin/index.cjs +270 -425
- package/bin/{index.js → index.mjs} +230 -409
- package/bin/seeders-C0schOjT.mjs +3 -0
- package/bin/seeders-D-v59HCz.cjs +3 -0
- package/dist/browser/index.cjs +4 -12
- package/dist/browser/index.d.cts +203 -203
- package/dist/browser/{index.d.ts → index.d.mts} +203 -203
- package/dist/browser/{index.js → index.mjs} +4 -11
- package/dist/index.cjs +21 -59
- package/dist/index.d.cts +133 -133
- package/dist/{index.d.ts → index.d.mts} +133 -133
- package/dist/{index.js → index.mjs} +21 -54
- package/dist/inspector/index.cjs +15 -46
- package/dist/inspector/{index.js → index.mjs} +15 -43
- package/dist/migrations/{chunk-PECeCxCb.js → chunk-BD38OWEx.mjs} +1 -1
- package/dist/migrations/index.cjs +20 -57
- package/dist/migrations/index.d.cts +186 -186
- package/dist/migrations/{index.d.ts → index.d.mts} +186 -186
- package/dist/migrations/{index.js → index.mjs} +22 -54
- package/dist/seeders/index.cjs +1 -5
- package/dist/seeders/index.d.cts +184 -184
- package/dist/seeders/{index.d.ts → index.d.mts} +184 -184
- package/dist/seeders/{index.js → index.mjs} +2 -3
- package/dist/stubs/seeder-js.stub +4 -4
- package/dist/stubs/seeder-ts.stub +5 -0
- package/package.json +5 -4
- package/bin/seeders-8GJzfIIN.js +0 -3
- package/bin/seeders-ByeSoCAQ.cjs +0 -131
- package/bin/seeders-CltigymO.js +0 -79
- package/bin/seeders-_xJ6VGVS.cjs +0 -3
- /package/bin/{index.d.ts → index.d.mts} +0 -0
- /package/dist/inspector/{index.d.ts → index.d.mts} +0 -0
package/dist/browser/index.cjs
CHANGED
|
@@ -33,7 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
33
|
let collect_js = require("collect.js");
|
|
34
34
|
collect_js = __toESM(collect_js);
|
|
35
35
|
let radashi = require("radashi");
|
|
36
|
-
radashi = __toESM(radashi);
|
|
37
36
|
let dayjs_plugin_advancedFormat_js = require("dayjs/plugin/advancedFormat.js");
|
|
38
37
|
dayjs_plugin_advancedFormat_js = __toESM(dayjs_plugin_advancedFormat_js);
|
|
39
38
|
let dayjs = require("dayjs");
|
|
@@ -341,9 +340,7 @@ const HasAttributes = (Model$1) => {
|
|
|
341
340
|
}
|
|
342
341
|
originalIsEquivalent(key) {
|
|
343
342
|
if (this.original[key] === void 0) return false;
|
|
344
|
-
|
|
345
|
-
const original = this.original[key];
|
|
346
|
-
if (attribute === original) return true;
|
|
343
|
+
if (this.attributes[key] === this.original[key]) return true;
|
|
347
344
|
else return false;
|
|
348
345
|
}
|
|
349
346
|
setAttributes(attributes) {
|
|
@@ -525,8 +522,7 @@ const HasAttributes = (Model$1) => {
|
|
|
525
522
|
return new Date(value);
|
|
526
523
|
}
|
|
527
524
|
asDate(value) {
|
|
528
|
-
|
|
529
|
-
return (0, dayjs.default)(date).startOf("day").toDate();
|
|
525
|
+
return (0, dayjs.default)(this.asDateTime(value)).startOf("day").toDate();
|
|
530
526
|
}
|
|
531
527
|
};
|
|
532
528
|
};
|
|
@@ -641,10 +637,7 @@ const HasRelations = (Instance) => {
|
|
|
641
637
|
return this.relations[relation] !== void 0;
|
|
642
638
|
}
|
|
643
639
|
related(relation) {
|
|
644
|
-
if (typeof this[getRelationMethod(relation)] !== "function") {
|
|
645
|
-
const message = `Model [${this.constructor.name}]'s relation [${relation}] doesn't exist.`;
|
|
646
|
-
throw new RelationNotFoundError(message);
|
|
647
|
-
}
|
|
640
|
+
if (typeof this[getRelationMethod(relation)] !== "function") throw new RelationNotFoundError(`Model [${this.constructor.name}]'s relation [${relation}] doesn't exist.`);
|
|
648
641
|
return this[getRelationMethod(relation)]();
|
|
649
642
|
}
|
|
650
643
|
async getRelated(relation) {
|
|
@@ -662,8 +655,7 @@ const HasRelations = (Instance) => {
|
|
|
662
655
|
guessBelongsToRelation() {
|
|
663
656
|
var _e$stack;
|
|
664
657
|
const frame = (_e$stack = (/* @__PURE__ */ new Error()).stack) === null || _e$stack === void 0 ? void 0 : _e$stack.split("\n")[2];
|
|
665
|
-
|
|
666
|
-
return getRelationName(functionName);
|
|
658
|
+
return getRelationName(frame === null || frame === void 0 ? void 0 : frame.split(" ")[5]);
|
|
667
659
|
}
|
|
668
660
|
joiningTable(related, instance = null) {
|
|
669
661
|
return [instance ? instance.joiningTableSegment() : snakeCase(related.name), this.joiningTableSegment()].sort().join("_").toLocaleLowerCase();
|