@onerb/core 1.0.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.
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -0
- package/package.json +27 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
AppError: () => AppError
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
|
|
27
|
+
// src/errors/app-error.ts
|
|
28
|
+
var AppError = class extends Error {
|
|
29
|
+
message;
|
|
30
|
+
code;
|
|
31
|
+
detail;
|
|
32
|
+
constructor(message, options) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.message = message;
|
|
35
|
+
this.code = options.code;
|
|
36
|
+
this.detail = options.detail;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
AppError
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/errors/app-error.ts"],"sourcesContent":["export * from './errors'\n","export class AppError extends Error {\n readonly message: string;\n readonly code: string;\n readonly detail?: string;\n\n constructor(\n message: string, options: { code: string; detail?: string; }\n ) {\n super(message);\n this.message = message;\n this.code = options.code;\n this.detail = options.detail;\n }\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,WAAN,cAAuB,MAAM;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACI,SAAiB,SACnB;AACE,UAAM,OAAO;AACb,SAAK,UAAU;AACf,SAAK,OAAO,QAAQ;AACpB,SAAK,SAAS,QAAQ;AAAA,EAC1B;AACJ;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare class AppError extends Error {
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly detail?: string;
|
|
5
|
+
constructor(message: string, options: {
|
|
6
|
+
code: string;
|
|
7
|
+
detail?: string;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Either = {};
|
|
12
|
+
|
|
13
|
+
export { AppError, type Either };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare class AppError extends Error {
|
|
2
|
+
readonly message: string;
|
|
3
|
+
readonly code: string;
|
|
4
|
+
readonly detail?: string;
|
|
5
|
+
constructor(message: string, options: {
|
|
6
|
+
code: string;
|
|
7
|
+
detail?: string;
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
type Either = {};
|
|
12
|
+
|
|
13
|
+
export { AppError, type Either };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// src/errors/app-error.ts
|
|
2
|
+
var AppError = class extends Error {
|
|
3
|
+
message;
|
|
4
|
+
code;
|
|
5
|
+
detail;
|
|
6
|
+
constructor(message, options) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.message = message;
|
|
9
|
+
this.code = options.code;
|
|
10
|
+
this.detail = options.detail;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
AppError
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors/app-error.ts"],"sourcesContent":["export class AppError extends Error {\n readonly message: string;\n readonly code: string;\n readonly detail?: string;\n\n constructor(\n message: string, options: { code: string; detail?: string; }\n ) {\n super(message);\n this.message = message;\n this.code = options.code;\n this.detail = options.detail;\n }\n}"],"mappings":";AAAO,IAAM,WAAN,cAAuB,MAAM;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EAET,YACI,SAAiB,SACnB;AACE,UAAM,OAAO;AACb,SAAK,UAAU;AACf,SAAK,OAAO,QAAQ;AACpB,SAAK,SAAS,QAAQ;AAAA,EAC1B;AACJ;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onerb/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Core utilities for Onerb projects.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "./dist/index.cjs",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": ["dist"],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup",
|
|
21
|
+
"test": "node --test"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"tsup": "^8.2.0",
|
|
25
|
+
"typescript": "^5.5.0"
|
|
26
|
+
}
|
|
27
|
+
}
|