@isikk/core 0.6.0 → 0.7.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/drf/index.cjs +55 -0
- package/dist/drf/index.cjs.map +1 -0
- package/dist/drf/index.d.cts +27 -0
- package/dist/drf/index.d.ts +27 -0
- package/dist/drf/index.js +28 -0
- package/dist/drf/index.js.map +1 -0
- package/dist/next/request/index.cjs.map +1 -1
- package/dist/next/request/index.d.cts +2 -4
- package/dist/next/request/index.d.ts +2 -4
- package/dist/next/request/index.js.map +1 -1
- package/package.json +6 -1
|
@@ -0,0 +1,55 @@
|
|
|
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/drf/index.ts
|
|
21
|
+
var drf_exports = {};
|
|
22
|
+
__export(drf_exports, {
|
|
23
|
+
detailOf: () => detailOf,
|
|
24
|
+
messagesOf: () => messagesOf,
|
|
25
|
+
toFormErrors: () => toFormErrors
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(drf_exports);
|
|
28
|
+
function toFormErrors(body) {
|
|
29
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
|
|
30
|
+
const errors = {};
|
|
31
|
+
for (const [field, value] of Object.entries(body)) {
|
|
32
|
+
if (field === "detail") continue;
|
|
33
|
+
if (typeof value === "string") errors[field] = [value];
|
|
34
|
+
else if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) errors[field] = value;
|
|
35
|
+
}
|
|
36
|
+
return Object.keys(errors).length > 0 ? errors : void 0;
|
|
37
|
+
}
|
|
38
|
+
function detailOf(body) {
|
|
39
|
+
if (!body) return void 0;
|
|
40
|
+
const detail = body.detail;
|
|
41
|
+
return typeof detail === "string" ? detail : void 0;
|
|
42
|
+
}
|
|
43
|
+
function messagesOf(errors) {
|
|
44
|
+
if (!errors) return void 0;
|
|
45
|
+
const { non_field_errors: nonField = [], ...fields } = errors;
|
|
46
|
+
const messages = [...nonField, ...Object.values(fields).flat()];
|
|
47
|
+
return messages.length > 0 ? messages.join(" ") : void 0;
|
|
48
|
+
}
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
detailOf,
|
|
52
|
+
messagesOf,
|
|
53
|
+
toFormErrors
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/drf/index.ts"],"sourcesContent":["export type FormErrors = Record<string, string[]> & { non_field_errors?: string[] }\n\n/**\n * DRF refuses in two shapes, and which one arrives is decided by the status.\n *\n * A 400 is a validation failure and carries the fields: `{name: [\"This field may not be blank.\"]}`,\n * with `non_field_errors` for anything about the form as a whole. Everything else - 401, 403, 404,\n * 409 - carries `{detail: \"one sentence\"}`, written for a person by whoever raised it.\n *\n * This reads the first shape; `detailOf` reads the second.\n */\nexport function toFormErrors(body: unknown): FormErrors | undefined {\n if (!body || typeof body !== 'object' || Array.isArray(body)) return undefined\n\n const errors: FormErrors = {}\n for (const [field, value] of Object.entries(body as Record<string, unknown>)) {\n // `detail` is the other shape, not a field. A serializer with a field genuinely called `detail`\n // would lose it here - that is the price of keeping the two shapes apart.\n if (field === 'detail') continue\n if (typeof value === 'string') errors[field] = [value]\n else if (Array.isArray(value) && value.every((entry) => typeof entry === 'string')) errors[field] = value\n }\n return Object.keys(errors).length > 0 ? errors : undefined\n}\n\n/** The sentence DRF wrote for a refusal that is not about a field. */\nexport function detailOf(body: unknown): string | undefined {\n // `!body` is the whole guard: reading a property off a primitive is legal, and the two values that\n // would throw are the two this catches.\n if (!body) return undefined\n const detail = (body as { detail?: unknown }).detail\n return typeof detail === 'string' ? detail : undefined\n}\n\n/**\n * Every message in a refusal, as one line, for a caller with nowhere to put them per field.\n *\n * A button or a switch gets the same 400 body a form does. Keeping only `non_field_errors` there\n * would lose the only thing the server said.\n *\n * The field names are left out: they are the serializer's `snake_case`, and DRF's messages read as\n * whole sentences without them.\n */\nexport function messagesOf(errors: FormErrors | undefined): string | undefined {\n if (!errors) return undefined\n const { non_field_errors: nonField = [], ...fields } = errors\n const messages = [...nonField, ...Object.values(fields).flat()]\n return messages.length > 0 ? messages.join(' ') : undefined\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWO,SAAS,aAAa,MAAuC;AAClE,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO;AAErE,QAAM,SAAqB,CAAC;AAC5B,aAAW,CAAC,OAAO,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAG5E,QAAI,UAAU,SAAU;AACxB,QAAI,OAAO,UAAU,SAAU,QAAO,KAAK,IAAI,CAAC,KAAK;AAAA,aAC5C,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,UAAU,OAAO,UAAU,QAAQ,EAAG,QAAO,KAAK,IAAI;AAAA,EACtG;AACA,SAAO,OAAO,KAAK,MAAM,EAAE,SAAS,IAAI,SAAS;AACnD;AAGO,SAAS,SAAS,MAAmC;AAG1D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,SAAU,KAA8B;AAC9C,SAAO,OAAO,WAAW,WAAW,SAAS;AAC/C;AAWO,SAAS,WAAW,QAAoD;AAC7E,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,EAAE,kBAAkB,WAAW,CAAC,GAAG,GAAG,OAAO,IAAI;AACvD,QAAM,WAAW,CAAC,GAAG,UAAU,GAAG,OAAO,OAAO,MAAM,EAAE,KAAK,CAAC;AAC9D,SAAO,SAAS,SAAS,IAAI,SAAS,KAAK,GAAG,IAAI;AACpD;","names":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type FormErrors = Record<string, string[]> & {
|
|
2
|
+
non_field_errors?: string[];
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* DRF refuses in two shapes, and which one arrives is decided by the status.
|
|
6
|
+
*
|
|
7
|
+
* A 400 is a validation failure and carries the fields: `{name: ["This field may not be blank."]}`,
|
|
8
|
+
* with `non_field_errors` for anything about the form as a whole. Everything else - 401, 403, 404,
|
|
9
|
+
* 409 - carries `{detail: "one sentence"}`, written for a person by whoever raised it.
|
|
10
|
+
*
|
|
11
|
+
* This reads the first shape; `detailOf` reads the second.
|
|
12
|
+
*/
|
|
13
|
+
declare function toFormErrors(body: unknown): FormErrors | undefined;
|
|
14
|
+
/** The sentence DRF wrote for a refusal that is not about a field. */
|
|
15
|
+
declare function detailOf(body: unknown): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Every message in a refusal, as one line, for a caller with nowhere to put them per field.
|
|
18
|
+
*
|
|
19
|
+
* A button or a switch gets the same 400 body a form does. Keeping only `non_field_errors` there
|
|
20
|
+
* would lose the only thing the server said.
|
|
21
|
+
*
|
|
22
|
+
* The field names are left out: they are the serializer's `snake_case`, and DRF's messages read as
|
|
23
|
+
* whole sentences without them.
|
|
24
|
+
*/
|
|
25
|
+
declare function messagesOf(errors: FormErrors | undefined): string | undefined;
|
|
26
|
+
|
|
27
|
+
export { type FormErrors, detailOf, messagesOf, toFormErrors };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type FormErrors = Record<string, string[]> & {
|
|
2
|
+
non_field_errors?: string[];
|
|
3
|
+
};
|
|
4
|
+
/**
|
|
5
|
+
* DRF refuses in two shapes, and which one arrives is decided by the status.
|
|
6
|
+
*
|
|
7
|
+
* A 400 is a validation failure and carries the fields: `{name: ["This field may not be blank."]}`,
|
|
8
|
+
* with `non_field_errors` for anything about the form as a whole. Everything else - 401, 403, 404,
|
|
9
|
+
* 409 - carries `{detail: "one sentence"}`, written for a person by whoever raised it.
|
|
10
|
+
*
|
|
11
|
+
* This reads the first shape; `detailOf` reads the second.
|
|
12
|
+
*/
|
|
13
|
+
declare function toFormErrors(body: unknown): FormErrors | undefined;
|
|
14
|
+
/** The sentence DRF wrote for a refusal that is not about a field. */
|
|
15
|
+
declare function detailOf(body: unknown): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Every message in a refusal, as one line, for a caller with nowhere to put them per field.
|
|
18
|
+
*
|
|
19
|
+
* A button or a switch gets the same 400 body a form does. Keeping only `non_field_errors` there
|
|
20
|
+
* would lose the only thing the server said.
|
|
21
|
+
*
|
|
22
|
+
* The field names are left out: they are the serializer's `snake_case`, and DRF's messages read as
|
|
23
|
+
* whole sentences without them.
|
|
24
|
+
*/
|
|
25
|
+
declare function messagesOf(errors: FormErrors | undefined): string | undefined;
|
|
26
|
+
|
|
27
|
+
export { type FormErrors, detailOf, messagesOf, toFormErrors };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// src/drf/index.ts
|
|
2
|
+
function toFormErrors(body) {
|
|
3
|
+
if (!body || typeof body !== "object" || Array.isArray(body)) return void 0;
|
|
4
|
+
const errors = {};
|
|
5
|
+
for (const [field, value] of Object.entries(body)) {
|
|
6
|
+
if (field === "detail") continue;
|
|
7
|
+
if (typeof value === "string") errors[field] = [value];
|
|
8
|
+
else if (Array.isArray(value) && value.every((entry) => typeof entry === "string")) errors[field] = value;
|
|
9
|
+
}
|
|
10
|
+
return Object.keys(errors).length > 0 ? errors : void 0;
|
|
11
|
+
}
|
|
12
|
+
function detailOf(body) {
|
|
13
|
+
if (!body) return void 0;
|
|
14
|
+
const detail = body.detail;
|
|
15
|
+
return typeof detail === "string" ? detail : void 0;
|
|
16
|
+
}
|
|
17
|
+
function messagesOf(errors) {
|
|
18
|
+
if (!errors) return void 0;
|
|
19
|
+
const { non_field_errors: nonField = [], ...fields } = errors;
|
|
20
|
+
const messages = [...nonField, ...Object.values(fields).flat()];
|
|
21
|
+
return messages.length > 0 ? messages.join(" ") : void 0;
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
detailOf,
|
|
25
|
+
messagesOf,
|
|
26
|
+
toFormErrors
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/drf/index.ts"],"sourcesContent":["export type FormErrors = Record<string, string[]> & { non_field_errors?: string[] }\n\n/**\n * DRF refuses in two shapes, and which one arrives is decided by the status.\n *\n * A 400 is a validation failure and carries the fields: `{name: [\"This field may not be blank.\"]}`,\n * with `non_field_errors` for anything about the form as a whole. Everything else - 401, 403, 404,\n * 409 - carries `{detail: \"one sentence\"}`, written for a person by whoever raised it.\n *\n * This reads the first shape; `detailOf` reads the second.\n */\nexport function toFormErrors(body: unknown): FormErrors | undefined {\n if (!body || typeof body !== 'object' || Array.isArray(body)) return undefined\n\n const errors: FormErrors = {}\n for (const [field, value] of Object.entries(body as Record<string, unknown>)) {\n // `detail` is the other shape, not a field. A serializer with a field genuinely called `detail`\n // would lose it here - that is the price of keeping the two shapes apart.\n if (field === 'detail') continue\n if (typeof value === 'string') errors[field] = [value]\n else if (Array.isArray(value) && value.every((entry) => typeof entry === 'string')) errors[field] = value\n }\n return Object.keys(errors).length > 0 ? errors : undefined\n}\n\n/** The sentence DRF wrote for a refusal that is not about a field. */\nexport function detailOf(body: unknown): string | undefined {\n // `!body` is the whole guard: reading a property off a primitive is legal, and the two values that\n // would throw are the two this catches.\n if (!body) return undefined\n const detail = (body as { detail?: unknown }).detail\n return typeof detail === 'string' ? detail : undefined\n}\n\n/**\n * Every message in a refusal, as one line, for a caller with nowhere to put them per field.\n *\n * A button or a switch gets the same 400 body a form does. Keeping only `non_field_errors` there\n * would lose the only thing the server said.\n *\n * The field names are left out: they are the serializer's `snake_case`, and DRF's messages read as\n * whole sentences without them.\n */\nexport function messagesOf(errors: FormErrors | undefined): string | undefined {\n if (!errors) return undefined\n const { non_field_errors: nonField = [], ...fields } = errors\n const messages = [...nonField, ...Object.values(fields).flat()]\n return messages.length > 0 ? messages.join(' ') : undefined\n}\n"],"mappings":";AAWO,SAAS,aAAa,MAAuC;AAClE,MAAI,CAAC,QAAQ,OAAO,SAAS,YAAY,MAAM,QAAQ,IAAI,EAAG,QAAO;AAErE,QAAM,SAAqB,CAAC;AAC5B,aAAW,CAAC,OAAO,KAAK,KAAK,OAAO,QAAQ,IAA+B,GAAG;AAG5E,QAAI,UAAU,SAAU;AACxB,QAAI,OAAO,UAAU,SAAU,QAAO,KAAK,IAAI,CAAC,KAAK;AAAA,aAC5C,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,UAAU,OAAO,UAAU,QAAQ,EAAG,QAAO,KAAK,IAAI;AAAA,EACtG;AACA,SAAO,OAAO,KAAK,MAAM,EAAE,SAAS,IAAI,SAAS;AACnD;AAGO,SAAS,SAAS,MAAmC;AAG1D,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,SAAU,KAA8B;AAC9C,SAAO,OAAO,WAAW,WAAW,SAAS;AAC/C;AAWO,SAAS,WAAW,QAAoD;AAC7E,MAAI,CAAC,OAAQ,QAAO;AACpB,QAAM,EAAE,kBAAkB,WAAW,CAAC,GAAG,GAAG,OAAO,IAAI;AACvD,QAAM,WAAW,CAAC,GAAG,UAAU,GAAG,OAAO,OAAO,MAAM,EAAE,KAAK,CAAC;AAC9D,SAAO,SAAS,SAAS,IAAI,SAAS,KAAK,GAAG,IAAI;AACpD;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/next/request.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"sources":["../../../src/next/request.ts"],"sourcesContent":["/**\n * Only a same-origin relative path passes: `//host` is protocol-relative and would send the\n * visitor off-site, so a `next` query param can't be turned into an open redirect.\n */\nexport function getSafeRedirect(next: unknown, fallback: string = '/'): string {\n if (typeof next !== 'string' || !next.startsWith('/') || next.startsWith('//')) {\n return fallback\n }\n return next\n}\n\nconst DEFAULT_LOCAL_DEV_HOSTS: RegExp[] = [/^localhost(:\\d+)?$/, /^127\\.0\\.0\\.1(:\\d+)?$/]\n\nfunction isDefaultLocalDevHost(host: string): boolean {\n return DEFAULT_LOCAL_DEV_HOSTS.some((pattern) => pattern.test(host))\n}\n\nexport interface GetRequestOriginOptions {\n /** Overrides how a \"known local-dev host\" (assumed http, not https) is detected. */\n isLocalDevHost?: (host: string) => boolean\n}\n\n/**\n * Resolves the true external origin (e.g. `https://real.host`) of an incoming request from its\n * `X-Forwarded-*` headers, for server-side code that needs to build an absolute URL back to\n * itself behind a reverse proxy. Trusts `X-Forwarded-Proto` when present; otherwise falls back to\n * `isLocalDevHost` to decide between `http`/`https`, since local dev typically has no proxy\n * setting that header. Throws if neither `X-Forwarded-Host` nor `Host` is present.\n */\nexport function getRequestOrigin(headers: Headers, options: GetRequestOriginOptions = {}): string {\n const isLocalDevHost = options.isLocalDevHost ?? isDefaultLocalDevHost\n const host = headers.get('x-forwarded-host') ?? headers.get('host')\n if (!host) {\n throw new Error('getRequestOrigin: request has neither an X-Forwarded-Host nor a Host header')\n }\n\n const protocol = headers.get('x-forwarded-proto') ?? (isLocalDevHost(host) ? 'http' : 'https')\n return `${protocol}://${host}`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,SAAS,gBAAgB,MAAe,WAAmB,KAAa;AAC7E,MAAI,OAAO,SAAS,YAAY,CAAC,KAAK,WAAW,GAAG,KAAK,KAAK,WAAW,IAAI,GAAG;AAC9E,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,0BAAoC,CAAC,sBAAsB,uBAAuB;AAExF,SAAS,sBAAsB,MAAuB;AACpD,SAAO,wBAAwB,KAAK,CAAC,YAAY,QAAQ,KAAK,IAAI,CAAC;AACrE;AAcO,SAAS,iBAAiB,SAAkB,UAAmC,CAAC,GAAW;AAChG,QAAM,iBAAiB,QAAQ,kBAAkB;AACjD,QAAM,OAAO,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,IAAI,MAAM;AAClE,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,6EAA6E;AAAA,EAC/F;AAEA,QAAM,WAAW,QAAQ,IAAI,mBAAmB,MAAM,eAAe,IAAI,IAAI,SAAS;AACtF,SAAO,GAAG,QAAQ,MAAM,IAAI;AAC9B;","names":[]}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `/`, or starts with `//` (protocol-relative, i.e. an off-site redirect) - falling back to
|
|
5
|
-
* `fallback` otherwise, so callers always get a definite path back.
|
|
2
|
+
* Only a same-origin relative path passes: `//host` is protocol-relative and would send the
|
|
3
|
+
* visitor off-site, so a `next` query param can't be turned into an open redirect.
|
|
6
4
|
*/
|
|
7
5
|
declare function getSafeRedirect(next: unknown, fallback?: string): string;
|
|
8
6
|
interface GetRequestOriginOptions {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* `/`, or starts with `//` (protocol-relative, i.e. an off-site redirect) - falling back to
|
|
5
|
-
* `fallback` otherwise, so callers always get a definite path back.
|
|
2
|
+
* Only a same-origin relative path passes: `//host` is protocol-relative and would send the
|
|
3
|
+
* visitor off-site, so a `next` query param can't be turned into an open redirect.
|
|
6
4
|
*/
|
|
7
5
|
declare function getSafeRedirect(next: unknown, fallback?: string): string;
|
|
8
6
|
interface GetRequestOriginOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/next/request.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"sources":["../../../src/next/request.ts"],"sourcesContent":["/**\n * Only a same-origin relative path passes: `//host` is protocol-relative and would send the\n * visitor off-site, so a `next` query param can't be turned into an open redirect.\n */\nexport function getSafeRedirect(next: unknown, fallback: string = '/'): string {\n if (typeof next !== 'string' || !next.startsWith('/') || next.startsWith('//')) {\n return fallback\n }\n return next\n}\n\nconst DEFAULT_LOCAL_DEV_HOSTS: RegExp[] = [/^localhost(:\\d+)?$/, /^127\\.0\\.0\\.1(:\\d+)?$/]\n\nfunction isDefaultLocalDevHost(host: string): boolean {\n return DEFAULT_LOCAL_DEV_HOSTS.some((pattern) => pattern.test(host))\n}\n\nexport interface GetRequestOriginOptions {\n /** Overrides how a \"known local-dev host\" (assumed http, not https) is detected. */\n isLocalDevHost?: (host: string) => boolean\n}\n\n/**\n * Resolves the true external origin (e.g. `https://real.host`) of an incoming request from its\n * `X-Forwarded-*` headers, for server-side code that needs to build an absolute URL back to\n * itself behind a reverse proxy. Trusts `X-Forwarded-Proto` when present; otherwise falls back to\n * `isLocalDevHost` to decide between `http`/`https`, since local dev typically has no proxy\n * setting that header. Throws if neither `X-Forwarded-Host` nor `Host` is present.\n */\nexport function getRequestOrigin(headers: Headers, options: GetRequestOriginOptions = {}): string {\n const isLocalDevHost = options.isLocalDevHost ?? isDefaultLocalDevHost\n const host = headers.get('x-forwarded-host') ?? headers.get('host')\n if (!host) {\n throw new Error('getRequestOrigin: request has neither an X-Forwarded-Host nor a Host header')\n }\n\n const protocol = headers.get('x-forwarded-proto') ?? (isLocalDevHost(host) ? 'http' : 'https')\n return `${protocol}://${host}`\n}\n"],"mappings":";AAIO,SAAS,gBAAgB,MAAe,WAAmB,KAAa;AAC7E,MAAI,OAAO,SAAS,YAAY,CAAC,KAAK,WAAW,GAAG,KAAK,KAAK,WAAW,IAAI,GAAG;AAC9E,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEA,IAAM,0BAAoC,CAAC,sBAAsB,uBAAuB;AAExF,SAAS,sBAAsB,MAAuB;AACpD,SAAO,wBAAwB,KAAK,CAAC,YAAY,QAAQ,KAAK,IAAI,CAAC;AACrE;AAcO,SAAS,iBAAiB,SAAkB,UAAmC,CAAC,GAAW;AAChG,QAAM,iBAAiB,QAAQ,kBAAkB;AACjD,QAAM,OAAO,QAAQ,IAAI,kBAAkB,KAAK,QAAQ,IAAI,MAAM;AAClE,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,6EAA6E;AAAA,EAC/F;AAEA,QAAM,WAAW,QAAQ,IAAI,mBAAmB,MAAM,eAAe,IAAI,IAAI,SAAS;AACtF,SAAO,GAAG,QAAQ,MAAM,IAAI;AAC9B;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isikk/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Everyday TypeScript utilities.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -38,6 +38,11 @@
|
|
|
38
38
|
"import": "./dist/hooks/index.js",
|
|
39
39
|
"require": "./dist/hooks/index.cjs"
|
|
40
40
|
},
|
|
41
|
+
"./drf": {
|
|
42
|
+
"types": "./dist/drf/index.d.ts",
|
|
43
|
+
"import": "./dist/drf/index.js",
|
|
44
|
+
"require": "./dist/drf/index.cjs"
|
|
45
|
+
},
|
|
41
46
|
"./node": {
|
|
42
47
|
"types": "./dist/node/index.d.ts",
|
|
43
48
|
"import": "./dist/node/index.js",
|