@zayne-labs/callapi 0.0.1
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 +1 -0
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +139 -0
- package/dist/index.d.ts +139 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# CallApi
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var createFetchClient = require('./createFetchClient');
|
|
4
|
+
var utils = require('./utils');
|
|
5
|
+
|
|
6
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
|
+
|
|
8
|
+
var createFetchClient__default = /*#__PURE__*/_interopDefault(createFetchClient);
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, "callApi", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return createFetchClient__default.default; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "HTTPError", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return utils.HTTPError; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "isHTTPErrorInfo", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return utils.isHTTPErrorInfo; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "isHTTPErrorInstance", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return utils.isHTTPErrorInstance; }
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=out.js.map
|
|
29
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["default","isHTTPErrorInfo","HTTPError","isHTTPErrorInstance"],"mappings":"AAAA,OAAoB,WAAXA,MAA0B,sBAInC,OAAS,mBAAAC,EAAiB,aAAAC,EAAW,uBAAAC,MAA2B","sourcesContent":["export { default as callApi } from \"./createFetchClient\";\n\nexport type { FetchConfig, BaseConfig } from \"./types\";\n\nexport { isHTTPErrorInfo, HTTPError, isHTTPErrorInstance } from \"./utils\";\n"]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
type AnyString = string & {
|
|
2
|
+
placeholder?: never;
|
|
3
|
+
};
|
|
4
|
+
type AnyNumber = number & {
|
|
5
|
+
placeholder?: never;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
declare const fetchSpecificKeys: ("headers" | "body" | "method" | "cache" | "credentials" | "integrity" | "keepalive" | "mode" | "priority" | "redirect" | "referrer" | "referrerPolicy" | "signal" | "window")[];
|
|
9
|
+
declare const handleResponseType: <TResponse>(response: Response, parser?: Required<ExtraOptions>["responseParser"]) => {
|
|
10
|
+
json: () => Promise<TResponse>;
|
|
11
|
+
arrayBuffer: () => Promise<TResponse>;
|
|
12
|
+
blob: () => Promise<TResponse>;
|
|
13
|
+
formData: () => Promise<TResponse>;
|
|
14
|
+
text: () => Promise<TResponse>;
|
|
15
|
+
};
|
|
16
|
+
declare const isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
17
|
+
errorName: "HTTPError";
|
|
18
|
+
};
|
|
19
|
+
type ErrorDetails<TErrorResponse> = {
|
|
20
|
+
response: Response & {
|
|
21
|
+
errorData: TErrorResponse;
|
|
22
|
+
};
|
|
23
|
+
defaultErrorMessage: string;
|
|
24
|
+
};
|
|
25
|
+
type ErrorOptions = {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
};
|
|
28
|
+
declare class HTTPError<TErrorResponse = Record<string, unknown>> extends Error {
|
|
29
|
+
response: ErrorDetails<TErrorResponse>["response"];
|
|
30
|
+
name: "HTTPError";
|
|
31
|
+
isHTTPError: boolean;
|
|
32
|
+
constructor(errorDetails: ErrorDetails<TErrorResponse>, errorOptions?: ErrorOptions);
|
|
33
|
+
}
|
|
34
|
+
declare const isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
35
|
+
|
|
36
|
+
type $RequestConfig = Pick<FetchConfig, (typeof fetchSpecificKeys)[number]>;
|
|
37
|
+
type ExtraOptions<TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultStyleUnion = ResultStyleUnion> = {
|
|
38
|
+
body?: Record<string, unknown> | RequestInit["body"];
|
|
39
|
+
method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | AnyString;
|
|
40
|
+
query?: Record<string, string | number | boolean>;
|
|
41
|
+
bodySerializer?: (bodyData: Record<string, unknown>) => string;
|
|
42
|
+
responseParser?: {
|
|
43
|
+
(data: string): unknown;
|
|
44
|
+
<TData>(data: string): TData;
|
|
45
|
+
};
|
|
46
|
+
resultMode?: TBaseResultMode;
|
|
47
|
+
cancelRedundantRequests?: boolean;
|
|
48
|
+
baseURL?: string;
|
|
49
|
+
timeout?: number;
|
|
50
|
+
defaultErrorMessage?: string;
|
|
51
|
+
throwOnError?: boolean | ((error?: Error | HTTPError<TBaseErrorData>) => boolean);
|
|
52
|
+
responseType?: keyof ReturnType<typeof handleResponseType>;
|
|
53
|
+
retries?: number;
|
|
54
|
+
retryDelay?: number;
|
|
55
|
+
retryCodes?: Array<409 | 425 | 429 | 500 | 502 | 503 | 504 | AnyNumber>;
|
|
56
|
+
retryMethods?: Array<"GET" | "POST" | "PATCH" | "DELETE" | AnyString>;
|
|
57
|
+
meta?: Record<string, unknown>;
|
|
58
|
+
onRequest?: (requestContext: {
|
|
59
|
+
request: $RequestConfig;
|
|
60
|
+
options: ExtraOptions;
|
|
61
|
+
}) => void | Promise<void>;
|
|
62
|
+
onRequestError?: (requestContext: {
|
|
63
|
+
request: $RequestConfig;
|
|
64
|
+
error: Error;
|
|
65
|
+
options: ExtraOptions;
|
|
66
|
+
}) => void | Promise<void>;
|
|
67
|
+
onResponse?: (successContext: {
|
|
68
|
+
request: $RequestConfig;
|
|
69
|
+
response: Response & {
|
|
70
|
+
data: TBaseData;
|
|
71
|
+
};
|
|
72
|
+
options: ExtraOptions;
|
|
73
|
+
}) => void | Promise<void>;
|
|
74
|
+
onResponseError?: (errorContext: {
|
|
75
|
+
request: $RequestConfig;
|
|
76
|
+
response: Response & {
|
|
77
|
+
errorData: TBaseErrorData;
|
|
78
|
+
};
|
|
79
|
+
options: ExtraOptions;
|
|
80
|
+
}) => void | Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
interface FetchConfig<TData = unknown, TErrorData = unknown, TResultMode extends ResultStyleUnion = undefined> extends Omit<RequestInit, "method" | "body">, ExtraOptions<TData, TErrorData, TResultMode> {
|
|
83
|
+
}
|
|
84
|
+
interface BaseConfig<TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultStyleUnion = undefined> extends Omit<FetchConfig<TBaseData, TBaseErrorData, TBaseResultMode>, "body"> {
|
|
85
|
+
}
|
|
86
|
+
type ApiSuccessVariant<TData> = {
|
|
87
|
+
dataInfo: TData;
|
|
88
|
+
errorInfo: null;
|
|
89
|
+
response: Response;
|
|
90
|
+
};
|
|
91
|
+
type PossibleErrors = "AbortError" | "TimeoutError" | "SyntaxError" | "TypeError" | "Error" | "UnknownError";
|
|
92
|
+
type ApiErrorVariant<TErrorData> = {
|
|
93
|
+
dataInfo: null;
|
|
94
|
+
errorInfo: {
|
|
95
|
+
errorName: "HTTPError";
|
|
96
|
+
errorData: TErrorData;
|
|
97
|
+
message: string;
|
|
98
|
+
};
|
|
99
|
+
response: Response;
|
|
100
|
+
} | {
|
|
101
|
+
dataInfo: null;
|
|
102
|
+
errorInfo: {
|
|
103
|
+
errorName: PossibleErrors;
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
response: null;
|
|
107
|
+
};
|
|
108
|
+
type ResultStyleMap<TData = unknown, TErrorData = unknown> = {
|
|
109
|
+
all: ApiSuccessVariant<TData> | ApiErrorVariant<TErrorData>;
|
|
110
|
+
onlySuccess: TData;
|
|
111
|
+
onlyError: TErrorData;
|
|
112
|
+
onlyResponse: Response;
|
|
113
|
+
};
|
|
114
|
+
type ResultStyleUnion = {
|
|
115
|
+
_: {
|
|
116
|
+
[Key in keyof ResultStyleMap]: Key;
|
|
117
|
+
}[keyof ResultStyleMap] | undefined;
|
|
118
|
+
}["_"];
|
|
119
|
+
type GetCallApiResult<TData, TErrorData, TResultMode> = TResultMode extends NonNullable<ResultStyleUnion> ? ResultStyleMap<TData, TErrorData>[TResultMode] : ResultStyleMap<TData, TErrorData>["all"];
|
|
120
|
+
|
|
121
|
+
declare const callApi: {
|
|
122
|
+
<TData = unknown, TErrorData = unknown, TResultMode extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = undefined>(url: string, config?: FetchConfig<TData, TErrorData, TResultMode> | undefined): Promise<GetCallApiResult<TData, TErrorData, TResultMode>>;
|
|
123
|
+
create: <TBaseData, TBaseErrorData, TBaseResultMode extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = undefined>(baseConfig?: BaseConfig<TBaseData, TBaseErrorData, TBaseResultMode>) => {
|
|
124
|
+
<TData_1 = TBaseData, TErrorData_1 = TBaseErrorData, TResultMode_1 extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = TBaseResultMode>(url: string, config?: FetchConfig<TData_1, TErrorData_1, TResultMode_1> | undefined): Promise<GetCallApiResult<TData_1, TErrorData_1, TResultMode_1>>;
|
|
125
|
+
create: any;
|
|
126
|
+
isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
127
|
+
errorName: "HTTPError";
|
|
128
|
+
};
|
|
129
|
+
isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
130
|
+
cancel(url: string): void | undefined;
|
|
131
|
+
};
|
|
132
|
+
isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
133
|
+
errorName: "HTTPError";
|
|
134
|
+
};
|
|
135
|
+
isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
136
|
+
cancel(url: string): void | undefined;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export { type BaseConfig, type FetchConfig, HTTPError, callApi, isHTTPErrorInfo, isHTTPErrorInstance };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
type AnyString = string & {
|
|
2
|
+
placeholder?: never;
|
|
3
|
+
};
|
|
4
|
+
type AnyNumber = number & {
|
|
5
|
+
placeholder?: never;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
declare const fetchSpecificKeys: ("headers" | "body" | "method" | "cache" | "credentials" | "integrity" | "keepalive" | "mode" | "priority" | "redirect" | "referrer" | "referrerPolicy" | "signal" | "window")[];
|
|
9
|
+
declare const handleResponseType: <TResponse>(response: Response, parser?: Required<ExtraOptions>["responseParser"]) => {
|
|
10
|
+
json: () => Promise<TResponse>;
|
|
11
|
+
arrayBuffer: () => Promise<TResponse>;
|
|
12
|
+
blob: () => Promise<TResponse>;
|
|
13
|
+
formData: () => Promise<TResponse>;
|
|
14
|
+
text: () => Promise<TResponse>;
|
|
15
|
+
};
|
|
16
|
+
declare const isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
17
|
+
errorName: "HTTPError";
|
|
18
|
+
};
|
|
19
|
+
type ErrorDetails<TErrorResponse> = {
|
|
20
|
+
response: Response & {
|
|
21
|
+
errorData: TErrorResponse;
|
|
22
|
+
};
|
|
23
|
+
defaultErrorMessage: string;
|
|
24
|
+
};
|
|
25
|
+
type ErrorOptions = {
|
|
26
|
+
cause?: unknown;
|
|
27
|
+
};
|
|
28
|
+
declare class HTTPError<TErrorResponse = Record<string, unknown>> extends Error {
|
|
29
|
+
response: ErrorDetails<TErrorResponse>["response"];
|
|
30
|
+
name: "HTTPError";
|
|
31
|
+
isHTTPError: boolean;
|
|
32
|
+
constructor(errorDetails: ErrorDetails<TErrorResponse>, errorOptions?: ErrorOptions);
|
|
33
|
+
}
|
|
34
|
+
declare const isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
35
|
+
|
|
36
|
+
type $RequestConfig = Pick<FetchConfig, (typeof fetchSpecificKeys)[number]>;
|
|
37
|
+
type ExtraOptions<TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultStyleUnion = ResultStyleUnion> = {
|
|
38
|
+
body?: Record<string, unknown> | RequestInit["body"];
|
|
39
|
+
method?: "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | AnyString;
|
|
40
|
+
query?: Record<string, string | number | boolean>;
|
|
41
|
+
bodySerializer?: (bodyData: Record<string, unknown>) => string;
|
|
42
|
+
responseParser?: {
|
|
43
|
+
(data: string): unknown;
|
|
44
|
+
<TData>(data: string): TData;
|
|
45
|
+
};
|
|
46
|
+
resultMode?: TBaseResultMode;
|
|
47
|
+
cancelRedundantRequests?: boolean;
|
|
48
|
+
baseURL?: string;
|
|
49
|
+
timeout?: number;
|
|
50
|
+
defaultErrorMessage?: string;
|
|
51
|
+
throwOnError?: boolean | ((error?: Error | HTTPError<TBaseErrorData>) => boolean);
|
|
52
|
+
responseType?: keyof ReturnType<typeof handleResponseType>;
|
|
53
|
+
retries?: number;
|
|
54
|
+
retryDelay?: number;
|
|
55
|
+
retryCodes?: Array<409 | 425 | 429 | 500 | 502 | 503 | 504 | AnyNumber>;
|
|
56
|
+
retryMethods?: Array<"GET" | "POST" | "PATCH" | "DELETE" | AnyString>;
|
|
57
|
+
meta?: Record<string, unknown>;
|
|
58
|
+
onRequest?: (requestContext: {
|
|
59
|
+
request: $RequestConfig;
|
|
60
|
+
options: ExtraOptions;
|
|
61
|
+
}) => void | Promise<void>;
|
|
62
|
+
onRequestError?: (requestContext: {
|
|
63
|
+
request: $RequestConfig;
|
|
64
|
+
error: Error;
|
|
65
|
+
options: ExtraOptions;
|
|
66
|
+
}) => void | Promise<void>;
|
|
67
|
+
onResponse?: (successContext: {
|
|
68
|
+
request: $RequestConfig;
|
|
69
|
+
response: Response & {
|
|
70
|
+
data: TBaseData;
|
|
71
|
+
};
|
|
72
|
+
options: ExtraOptions;
|
|
73
|
+
}) => void | Promise<void>;
|
|
74
|
+
onResponseError?: (errorContext: {
|
|
75
|
+
request: $RequestConfig;
|
|
76
|
+
response: Response & {
|
|
77
|
+
errorData: TBaseErrorData;
|
|
78
|
+
};
|
|
79
|
+
options: ExtraOptions;
|
|
80
|
+
}) => void | Promise<void>;
|
|
81
|
+
};
|
|
82
|
+
interface FetchConfig<TData = unknown, TErrorData = unknown, TResultMode extends ResultStyleUnion = undefined> extends Omit<RequestInit, "method" | "body">, ExtraOptions<TData, TErrorData, TResultMode> {
|
|
83
|
+
}
|
|
84
|
+
interface BaseConfig<TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultStyleUnion = undefined> extends Omit<FetchConfig<TBaseData, TBaseErrorData, TBaseResultMode>, "body"> {
|
|
85
|
+
}
|
|
86
|
+
type ApiSuccessVariant<TData> = {
|
|
87
|
+
dataInfo: TData;
|
|
88
|
+
errorInfo: null;
|
|
89
|
+
response: Response;
|
|
90
|
+
};
|
|
91
|
+
type PossibleErrors = "AbortError" | "TimeoutError" | "SyntaxError" | "TypeError" | "Error" | "UnknownError";
|
|
92
|
+
type ApiErrorVariant<TErrorData> = {
|
|
93
|
+
dataInfo: null;
|
|
94
|
+
errorInfo: {
|
|
95
|
+
errorName: "HTTPError";
|
|
96
|
+
errorData: TErrorData;
|
|
97
|
+
message: string;
|
|
98
|
+
};
|
|
99
|
+
response: Response;
|
|
100
|
+
} | {
|
|
101
|
+
dataInfo: null;
|
|
102
|
+
errorInfo: {
|
|
103
|
+
errorName: PossibleErrors;
|
|
104
|
+
message: string;
|
|
105
|
+
};
|
|
106
|
+
response: null;
|
|
107
|
+
};
|
|
108
|
+
type ResultStyleMap<TData = unknown, TErrorData = unknown> = {
|
|
109
|
+
all: ApiSuccessVariant<TData> | ApiErrorVariant<TErrorData>;
|
|
110
|
+
onlySuccess: TData;
|
|
111
|
+
onlyError: TErrorData;
|
|
112
|
+
onlyResponse: Response;
|
|
113
|
+
};
|
|
114
|
+
type ResultStyleUnion = {
|
|
115
|
+
_: {
|
|
116
|
+
[Key in keyof ResultStyleMap]: Key;
|
|
117
|
+
}[keyof ResultStyleMap] | undefined;
|
|
118
|
+
}["_"];
|
|
119
|
+
type GetCallApiResult<TData, TErrorData, TResultMode> = TResultMode extends NonNullable<ResultStyleUnion> ? ResultStyleMap<TData, TErrorData>[TResultMode] : ResultStyleMap<TData, TErrorData>["all"];
|
|
120
|
+
|
|
121
|
+
declare const callApi: {
|
|
122
|
+
<TData = unknown, TErrorData = unknown, TResultMode extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = undefined>(url: string, config?: FetchConfig<TData, TErrorData, TResultMode> | undefined): Promise<GetCallApiResult<TData, TErrorData, TResultMode>>;
|
|
123
|
+
create: <TBaseData, TBaseErrorData, TBaseResultMode extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = undefined>(baseConfig?: BaseConfig<TBaseData, TBaseErrorData, TBaseResultMode>) => {
|
|
124
|
+
<TData_1 = TBaseData, TErrorData_1 = TBaseErrorData, TResultMode_1 extends "all" | "onlySuccess" | "onlyError" | "onlyResponse" | undefined = TBaseResultMode>(url: string, config?: FetchConfig<TData_1, TErrorData_1, TResultMode_1> | undefined): Promise<GetCallApiResult<TData_1, TErrorData_1, TResultMode_1>>;
|
|
125
|
+
create: any;
|
|
126
|
+
isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
127
|
+
errorName: "HTTPError";
|
|
128
|
+
};
|
|
129
|
+
isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
130
|
+
cancel(url: string): void | undefined;
|
|
131
|
+
};
|
|
132
|
+
isHTTPErrorInfo: (errorInfo: Record<string, unknown> | null) => errorInfo is {
|
|
133
|
+
errorName: "HTTPError";
|
|
134
|
+
};
|
|
135
|
+
isHTTPErrorInstance: <TErrorResponse>(error: unknown) => error is HTTPError<TErrorResponse>;
|
|
136
|
+
cancel(url: string): void | undefined;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
export { type BaseConfig, type FetchConfig, HTTPError, callApi, isHTTPErrorInfo, isHTTPErrorInstance };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"names":["default","isHTTPErrorInfo","HTTPError","isHTTPErrorInstance"],"mappings":"AAAA,OAAoB,WAAXA,MAA0B,sBAInC,OAAS,mBAAAC,EAAiB,aAAAC,EAAW,uBAAAC,MAA2B","sourcesContent":["export { default as callApi } from \"./createFetchClient\";\n\nexport type { FetchConfig, BaseConfig } from \"./types\";\n\nexport { isHTTPErrorInfo, HTTPError, isHTTPErrorInstance } from \"./utils\";\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zayne-labs/callapi",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A lightweight wrapper over fetch with quality of life improvements like built-in request cancellation, retries, interceptors and more",
|
|
6
|
+
"repository": "ryan-zayne/callApi",
|
|
7
|
+
"homepage": "https://github.com/ryan-zayne/callApi#readme",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "Ryan Zayne",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"fetch",
|
|
12
|
+
"api",
|
|
13
|
+
"wrapper",
|
|
14
|
+
"request cancellation",
|
|
15
|
+
"cancel",
|
|
16
|
+
"retry",
|
|
17
|
+
"interceptor"
|
|
18
|
+
],
|
|
19
|
+
"main": "./dist/index.cjs",
|
|
20
|
+
"module": "./dist/index.js",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"import": "./dist/index.js",
|
|
25
|
+
"require": "./dist/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@changesets/cli": "^2.27.5",
|
|
34
|
+
"@eslint/js": "^9.5.0",
|
|
35
|
+
"@zayne-labs/tsconfig": "^0.0.7",
|
|
36
|
+
"changelogen": "^0.5.5",
|
|
37
|
+
"eslint": "^9.5.0",
|
|
38
|
+
"eslint-plugin-import-x": "^0.5.1",
|
|
39
|
+
"eslint-plugin-jsdoc": "^48.2.12",
|
|
40
|
+
"eslint-plugin-sonarjs": "^1.0.3",
|
|
41
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
|
42
|
+
"globals": "^15.6.0",
|
|
43
|
+
"husky": "^9.0.11",
|
|
44
|
+
"lint-staged": "^15.2.7",
|
|
45
|
+
"prettier": "^3.3.2",
|
|
46
|
+
"tsup": "^8.1.0",
|
|
47
|
+
"typescript": "5.4.5",
|
|
48
|
+
"typescript-eslint": "^7.13.1"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"test:check-types": "tsc --pretty -p tsconfig.json",
|
|
52
|
+
"test:format": "prettier --write .",
|
|
53
|
+
"test:lint": "eslint src/**/*.ts --max-warnings 10 --report-unused-disable-directives",
|
|
54
|
+
"build": "tsup",
|
|
55
|
+
"build:dev": "tsup --watch",
|
|
56
|
+
"version-package": "changeset version",
|
|
57
|
+
"release": "changeset publish"
|
|
58
|
+
}
|
|
59
|
+
}
|