@shware/http 1.1.2 → 1.1.5
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/hono/handler.cjs +1 -0
- package/dist/hono/handler.cjs.map +1 -1
- package/dist/hono/handler.mjs +1 -0
- package/dist/hono/handler.mjs.map +1 -1
- package/dist/hono/index.d.cts +2 -2
- package/dist/hono/index.d.ts +2 -2
- package/dist/hono/validator.cjs +6 -6
- package/dist/hono/validator.cjs.map +1 -1
- package/dist/hono/validator.d.cts +4 -4
- package/dist/hono/validator.d.ts +4 -4
- package/dist/hono/validator.mjs +1 -1
- package/dist/hono/validator.mjs.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/iso/iso_3601_1.cjs +292 -0
- package/dist/iso/iso_3601_1.cjs.map +1 -0
- package/dist/iso/iso_3601_1.d.cts +9 -0
- package/dist/iso/iso_3601_1.d.ts +9 -0
- package/dist/iso/iso_3601_1.mjs +267 -0
- package/dist/iso/iso_3601_1.mjs.map +1 -0
- package/dist/response.cjs +9 -7
- package/dist/response.cjs.map +1 -1
- package/dist/response.d.cts +5 -5
- package/dist/response.d.ts +5 -5
- package/dist/response.mjs +5 -3
- package/dist/response.mjs.map +1 -1
- package/dist/vaild.cjs.map +1 -1
- package/dist/vaild.d.cts +1 -1
- package/dist/vaild.d.ts +1 -1
- package/dist/vaild.mjs.map +1 -1
- package/package.json +3 -3
package/dist/hono/handler.cjs
CHANGED
|
@@ -59,6 +59,7 @@ function errorHandler(error, c) {
|
|
|
59
59
|
});
|
|
60
60
|
return import_status.Status.internal("Axios error").response(details);
|
|
61
61
|
}
|
|
62
|
+
console.error(`serving data: ${servingData}`);
|
|
62
63
|
console.error(error);
|
|
63
64
|
return import_status.Status.internal("Unknown error").response(details);
|
|
64
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/handler.ts"],"sourcesContent":["import { Details, DetailType } from '../error/detail';\nimport { Status, StatusError } from '../error/status';\nimport type { AxiosError } from 'axios';\nimport type { Context } from 'hono';\nimport type { RequestIdVariables } from 'hono/request-id';\nimport type { HTTPResponseError, Bindings } from 'hono/types';\nimport type { ContentfulStatusCode } from 'hono/utils/http-status';\n\ntype Env = {\n Variables: RequestIdVariables;\n Bindings?: Bindings;\n};\n\nexport function isAxiosError(payload: unknown): payload is AxiosError {\n return (\n payload !== null &&\n typeof payload === 'object' &&\n 'isAxiosError' in payload &&\n payload.isAxiosError === true\n );\n}\n\nexport function errorHandler<E extends Env = never>(\n error: Error | HTTPResponseError,\n c: Context<E>\n): Response | Promise<Response> {\n const requestId = c.get('requestId');\n const servingData = `${c.req.method}: ${c.req.path}`;\n const details = Details.new().requestInfo({ requestId, servingData });\n\n if (error instanceof StatusError) {\n error.body?.error?.details?.push(...details.list);\n const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);\n if (badRequest) {\n console.warn({ requestId, servingData, ...badRequest });\n }\n return c.json(error.body, error.status as ContentfulStatusCode);\n }\n\n if (error instanceof SyntaxError) {\n if (/^Cannot convert .* to a BigInt$/.test(error.message)) {\n return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);\n }\n }\n\n if (isAxiosError(error)) {\n console.error({\n status: error.status,\n message: error.message,\n request: {\n method: error.config?.method,\n url: error.config?.url,\n data: error.config?.data,\n },\n response: { data: error.response?.data },\n });\n return Status.internal('Axios error').response(details);\n }\n\n console.error(error);\n return Status.internal('Unknown error').response(details);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoC;AACpC,oBAAoC;AAY7B,SAAS,aAAa,SAAyC;AACpE,SACE,YAAY,QACZ,OAAO,YAAY,YACnB,kBAAkB,WAClB,QAAQ,iBAAiB;AAE7B;AAEO,SAAS,aACd,OACA,GAC8B;AAC9B,QAAM,YAAY,EAAE,IAAI,WAAW;AACnC,QAAM,cAAc,GAAG,EAAE,IAAI,MAAM,KAAK,EAAE,IAAI,IAAI;AAClD,QAAM,UAAU,sBAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,YAAY,CAAC;AAEpE,MAAI,iBAAiB,2BAAa;AAChC,UAAM,MAAM,OAAO,SAAS,KAAK,GAAG,QAAQ,IAAI;AAChD,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,yBAAW,WAAW;AAC3F,QAAI,YAAY;AACd,cAAQ,KAAK,EAAE,WAAW,aAAa,GAAG,WAAW,CAAC;AAAA,IACxD;AACA,WAAO,EAAE,KAAK,MAAM,MAAM,MAAM,MAA8B;AAAA,EAChE;AAEA,MAAI,iBAAiB,aAAa;AAChC,QAAI,kCAAkC,KAAK,MAAM,OAAO,GAAG;AACzD,aAAO,qBAAO,gBAAgB,mBAAmB,MAAM,OAAO,EAAE,EAAE,SAAS,OAAO;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,SAAS;AAAA,QACP,QAAQ,MAAM,QAAQ;AAAA,QACtB,KAAK,MAAM,QAAQ;AAAA,QACnB,MAAM,MAAM,QAAQ;AAAA,MACtB;AAAA,MACA,UAAU,EAAE,MAAM,MAAM,UAAU,KAAK;AAAA,IACzC,CAAC;AACD,WAAO,qBAAO,SAAS,aAAa,EAAE,SAAS,OAAO;AAAA,EACxD;AAEA,UAAQ,MAAM,KAAK;AACnB,SAAO,qBAAO,SAAS,eAAe,EAAE,SAAS,OAAO;AAC1D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hono/handler.ts"],"sourcesContent":["import { Details, DetailType } from '../error/detail';\nimport { Status, StatusError } from '../error/status';\nimport type { AxiosError } from 'axios';\nimport type { Context } from 'hono';\nimport type { RequestIdVariables } from 'hono/request-id';\nimport type { HTTPResponseError, Bindings } from 'hono/types';\nimport type { ContentfulStatusCode } from 'hono/utils/http-status';\n\ntype Env = {\n Variables: RequestIdVariables;\n Bindings?: Bindings;\n};\n\nexport function isAxiosError(payload: unknown): payload is AxiosError {\n return (\n payload !== null &&\n typeof payload === 'object' &&\n 'isAxiosError' in payload &&\n payload.isAxiosError === true\n );\n}\n\nexport function errorHandler<E extends Env = never>(\n error: Error | HTTPResponseError,\n c: Context<E>\n): Response | Promise<Response> {\n const requestId = c.get('requestId');\n const servingData = `${c.req.method}: ${c.req.path}`;\n const details = Details.new().requestInfo({ requestId, servingData });\n\n if (error instanceof StatusError) {\n error.body?.error?.details?.push(...details.list);\n const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);\n if (badRequest) {\n console.warn({ requestId, servingData, ...badRequest });\n }\n return c.json(error.body, error.status as ContentfulStatusCode);\n }\n\n if (error instanceof SyntaxError) {\n if (/^Cannot convert .* to a BigInt$/.test(error.message)) {\n return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);\n }\n }\n\n if (isAxiosError(error)) {\n console.error({\n status: error.status,\n message: error.message,\n request: {\n method: error.config?.method,\n url: error.config?.url,\n data: error.config?.data,\n },\n response: { data: error.response?.data },\n });\n return Status.internal('Axios error').response(details);\n }\n\n console.error(`serving data: ${servingData}`);\n console.error(error);\n return Status.internal('Unknown error').response(details);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAoC;AACpC,oBAAoC;AAY7B,SAAS,aAAa,SAAyC;AACpE,SACE,YAAY,QACZ,OAAO,YAAY,YACnB,kBAAkB,WAClB,QAAQ,iBAAiB;AAE7B;AAEO,SAAS,aACd,OACA,GAC8B;AAC9B,QAAM,YAAY,EAAE,IAAI,WAAW;AACnC,QAAM,cAAc,GAAG,EAAE,IAAI,MAAM,KAAK,EAAE,IAAI,IAAI;AAClD,QAAM,UAAU,sBAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,YAAY,CAAC;AAEpE,MAAI,iBAAiB,2BAAa;AAChC,UAAM,MAAM,OAAO,SAAS,KAAK,GAAG,QAAQ,IAAI;AAChD,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,yBAAW,WAAW;AAC3F,QAAI,YAAY;AACd,cAAQ,KAAK,EAAE,WAAW,aAAa,GAAG,WAAW,CAAC;AAAA,IACxD;AACA,WAAO,EAAE,KAAK,MAAM,MAAM,MAAM,MAA8B;AAAA,EAChE;AAEA,MAAI,iBAAiB,aAAa;AAChC,QAAI,kCAAkC,KAAK,MAAM,OAAO,GAAG;AACzD,aAAO,qBAAO,gBAAgB,mBAAmB,MAAM,OAAO,EAAE,EAAE,SAAS,OAAO;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,SAAS;AAAA,QACP,QAAQ,MAAM,QAAQ;AAAA,QACtB,KAAK,MAAM,QAAQ;AAAA,QACnB,MAAM,MAAM,QAAQ;AAAA,MACtB;AAAA,MACA,UAAU,EAAE,MAAM,MAAM,UAAU,KAAK;AAAA,IACzC,CAAC;AACD,WAAO,qBAAO,SAAS,aAAa,EAAE,SAAS,OAAO;AAAA,EACxD;AAEA,UAAQ,MAAM,iBAAiB,WAAW,EAAE;AAC5C,UAAQ,MAAM,KAAK;AACnB,SAAO,qBAAO,SAAS,eAAe,EAAE,SAAS,OAAO;AAC1D;","names":[]}
|
package/dist/hono/handler.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/handler.ts"],"sourcesContent":["import { Details, DetailType } from '../error/detail';\nimport { Status, StatusError } from '../error/status';\nimport type { AxiosError } from 'axios';\nimport type { Context } from 'hono';\nimport type { RequestIdVariables } from 'hono/request-id';\nimport type { HTTPResponseError, Bindings } from 'hono/types';\nimport type { ContentfulStatusCode } from 'hono/utils/http-status';\n\ntype Env = {\n Variables: RequestIdVariables;\n Bindings?: Bindings;\n};\n\nexport function isAxiosError(payload: unknown): payload is AxiosError {\n return (\n payload !== null &&\n typeof payload === 'object' &&\n 'isAxiosError' in payload &&\n payload.isAxiosError === true\n );\n}\n\nexport function errorHandler<E extends Env = never>(\n error: Error | HTTPResponseError,\n c: Context<E>\n): Response | Promise<Response> {\n const requestId = c.get('requestId');\n const servingData = `${c.req.method}: ${c.req.path}`;\n const details = Details.new().requestInfo({ requestId, servingData });\n\n if (error instanceof StatusError) {\n error.body?.error?.details?.push(...details.list);\n const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);\n if (badRequest) {\n console.warn({ requestId, servingData, ...badRequest });\n }\n return c.json(error.body, error.status as ContentfulStatusCode);\n }\n\n if (error instanceof SyntaxError) {\n if (/^Cannot convert .* to a BigInt$/.test(error.message)) {\n return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);\n }\n }\n\n if (isAxiosError(error)) {\n console.error({\n status: error.status,\n message: error.message,\n request: {\n method: error.config?.method,\n url: error.config?.url,\n data: error.config?.data,\n },\n response: { data: error.response?.data },\n });\n return Status.internal('Axios error').response(details);\n }\n\n console.error(error);\n return Status.internal('Unknown error').response(details);\n}\n"],"mappings":";AAAA,SAAS,SAAS,kBAAkB;AACpC,SAAS,QAAQ,mBAAmB;AAY7B,SAAS,aAAa,SAAyC;AACpE,SACE,YAAY,QACZ,OAAO,YAAY,YACnB,kBAAkB,WAClB,QAAQ,iBAAiB;AAE7B;AAEO,SAAS,aACd,OACA,GAC8B;AAC9B,QAAM,YAAY,EAAE,IAAI,WAAW;AACnC,QAAM,cAAc,GAAG,EAAE,IAAI,MAAM,KAAK,EAAE,IAAI,IAAI;AAClD,QAAM,UAAU,QAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,YAAY,CAAC;AAEpE,MAAI,iBAAiB,aAAa;AAChC,UAAM,MAAM,OAAO,SAAS,KAAK,GAAG,QAAQ,IAAI;AAChD,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,WAAW;AAC3F,QAAI,YAAY;AACd,cAAQ,KAAK,EAAE,WAAW,aAAa,GAAG,WAAW,CAAC;AAAA,IACxD;AACA,WAAO,EAAE,KAAK,MAAM,MAAM,MAAM,MAA8B;AAAA,EAChE;AAEA,MAAI,iBAAiB,aAAa;AAChC,QAAI,kCAAkC,KAAK,MAAM,OAAO,GAAG;AACzD,aAAO,OAAO,gBAAgB,mBAAmB,MAAM,OAAO,EAAE,EAAE,SAAS,OAAO;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,SAAS;AAAA,QACP,QAAQ,MAAM,QAAQ;AAAA,QACtB,KAAK,MAAM,QAAQ;AAAA,QACnB,MAAM,MAAM,QAAQ;AAAA,MACtB;AAAA,MACA,UAAU,EAAE,MAAM,MAAM,UAAU,KAAK;AAAA,IACzC,CAAC;AACD,WAAO,OAAO,SAAS,aAAa,EAAE,SAAS,OAAO;AAAA,EACxD;AAEA,UAAQ,MAAM,KAAK;AACnB,SAAO,OAAO,SAAS,eAAe,EAAE,SAAS,OAAO;AAC1D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/hono/handler.ts"],"sourcesContent":["import { Details, DetailType } from '../error/detail';\nimport { Status, StatusError } from '../error/status';\nimport type { AxiosError } from 'axios';\nimport type { Context } from 'hono';\nimport type { RequestIdVariables } from 'hono/request-id';\nimport type { HTTPResponseError, Bindings } from 'hono/types';\nimport type { ContentfulStatusCode } from 'hono/utils/http-status';\n\ntype Env = {\n Variables: RequestIdVariables;\n Bindings?: Bindings;\n};\n\nexport function isAxiosError(payload: unknown): payload is AxiosError {\n return (\n payload !== null &&\n typeof payload === 'object' &&\n 'isAxiosError' in payload &&\n payload.isAxiosError === true\n );\n}\n\nexport function errorHandler<E extends Env = never>(\n error: Error | HTTPResponseError,\n c: Context<E>\n): Response | Promise<Response> {\n const requestId = c.get('requestId');\n const servingData = `${c.req.method}: ${c.req.path}`;\n const details = Details.new().requestInfo({ requestId, servingData });\n\n if (error instanceof StatusError) {\n error.body?.error?.details?.push(...details.list);\n const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);\n if (badRequest) {\n console.warn({ requestId, servingData, ...badRequest });\n }\n return c.json(error.body, error.status as ContentfulStatusCode);\n }\n\n if (error instanceof SyntaxError) {\n if (/^Cannot convert .* to a BigInt$/.test(error.message)) {\n return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);\n }\n }\n\n if (isAxiosError(error)) {\n console.error({\n status: error.status,\n message: error.message,\n request: {\n method: error.config?.method,\n url: error.config?.url,\n data: error.config?.data,\n },\n response: { data: error.response?.data },\n });\n return Status.internal('Axios error').response(details);\n }\n\n console.error(`serving data: ${servingData}`);\n console.error(error);\n return Status.internal('Unknown error').response(details);\n}\n"],"mappings":";AAAA,SAAS,SAAS,kBAAkB;AACpC,SAAS,QAAQ,mBAAmB;AAY7B,SAAS,aAAa,SAAyC;AACpE,SACE,YAAY,QACZ,OAAO,YAAY,YACnB,kBAAkB,WAClB,QAAQ,iBAAiB;AAE7B;AAEO,SAAS,aACd,OACA,GAC8B;AAC9B,QAAM,YAAY,EAAE,IAAI,WAAW;AACnC,QAAM,cAAc,GAAG,EAAE,IAAI,MAAM,KAAK,EAAE,IAAI,IAAI;AAClD,QAAM,UAAU,QAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,YAAY,CAAC;AAEpE,MAAI,iBAAiB,aAAa;AAChC,UAAM,MAAM,OAAO,SAAS,KAAK,GAAG,QAAQ,IAAI;AAChD,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,WAAW;AAC3F,QAAI,YAAY;AACd,cAAQ,KAAK,EAAE,WAAW,aAAa,GAAG,WAAW,CAAC;AAAA,IACxD;AACA,WAAO,EAAE,KAAK,MAAM,MAAM,MAAM,MAA8B;AAAA,EAChE;AAEA,MAAI,iBAAiB,aAAa;AAChC,QAAI,kCAAkC,KAAK,MAAM,OAAO,GAAG;AACzD,aAAO,OAAO,gBAAgB,mBAAmB,MAAM,OAAO,EAAE,EAAE,SAAS,OAAO;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,SAAS;AAAA,QACP,QAAQ,MAAM,QAAQ;AAAA,QACtB,KAAK,MAAM,QAAQ;AAAA,QACnB,MAAM,MAAM,QAAQ;AAAA,MACtB;AAAA,MACA,UAAU,EAAE,MAAM,MAAM,UAAU,KAAK;AAAA,IACzC,CAAC;AACD,WAAO,OAAO,SAAS,aAAa,EAAE,SAAS,OAAO;AAAA,EACxD;AAEA,UAAQ,MAAM,iBAAiB,WAAW,EAAE;AAC5C,UAAQ,MAAM,KAAK;AACnB,SAAO,OAAO,SAAS,eAAe,EAAE,SAAS,OAAO;AAC1D;","names":[]}
|
package/dist/hono/index.d.cts
CHANGED
|
@@ -2,11 +2,11 @@ export { bigintId, zValidator } from './validator.cjs';
|
|
|
2
2
|
export { errorHandler } from './handler.cjs';
|
|
3
3
|
export { geolocation } from './geolocation.cjs';
|
|
4
4
|
export { Authorizer } from './authorizer.cjs';
|
|
5
|
-
import 'zod/
|
|
5
|
+
import 'zod/mini';
|
|
6
6
|
import 'hono/utils/headers';
|
|
7
7
|
import 'hono/types';
|
|
8
8
|
import 'hono';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
|
-
import 'zod
|
|
10
|
+
import 'zod';
|
|
11
11
|
import 'axios';
|
|
12
12
|
import 'hono/request-id';
|
package/dist/hono/index.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export { bigintId, zValidator } from './validator.js';
|
|
|
2
2
|
export { errorHandler } from './handler.js';
|
|
3
3
|
export { geolocation } from './geolocation.js';
|
|
4
4
|
export { Authorizer } from './authorizer.js';
|
|
5
|
-
import 'zod/
|
|
5
|
+
import 'zod/mini';
|
|
6
6
|
import 'hono/utils/headers';
|
|
7
7
|
import 'hono/types';
|
|
8
8
|
import 'hono';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
|
-
import 'zod
|
|
10
|
+
import 'zod';
|
|
11
11
|
import 'axios';
|
|
12
12
|
import 'hono/request-id';
|
package/dist/hono/validator.cjs
CHANGED
|
@@ -25,7 +25,7 @@ __export(validator_exports, {
|
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(validator_exports);
|
|
27
27
|
var import_validator = require("hono/validator");
|
|
28
|
-
var
|
|
28
|
+
var import_mini = require("zod/mini");
|
|
29
29
|
var import_detail = require("../error/detail.cjs");
|
|
30
30
|
var import_status = require("../error/status.cjs");
|
|
31
31
|
function zValidator(target, schema) {
|
|
@@ -39,20 +39,20 @@ function zValidator(target, schema) {
|
|
|
39
39
|
throw import_status.Status.invalidArgument().error(details);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
var bigintId = (0,
|
|
43
|
-
(0,
|
|
44
|
-
(0,
|
|
42
|
+
var bigintId = (0, import_mini.pipe)(
|
|
43
|
+
(0, import_mini.string)(),
|
|
44
|
+
(0, import_mini.transform)((input, ctx) => {
|
|
45
45
|
if (!/^(0|[1-9]\d{0,19})$/.test(input)) {
|
|
46
46
|
const message = `Invalid bigint id: ${input}`;
|
|
47
47
|
ctx.issues.push({ code: "custom", input, message });
|
|
48
|
-
return
|
|
48
|
+
return import_mini.NEVER;
|
|
49
49
|
}
|
|
50
50
|
try {
|
|
51
51
|
return BigInt(input);
|
|
52
52
|
} catch {
|
|
53
53
|
const message = `Parse bigint id: ${input} failed`;
|
|
54
54
|
ctx.issues.push({ code: "custom", input, message });
|
|
55
|
-
return
|
|
55
|
+
return import_mini.NEVER;
|
|
56
56
|
}
|
|
57
57
|
})
|
|
58
58
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/
|
|
1
|
+
{"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/mini';\nimport { Details } from '../error/detail';\nimport { Status } from '../error/status';\nimport type { BadRequest } from '../error/detail';\nimport type { ValidationTargets } from 'hono';\nimport type { output as outputV4, ZodType } from 'zod';\nimport type { output as outputMini, ZodMiniType } from 'zod/mini';\n\nexport function zValidator<S extends ZodType | ZodMiniType>(\n target: keyof ValidationTargets,\n schema: S\n) {\n return validator(target, async (value) => {\n const result = await schema.safeParseAsync(value);\n if (result.success) return result.data as S extends ZodType ? outputV4<S> : outputMini<S>;\n\n const fieldViolations: BadRequest['fieldViolations'] = result.error.issues.map(\n ({ path, message }) => ({ field: path.join('.'), description: message })\n );\n const details = Details.new().badRequest({ fieldViolations });\n throw Status.invalidArgument().error(details);\n });\n}\n\nexport const bigintId = pipe(\n string(),\n transform((input, ctx) => {\n if (!/^(0|[1-9]\\d{0,19})$/.test(input)) {\n const message = `Invalid bigint id: ${input}`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n try {\n return BigInt(input);\n } catch {\n const message = `Parse bigint id: ${input} failed`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n })\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0B;AAC1B,kBAA+C;AAC/C,oBAAwB;AACxB,oBAAuB;AAMhB,SAAS,WACd,QACA,QACA;AACA,aAAO,4BAAU,QAAQ,OAAO,UAAU;AACxC,UAAM,SAAS,MAAM,OAAO,eAAe,KAAK;AAChD,QAAI,OAAO,QAAS,QAAO,OAAO;AAElC,UAAM,kBAAiD,OAAO,MAAM,OAAO;AAAA,MACzE,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAO,KAAK,KAAK,GAAG,GAAG,aAAa,QAAQ;AAAA,IACxE;AACA,UAAM,UAAU,sBAAQ,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC;AAC5D,UAAM,qBAAO,gBAAgB,EAAE,MAAM,OAAO;AAAA,EAC9C,CAAC;AACH;AAEO,IAAM,eAAW;AAAA,MACtB,oBAAO;AAAA,MACP,uBAAU,CAAC,OAAO,QAAQ;AACxB,QAAI,CAAC,sBAAsB,KAAK,KAAK,GAAG;AACtC,YAAM,UAAU,sBAAsB,KAAK;AAC3C,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,OAAO,KAAK;AAAA,IACrB,QAAQ;AACN,YAAM,UAAU,oBAAoB,KAAK;AACzC,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ZodMiniType } from 'zod/
|
|
1
|
+
import * as zod_mini from 'zod/mini';
|
|
2
|
+
import { ZodMiniType } from 'zod/mini';
|
|
3
3
|
import * as hono_utils_headers from 'hono/utils/headers';
|
|
4
4
|
import * as hono_types from 'hono/types';
|
|
5
5
|
import * as hono from 'hono';
|
|
6
6
|
import { ValidationTargets } from 'hono';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
8
|
-
import { ZodType, output } from 'zod
|
|
8
|
+
import { ZodType, output } from 'zod';
|
|
9
9
|
|
|
10
10
|
declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof ValidationTargets, schema: S): hono.MiddlewareHandler<any, string, {
|
|
11
11
|
in: {
|
|
@@ -25,6 +25,6 @@ declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof Valid
|
|
|
25
25
|
cookie: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_16 ? T_16 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_16 extends Response & hono.TypedResponse<any> ? never : T_16 : never : never;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
28
|
-
declare const bigintId:
|
|
28
|
+
declare const bigintId: zod_mini.ZodMiniPipe<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniTransform<bigint, string>>;
|
|
29
29
|
|
|
30
30
|
export { bigintId, zValidator };
|
package/dist/hono/validator.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { ZodMiniType } from 'zod/
|
|
1
|
+
import * as zod_mini from 'zod/mini';
|
|
2
|
+
import { ZodMiniType } from 'zod/mini';
|
|
3
3
|
import * as hono_utils_headers from 'hono/utils/headers';
|
|
4
4
|
import * as hono_types from 'hono/types';
|
|
5
5
|
import * as hono from 'hono';
|
|
6
6
|
import { ValidationTargets } from 'hono';
|
|
7
7
|
import * as zod_v4_core from 'zod/v4/core';
|
|
8
|
-
import { ZodType, output } from 'zod
|
|
8
|
+
import { ZodType, output } from 'zod';
|
|
9
9
|
|
|
10
10
|
declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof ValidationTargets, schema: S): hono.MiddlewareHandler<any, string, {
|
|
11
11
|
in: {
|
|
@@ -25,6 +25,6 @@ declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof Valid
|
|
|
25
25
|
cookie: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_16 ? T_16 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_16 extends Response & hono.TypedResponse<any> ? never : T_16 : never : never;
|
|
26
26
|
};
|
|
27
27
|
}>;
|
|
28
|
-
declare const bigintId:
|
|
28
|
+
declare const bigintId: zod_mini.ZodMiniPipe<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniTransform<bigint, string>>;
|
|
29
29
|
|
|
30
30
|
export { bigintId, zValidator };
|
package/dist/hono/validator.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/hono/validator.ts
|
|
2
2
|
import { validator } from "hono/validator";
|
|
3
|
-
import { transform, pipe, string, NEVER } from "zod/
|
|
3
|
+
import { transform, pipe, string, NEVER } from "zod/mini";
|
|
4
4
|
import { Details } from "../error/detail.mjs";
|
|
5
5
|
import { Status } from "../error/status.mjs";
|
|
6
6
|
function zValidator(target, schema) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/
|
|
1
|
+
{"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/mini';\nimport { Details } from '../error/detail';\nimport { Status } from '../error/status';\nimport type { BadRequest } from '../error/detail';\nimport type { ValidationTargets } from 'hono';\nimport type { output as outputV4, ZodType } from 'zod';\nimport type { output as outputMini, ZodMiniType } from 'zod/mini';\n\nexport function zValidator<S extends ZodType | ZodMiniType>(\n target: keyof ValidationTargets,\n schema: S\n) {\n return validator(target, async (value) => {\n const result = await schema.safeParseAsync(value);\n if (result.success) return result.data as S extends ZodType ? outputV4<S> : outputMini<S>;\n\n const fieldViolations: BadRequest['fieldViolations'] = result.error.issues.map(\n ({ path, message }) => ({ field: path.join('.'), description: message })\n );\n const details = Details.new().badRequest({ fieldViolations });\n throw Status.invalidArgument().error(details);\n });\n}\n\nexport const bigintId = pipe(\n string(),\n transform((input, ctx) => {\n if (!/^(0|[1-9]\\d{0,19})$/.test(input)) {\n const message = `Invalid bigint id: ${input}`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n try {\n return BigInt(input);\n } catch {\n const message = `Parse bigint id: ${input} failed`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n })\n);\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,MAAM,QAAQ,aAAa;AAC/C,SAAS,eAAe;AACxB,SAAS,cAAc;AAMhB,SAAS,WACd,QACA,QACA;AACA,SAAO,UAAU,QAAQ,OAAO,UAAU;AACxC,UAAM,SAAS,MAAM,OAAO,eAAe,KAAK;AAChD,QAAI,OAAO,QAAS,QAAO,OAAO;AAElC,UAAM,kBAAiD,OAAO,MAAM,OAAO;AAAA,MACzE,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAO,KAAK,KAAK,GAAG,GAAG,aAAa,QAAQ;AAAA,IACxE;AACA,UAAM,UAAU,QAAQ,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC;AAC5D,UAAM,OAAO,gBAAgB,EAAE,MAAM,OAAO;AAAA,EAC9C,CAAC;AACH;AAEO,IAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,UAAU,CAAC,OAAO,QAAQ;AACxB,QAAI,CAAC,sBAAsB,KAAK,KAAK,GAAG;AACtC,YAAM,UAAU,sBAAsB,KAAK;AAC3C,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,OAAO,KAAK;AAAA,IACrB,QAAQ;AACN,YAAM,UAAU,oBAAoB,KAAK;AACzC,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
|
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,7 @@ var index_exports = {};
|
|
|
33
33
|
__export(index_exports, {
|
|
34
34
|
CheckoutCreateError: () => import_error.CheckoutCreateError,
|
|
35
35
|
Cursor: () => import_response.Cursor,
|
|
36
|
+
ISO_3601_1: () => import_iso_3601_1.ISO_3601_1,
|
|
36
37
|
LoginCanceledError: () => import_error.LoginCanceledError,
|
|
37
38
|
LoginTimeoutError: () => import_error.LoginTimeoutError,
|
|
38
39
|
MAX_LENGTH: () => MAX_LENGTH,
|
|
@@ -60,10 +61,12 @@ var import_string = require("./utils/string.cjs");
|
|
|
60
61
|
var import_timing = require("./utils/timing.cjs");
|
|
61
62
|
var import_invariant = require("./utils/invariant.cjs");
|
|
62
63
|
var import_token_bucket = require("./utils/token-bucket.cjs");
|
|
64
|
+
var import_iso_3601_1 = require("./iso/iso_3601_1.cjs");
|
|
63
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
64
66
|
0 && (module.exports = {
|
|
65
67
|
CheckoutCreateError,
|
|
66
68
|
Cursor,
|
|
69
|
+
ISO_3601_1,
|
|
67
70
|
LoginCanceledError,
|
|
68
71
|
LoginTimeoutError,
|
|
69
72
|
MAX_LENGTH,
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './error/reason';\nexport * from './error/detail';\nexport * from './error/status';\nexport { getErrorMessage } from './error/parse';\nexport {\n pageParamsSchema,\n Cursor,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n} from './response';\n\nexport * from './vaild';\nexport * from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { hasText } from './utils/string';\nexport { timing } from './utils/timing';\nexport { invariant } from './utils/invariant';\nexport { TokenBucket, type TokenBucketOptions } from './utils/token-bucket';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,mBAKO;AAUP,0BAAc,+BA5Bd;AA6BA,0BAAc,+BA7Bd;AA8BA,mBAAgC;AAChC,sBAMO;AAcP,0BAAc,wBAnDd;AAoDA,0BAAc,4BApDd;AAsDA,iBAA4B;AAC5B,oBAAwB;AACxB,oBAAuB;AACvB,uBAA0B;AAC1B,0BAAqD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './error/reason';\nexport * from './error/detail';\nexport * from './error/status';\nexport { getErrorMessage } from './error/parse';\nexport {\n pageParamsSchema,\n Cursor,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n} from './response';\n\nexport * from './vaild';\nexport * from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { hasText } from './utils/string';\nexport { timing } from './utils/timing';\nexport { invariant } from './utils/invariant';\nexport { TokenBucket, type TokenBucketOptions } from './utils/token-bucket';\n\nexport { ISO_3601_1, type ISO3166CountryCode } from './iso/iso_3601_1';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,mBAKO;AAUP,0BAAc,+BA5Bd;AA6BA,0BAAc,+BA7Bd;AA8BA,mBAAgC;AAChC,sBAMO;AAcP,0BAAc,wBAnDd;AAoDA,0BAAc,4BApDd;AAsDA,iBAA4B;AAC5B,oBAAwB;AACxB,oBAAuB;AACvB,uBAA0B;AAC1B,0BAAqD;AAErD,wBAAoD;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -11,6 +11,7 @@ export { hasText } from './utils/string.cjs';
|
|
|
11
11
|
export { timing } from './utils/timing.cjs';
|
|
12
12
|
export { invariant } from './utils/invariant.cjs';
|
|
13
13
|
export { TokenBucket, TokenBucketOptions } from './utils/token-bucket.cjs';
|
|
14
|
+
export { ISO3166CountryCode, ISO_3601_1 } from './iso/iso_3601_1.cjs';
|
|
14
15
|
import 'i18next';
|
|
15
16
|
import 'zod/v4/core';
|
|
16
|
-
import 'zod/
|
|
17
|
+
import 'zod/mini';
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { hasText } from './utils/string.js';
|
|
|
11
11
|
export { timing } from './utils/timing.js';
|
|
12
12
|
export { invariant } from './utils/invariant.js';
|
|
13
13
|
export { TokenBucket, TokenBucketOptions } from './utils/token-bucket.js';
|
|
14
|
+
export { ISO3166CountryCode, ISO_3601_1 } from './iso/iso_3601_1.js';
|
|
14
15
|
import 'i18next';
|
|
15
16
|
import 'zod/v4/core';
|
|
16
|
-
import 'zod/
|
|
17
|
+
import 'zod/mini';
|
package/dist/index.mjs
CHANGED
|
@@ -22,9 +22,11 @@ import { hasText } from "./utils/string.mjs";
|
|
|
22
22
|
import { timing } from "./utils/timing.mjs";
|
|
23
23
|
import { invariant } from "./utils/invariant.mjs";
|
|
24
24
|
import { TokenBucket } from "./utils/token-bucket.mjs";
|
|
25
|
+
import { ISO_3601_1 } from "./iso/iso_3601_1.mjs";
|
|
25
26
|
export {
|
|
26
27
|
CheckoutCreateError,
|
|
27
28
|
Cursor,
|
|
29
|
+
ISO_3601_1,
|
|
28
30
|
LoginCanceledError,
|
|
29
31
|
LoginTimeoutError,
|
|
30
32
|
MAX_LENGTH,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './error/reason';\nexport * from './error/detail';\nexport * from './error/status';\nexport { getErrorMessage } from './error/parse';\nexport {\n pageParamsSchema,\n Cursor,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n} from './response';\n\nexport * from './vaild';\nexport * from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { hasText } from './utils/string';\nexport { timing } from './utils/timing';\nexport { invariant } from './utils/invariant';\nexport { TokenBucket, type TokenBucketOptions } from './utils/token-bucket';\n"],"mappings":";AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,cAAc;AACd,cAAc;AACd,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,cAAc;AACd,cAAc;AAEd,YAAY,gBAAgB;AAC5B,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,mBAA4C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type {\n NetworkErrorReason,\n StatusErrorReason,\n AuthenticationErrorReason,\n ModerationErrorReason,\n MultipartErrorReason,\n AppErrorReason,\n ErrorReason,\n} from './error/reason';\nexport * from './error/detail';\nexport * from './error/status';\nexport { getErrorMessage } from './error/parse';\nexport {\n pageParamsSchema,\n Cursor,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n} from './response';\n\nexport * from './vaild';\nexport * from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { hasText } from './utils/string';\nexport { timing } from './utils/timing';\nexport { invariant } from './utils/invariant';\nexport { TokenBucket, type TokenBucketOptions } from './utils/token-bucket';\n\nexport { ISO_3601_1, type ISO3166CountryCode } from './iso/iso_3601_1';\n"],"mappings":";AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP,cAAc;AACd,cAAc;AACd,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP,cAAc;AACd,cAAc;AAEd,YAAY,gBAAgB;AAC5B,SAAS,eAAe;AACxB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,mBAA4C;AAErD,SAAS,kBAA2C;","names":[]}
|
|
@@ -0,0 +1,292 @@
|
|
|
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/iso/iso_3601_1.ts
|
|
21
|
+
var iso_3601_1_exports = {};
|
|
22
|
+
__export(iso_3601_1_exports, {
|
|
23
|
+
ISO_3601_1: () => ISO_3601_1
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(iso_3601_1_exports);
|
|
26
|
+
var ISO_3601_1 = [
|
|
27
|
+
{ numeric: 4, name: "Afghanistan", alpha2: "AF", alpha3: "AFG" },
|
|
28
|
+
{ numeric: 8, name: "Albania", alpha2: "AL", alpha3: "ALB" },
|
|
29
|
+
{ numeric: 12, name: "Algeria", alpha2: "DZ", alpha3: "DZA" },
|
|
30
|
+
{ numeric: 16, name: "American Samoa", alpha2: "AS", alpha3: "ASM" },
|
|
31
|
+
{ numeric: 20, name: "Andorra", alpha2: "AD", alpha3: "AND" },
|
|
32
|
+
{ numeric: 24, name: "Angola", alpha2: "AO", alpha3: "AGO" },
|
|
33
|
+
{ numeric: 660, name: "Anguilla", alpha2: "AI", alpha3: "AIA" },
|
|
34
|
+
{ numeric: 10, name: "Antarctica", alpha2: "AQ", alpha3: "ATA" },
|
|
35
|
+
{ numeric: 28, name: "Antigua and Barbuda", alpha2: "AG", alpha3: "ATG" },
|
|
36
|
+
{ numeric: 32, name: "Argentina", alpha2: "AR", alpha3: "ARG" },
|
|
37
|
+
{ numeric: 51, name: "Armenia", alpha2: "AM", alpha3: "ARM" },
|
|
38
|
+
{ numeric: 533, name: "Aruba", alpha2: "AW", alpha3: "ABW" },
|
|
39
|
+
{ numeric: 36, name: "Australia", alpha2: "AU", alpha3: "AUS" },
|
|
40
|
+
{ numeric: 40, name: "Austria", alpha2: "AT", alpha3: "AUT" },
|
|
41
|
+
{ numeric: 31, name: "Azerbaijan", alpha2: "AZ", alpha3: "AZE" },
|
|
42
|
+
{ numeric: 44, name: "Bahamas", alpha2: "BS", alpha3: "BHS" },
|
|
43
|
+
{ numeric: 48, name: "Bahrain", alpha2: "BH", alpha3: "BHR" },
|
|
44
|
+
{ numeric: 50, name: "Bangladesh", alpha2: "BD", alpha3: "BGD" },
|
|
45
|
+
{ numeric: 52, name: "Barbados", alpha2: "BB", alpha3: "BRB" },
|
|
46
|
+
{ numeric: 112, name: "Belarus", alpha2: "BY", alpha3: "BLR" },
|
|
47
|
+
{ numeric: 56, name: "Belgium", alpha2: "BE", alpha3: "BEL" },
|
|
48
|
+
{ numeric: 84, name: "Belize", alpha2: "BZ", alpha3: "BLZ" },
|
|
49
|
+
{ numeric: 204, name: "Benin", alpha2: "BJ", alpha3: "BEN" },
|
|
50
|
+
{ numeric: 60, name: "Bermuda", alpha2: "BM", alpha3: "BMU" },
|
|
51
|
+
{ numeric: 64, name: "Bhutan", alpha2: "BT", alpha3: "BTN" },
|
|
52
|
+
{ numeric: 68, name: "Bolivia", alpha2: "BO", alpha3: "BOL" },
|
|
53
|
+
{ numeric: 70, name: "Bosnia and Herzegovina", alpha2: "BA", alpha3: "BIH" },
|
|
54
|
+
{ numeric: 72, name: "Botswana", alpha2: "BW", alpha3: "BWA" },
|
|
55
|
+
{ numeric: 74, name: "Bouvet Island", alpha2: "BV", alpha3: "BVT" },
|
|
56
|
+
{ numeric: 76, name: "Brazil", alpha2: "BR", alpha3: "BRA" },
|
|
57
|
+
{ numeric: 86, name: "British Indian Ocean Territory", alpha2: "IO", alpha3: "IOT" },
|
|
58
|
+
{ numeric: 96, name: "Brunei Darussalam", alpha2: "BN", alpha3: "BRN" },
|
|
59
|
+
{ numeric: 100, name: "Bulgaria", alpha2: "BG", alpha3: "BGR" },
|
|
60
|
+
{ numeric: 854, name: "Burkina Faso", alpha2: "BF", alpha3: "BFA" },
|
|
61
|
+
{ numeric: 108, name: "Burundi", alpha2: "BI", alpha3: "BDI" },
|
|
62
|
+
{ numeric: 116, name: "Cambodia", alpha2: "KH", alpha3: "KHM" },
|
|
63
|
+
{ numeric: 120, name: "Cameroon", alpha2: "CM", alpha3: "CMR" },
|
|
64
|
+
{ numeric: 124, name: "Canada", alpha2: "CA", alpha3: "CAN" },
|
|
65
|
+
{ numeric: 132, name: "Cape Verde", alpha2: "CV", alpha3: "CPV" },
|
|
66
|
+
{ numeric: 136, name: "Cayman Islands", alpha2: "KY", alpha3: "CYM" },
|
|
67
|
+
{ numeric: 140, name: "Central African Republic", alpha2: "CF", alpha3: "CAF" },
|
|
68
|
+
{ numeric: 148, name: "Chad", alpha2: "TD", alpha3: "TCD" },
|
|
69
|
+
{ numeric: 152, name: "Chile", alpha2: "CL", alpha3: "CHL" },
|
|
70
|
+
{ numeric: 156, name: "China", alpha2: "CN", alpha3: "CHN" },
|
|
71
|
+
{ numeric: 162, name: "Christmas Island", alpha2: "CX", alpha3: "CXR" },
|
|
72
|
+
{ numeric: 170, name: "Colombia", alpha2: "CO", alpha3: "COL" },
|
|
73
|
+
{ numeric: 174, name: "Comoros", alpha2: "KM", alpha3: "COM" },
|
|
74
|
+
{ numeric: 178, name: "Congo", alpha2: "CG", alpha3: "COG" },
|
|
75
|
+
{ numeric: 180, name: "Congo, the Democratic Republic of the", alpha2: "CD", alpha3: "COD" },
|
|
76
|
+
{ numeric: 184, name: "Cook Islands", alpha2: "CK", alpha3: "COK" },
|
|
77
|
+
{ numeric: 188, name: "Costa Rica", alpha2: "CR", alpha3: "CRI" },
|
|
78
|
+
{ numeric: 384, name: "Cote D'Ivoire", alpha2: "CI", alpha3: "CIV" },
|
|
79
|
+
// Corrected SQL escape '' to '
|
|
80
|
+
{ numeric: 191, name: "Croatia", alpha2: "HR", alpha3: "HRV" },
|
|
81
|
+
{ numeric: 192, name: "Cuba", alpha2: "CU", alpha3: "CUB" },
|
|
82
|
+
{ numeric: 196, name: "Cyprus", alpha2: "CY", alpha3: "CYP" },
|
|
83
|
+
{ numeric: 203, name: "Czech Republic", alpha2: "CZ", alpha3: "CZE" },
|
|
84
|
+
{ numeric: 208, name: "Denmark", alpha2: "DK", alpha3: "DNK" },
|
|
85
|
+
{ numeric: 262, name: "Djibouti", alpha2: "DJ", alpha3: "DJI" },
|
|
86
|
+
{ numeric: 212, name: "Dominica", alpha2: "DM", alpha3: "DMA" },
|
|
87
|
+
{ numeric: 214, name: "Dominican Republic", alpha2: "DO", alpha3: "DOM" },
|
|
88
|
+
{ numeric: 218, name: "Ecuador", alpha2: "EC", alpha3: "ECU" },
|
|
89
|
+
{ numeric: 818, name: "Egypt", alpha2: "EG", alpha3: "EGY" },
|
|
90
|
+
{ numeric: 222, name: "El Salvador", alpha2: "SV", alpha3: "SLV" },
|
|
91
|
+
{ numeric: 226, name: "Equatorial Guinea", alpha2: "GQ", alpha3: "GNQ" },
|
|
92
|
+
{ numeric: 232, name: "Eritrea", alpha2: "ER", alpha3: "ERI" },
|
|
93
|
+
{ numeric: 233, name: "Estonia", alpha2: "EE", alpha3: "EST" },
|
|
94
|
+
{ numeric: 231, name: "Ethiopia", alpha2: "ET", alpha3: "ETH" },
|
|
95
|
+
{ numeric: 238, name: "Falkland Islands (Malvinas)", alpha2: "FK", alpha3: "FLK" },
|
|
96
|
+
{ numeric: 234, name: "Faroe Islands", alpha2: "FO", alpha3: "FRO" },
|
|
97
|
+
{ numeric: 242, name: "Fiji", alpha2: "FJ", alpha3: "FJI" },
|
|
98
|
+
{ numeric: 246, name: "Finland", alpha2: "FI", alpha3: "FIN" },
|
|
99
|
+
{ numeric: 250, name: "France", alpha2: "FR", alpha3: "FRA" },
|
|
100
|
+
{ numeric: 254, name: "French Guiana", alpha2: "GF", alpha3: "GUF" },
|
|
101
|
+
{ numeric: 258, name: "French Polynesia", alpha2: "PF", alpha3: "PYF" },
|
|
102
|
+
{ numeric: 260, name: "French Southern Territories", alpha2: "TF", alpha3: "ATF" },
|
|
103
|
+
{ numeric: 266, name: "Gabon", alpha2: "GA", alpha3: "GAB" },
|
|
104
|
+
{ numeric: 270, name: "Gambia", alpha2: "GM", alpha3: "GMB" },
|
|
105
|
+
{ numeric: 268, name: "Georgia", alpha2: "GE", alpha3: "GEO" },
|
|
106
|
+
{ numeric: 276, name: "Germany", alpha2: "DE", alpha3: "DEU" },
|
|
107
|
+
{ numeric: 288, name: "Ghana", alpha2: "GH", alpha3: "GHA" },
|
|
108
|
+
{ numeric: 292, name: "Gibraltar", alpha2: "GI", alpha3: "GIB" },
|
|
109
|
+
{ numeric: 300, name: "Greece", alpha2: "GR", alpha3: "GRC" },
|
|
110
|
+
{ numeric: 304, name: "Greenland", alpha2: "GL", alpha3: "GRL" },
|
|
111
|
+
{ numeric: 308, name: "Grenada", alpha2: "GD", alpha3: "GRD" },
|
|
112
|
+
{ numeric: 312, name: "Guadeloupe", alpha2: "GP", alpha3: "GLP" },
|
|
113
|
+
{ numeric: 316, name: "Guam", alpha2: "GU", alpha3: "GUM" },
|
|
114
|
+
{ numeric: 320, name: "Guatemala", alpha2: "GT", alpha3: "GTM" },
|
|
115
|
+
{ numeric: 324, name: "Guinea", alpha2: "GN", alpha3: "GIN" },
|
|
116
|
+
{ numeric: 624, name: "Guinea-Bissau", alpha2: "GW", alpha3: "GNB" },
|
|
117
|
+
{ numeric: 328, name: "Guyana", alpha2: "GY", alpha3: "GUY" },
|
|
118
|
+
{ numeric: 332, name: "Haiti", alpha2: "HT", alpha3: "HTI" },
|
|
119
|
+
{ numeric: 334, name: "Heard Island and Mcdonald Islands", alpha2: "HM", alpha3: "HMD" },
|
|
120
|
+
{ numeric: 336, name: "Holy See (Vatican City State)", alpha2: "VA", alpha3: "VAT" },
|
|
121
|
+
{ numeric: 340, name: "Honduras", alpha2: "HN", alpha3: "HND" },
|
|
122
|
+
{ numeric: 344, name: "Hong Kong", alpha2: "HK", alpha3: "HKG" },
|
|
123
|
+
{ numeric: 348, name: "Hungary", alpha2: "HU", alpha3: "HUN" },
|
|
124
|
+
{ numeric: 352, name: "Iceland", alpha2: "IS", alpha3: "ISL" },
|
|
125
|
+
{ numeric: 356, name: "India", alpha2: "IN", alpha3: "IND" },
|
|
126
|
+
{ numeric: 360, name: "Indonesia", alpha2: "ID", alpha3: "IDN" },
|
|
127
|
+
{ numeric: 364, name: "Iran, Islamic Republic of", alpha2: "IR", alpha3: "IRN" },
|
|
128
|
+
{ numeric: 368, name: "Iraq", alpha2: "IQ", alpha3: "IRQ" },
|
|
129
|
+
{ numeric: 372, name: "Ireland", alpha2: "IE", alpha3: "IRL" },
|
|
130
|
+
{ numeric: 376, name: "Israel", alpha2: "IL", alpha3: "ISR" },
|
|
131
|
+
{ numeric: 380, name: "Italy", alpha2: "IT", alpha3: "ITA" },
|
|
132
|
+
{ numeric: 388, name: "Jamaica", alpha2: "JM", alpha3: "JAM" },
|
|
133
|
+
{ numeric: 392, name: "Japan", alpha2: "JP", alpha3: "JPN" },
|
|
134
|
+
{ numeric: 400, name: "Jordan", alpha2: "JO", alpha3: "JOR" },
|
|
135
|
+
{ numeric: 398, name: "Kazakhstan", alpha2: "KZ", alpha3: "KAZ" },
|
|
136
|
+
{ numeric: 404, name: "Kenya", alpha2: "KE", alpha3: "KEN" },
|
|
137
|
+
{ numeric: 296, name: "Kiribati", alpha2: "KI", alpha3: "KIR" },
|
|
138
|
+
{ numeric: 408, name: "Korea, Democratic People's Republic of", alpha2: "KP", alpha3: "PRK" },
|
|
139
|
+
// Corrected
|
|
140
|
+
{ numeric: 410, name: "Korea, Republic of", alpha2: "KR", alpha3: "KOR" },
|
|
141
|
+
{ numeric: 414, name: "Kuwait", alpha2: "KW", alpha3: "KWT" },
|
|
142
|
+
{ numeric: 417, name: "Kyrgyzstan", alpha2: "KG", alpha3: "KGZ" },
|
|
143
|
+
{ numeric: 418, name: "Lao People's Democratic Republic", alpha2: "LA", alpha3: "LAO" },
|
|
144
|
+
// Corrected
|
|
145
|
+
{ numeric: 428, name: "Latvia", alpha2: "LV", alpha3: "LVA" },
|
|
146
|
+
{ numeric: 422, name: "Lebanon", alpha2: "LB", alpha3: "LBN" },
|
|
147
|
+
{ numeric: 426, name: "Lesotho", alpha2: "LS", alpha3: "LSO" },
|
|
148
|
+
{ numeric: 430, name: "Liberia", alpha2: "LR", alpha3: "LBR" },
|
|
149
|
+
{ numeric: 434, name: "Libyan Arab Jamahiriya", alpha2: "LY", alpha3: "LBY" },
|
|
150
|
+
{ numeric: 438, name: "Liechtenstein", alpha2: "LI", alpha3: "LIE" },
|
|
151
|
+
{ numeric: 440, name: "Lithuania", alpha2: "LT", alpha3: "LTU" },
|
|
152
|
+
{ numeric: 442, name: "Luxembourg", alpha2: "LU", alpha3: "LUX" },
|
|
153
|
+
{ numeric: 446, name: "Macao", alpha2: "MO", alpha3: "MAC" },
|
|
154
|
+
{ numeric: 807, name: "North Macedonia", alpha2: "MK", alpha3: "MKD" },
|
|
155
|
+
{ numeric: 450, name: "Madagascar", alpha2: "MG", alpha3: "MDG" },
|
|
156
|
+
{ numeric: 454, name: "Malawi", alpha2: "MW", alpha3: "MWI" },
|
|
157
|
+
{ numeric: 458, name: "Malaysia", alpha2: "MY", alpha3: "MYS" },
|
|
158
|
+
{ numeric: 462, name: "Maldives", alpha2: "MV", alpha3: "MDV" },
|
|
159
|
+
{ numeric: 466, name: "Mali", alpha2: "ML", alpha3: "MLI" },
|
|
160
|
+
{ numeric: 470, name: "Malta", alpha2: "MT", alpha3: "MLT" },
|
|
161
|
+
{ numeric: 584, name: "Marshall Islands", alpha2: "MH", alpha3: "MHL" },
|
|
162
|
+
{ numeric: 474, name: "Martinique", alpha2: "MQ", alpha3: "MTQ" },
|
|
163
|
+
{ numeric: 478, name: "Mauritania", alpha2: "MR", alpha3: "MRT" },
|
|
164
|
+
{ numeric: 480, name: "Mauritius", alpha2: "MU", alpha3: "MUS" },
|
|
165
|
+
{ numeric: 175, name: "Mayotte", alpha2: "YT", alpha3: "MYT" },
|
|
166
|
+
{ numeric: 484, name: "Mexico", alpha2: "MX", alpha3: "MEX" },
|
|
167
|
+
{ numeric: 583, name: "Micronesia, Federated States of", alpha2: "FM", alpha3: "FSM" },
|
|
168
|
+
{ numeric: 498, name: "Moldova, Republic of", alpha2: "MD", alpha3: "MDA" },
|
|
169
|
+
{ numeric: 492, name: "Monaco", alpha2: "MC", alpha3: "MCO" },
|
|
170
|
+
{ numeric: 496, name: "Mongolia", alpha2: "MN", alpha3: "MNG" },
|
|
171
|
+
{ numeric: 500, name: "Montserrat", alpha2: "MS", alpha3: "MSR" },
|
|
172
|
+
{ numeric: 504, name: "Morocco", alpha2: "MA", alpha3: "MAR" },
|
|
173
|
+
{ numeric: 508, name: "Mozambique", alpha2: "MZ", alpha3: "MOZ" },
|
|
174
|
+
{ numeric: 104, name: "Myanmar", alpha2: "MM", alpha3: "MMR" },
|
|
175
|
+
{ numeric: 516, name: "Namibia", alpha2: "NA", alpha3: "NAM" },
|
|
176
|
+
{ numeric: 520, name: "Nauru", alpha2: "NR", alpha3: "NRU" },
|
|
177
|
+
{ numeric: 524, name: "Nepal", alpha2: "NP", alpha3: "NPL" },
|
|
178
|
+
{ numeric: 528, name: "Netherlands", alpha2: "NL", alpha3: "NLD" },
|
|
179
|
+
{ numeric: 530, name: "Netherlands Antilles", alpha2: "AN", alpha3: "ANT" },
|
|
180
|
+
{ numeric: 540, name: "New Caledonia", alpha2: "NC", alpha3: "NCL" },
|
|
181
|
+
{ numeric: 554, name: "New Zealand", alpha2: "NZ", alpha3: "NZL" },
|
|
182
|
+
{ numeric: 558, name: "Nicaragua", alpha2: "NI", alpha3: "NIC" },
|
|
183
|
+
{ numeric: 562, name: "Niger", alpha2: "NE", alpha3: "NER" },
|
|
184
|
+
{ numeric: 566, name: "Nigeria", alpha2: "NG", alpha3: "NGA" },
|
|
185
|
+
{ numeric: 570, name: "Niue", alpha2: "NU", alpha3: "NIU" },
|
|
186
|
+
{ numeric: 574, name: "Norfolk Island", alpha2: "NF", alpha3: "NFK" },
|
|
187
|
+
{ numeric: 580, name: "Northern Mariana Islands", alpha2: "MP", alpha3: "MNP" },
|
|
188
|
+
{ numeric: 578, name: "Norway", alpha2: "NO", alpha3: "NOR" },
|
|
189
|
+
{ numeric: 512, name: "Oman", alpha2: "OM", alpha3: "OMN" },
|
|
190
|
+
{ numeric: 586, name: "Pakistan", alpha2: "PK", alpha3: "PAK" },
|
|
191
|
+
{ numeric: 585, name: "Palau", alpha2: "PW", alpha3: "PLW" },
|
|
192
|
+
{ numeric: 591, name: "Panama", alpha2: "PA", alpha3: "PAN" },
|
|
193
|
+
{ numeric: 598, name: "Papua New Guinea", alpha2: "PG", alpha3: "PNG" },
|
|
194
|
+
{ numeric: 600, name: "Paraguay", alpha2: "PY", alpha3: "PRY" },
|
|
195
|
+
{ numeric: 604, name: "Peru", alpha2: "PE", alpha3: "PER" },
|
|
196
|
+
{ numeric: 608, name: "Philippines", alpha2: "PH", alpha3: "PHL" },
|
|
197
|
+
{ numeric: 612, name: "Pitcairn", alpha2: "PN", alpha3: "PCN" },
|
|
198
|
+
{ numeric: 616, name: "Poland", alpha2: "PL", alpha3: "POL" },
|
|
199
|
+
{ numeric: 620, name: "Portugal", alpha2: "PT", alpha3: "PRT" },
|
|
200
|
+
{ numeric: 630, name: "Puerto Rico", alpha2: "PR", alpha3: "PRI" },
|
|
201
|
+
{ numeric: 634, name: "Qatar", alpha2: "QA", alpha3: "QAT" },
|
|
202
|
+
{ numeric: 638, name: "Reunion", alpha2: "RE", alpha3: "REU" },
|
|
203
|
+
{ numeric: 642, name: "Romania", alpha2: "RO", alpha3: "ROU" },
|
|
204
|
+
{ numeric: 643, name: "Russian Federation", alpha2: "RU", alpha3: "RUS" },
|
|
205
|
+
{ numeric: 646, name: "Rwanda", alpha2: "RW", alpha3: "RWA" },
|
|
206
|
+
{ numeric: 654, name: "Saint Helena", alpha2: "SH", alpha3: "SHN" },
|
|
207
|
+
{ numeric: 659, name: "Saint Kitts and Nevis", alpha2: "KN", alpha3: "KNA" },
|
|
208
|
+
{ numeric: 662, name: "Saint Lucia", alpha2: "LC", alpha3: "LCA" },
|
|
209
|
+
{ numeric: 666, name: "Saint Pierre and Miquelon", alpha2: "PM", alpha3: "SPM" },
|
|
210
|
+
{ numeric: 670, name: "Saint Vincent and the Grenadines", alpha2: "VC", alpha3: "VCT" },
|
|
211
|
+
{ numeric: 882, name: "Samoa", alpha2: "WS", alpha3: "WSM" },
|
|
212
|
+
{ numeric: 674, name: "San Marino", alpha2: "SM", alpha3: "SMR" },
|
|
213
|
+
{ numeric: 678, name: "Sao Tome and Principe", alpha2: "ST", alpha3: "STP" },
|
|
214
|
+
{ numeric: 682, name: "Saudi Arabia", alpha2: "SA", alpha3: "SAU" },
|
|
215
|
+
{ numeric: 686, name: "Senegal", alpha2: "SN", alpha3: "SEN" },
|
|
216
|
+
{ numeric: 688, name: "Serbia", alpha2: "RS", alpha3: "SRB" },
|
|
217
|
+
{ numeric: 690, name: "Seychelles", alpha2: "SC", alpha3: "SYC" },
|
|
218
|
+
{ numeric: 694, name: "Sierra Leone", alpha2: "SL", alpha3: "SLE" },
|
|
219
|
+
{ numeric: 702, name: "Singapore", alpha2: "SG", alpha3: "SGP" },
|
|
220
|
+
{ numeric: 703, name: "Slovakia", alpha2: "SK", alpha3: "SVK" },
|
|
221
|
+
{ numeric: 705, name: "Slovenia", alpha2: "SI", alpha3: "SVN" },
|
|
222
|
+
{ numeric: 90, name: "Solomon Islands", alpha2: "SB", alpha3: "SLB" },
|
|
223
|
+
{ numeric: 706, name: "Somalia", alpha2: "SO", alpha3: "SOM" },
|
|
224
|
+
{ numeric: 710, name: "South Africa", alpha2: "ZA", alpha3: "ZAF" },
|
|
225
|
+
{
|
|
226
|
+
numeric: 239,
|
|
227
|
+
name: "South Georgia and the South Sandwich Islands",
|
|
228
|
+
alpha2: "GS",
|
|
229
|
+
alpha3: "SGS"
|
|
230
|
+
},
|
|
231
|
+
{ numeric: 724, name: "Spain", alpha2: "ES", alpha3: "ESP" },
|
|
232
|
+
{ numeric: 144, name: "Sri Lanka", alpha2: "LK", alpha3: "LKA" },
|
|
233
|
+
{ numeric: 736, name: "Sudan", alpha2: "SD", alpha3: "SDN" },
|
|
234
|
+
{ numeric: 740, name: "Suriname", alpha2: "SR", alpha3: "SUR" },
|
|
235
|
+
{ numeric: 744, name: "Svalbard and Jan Mayen", alpha2: "SJ", alpha3: "SJM" },
|
|
236
|
+
{ numeric: 748, name: "Swaziland", alpha2: "SZ", alpha3: "SWZ" },
|
|
237
|
+
{ numeric: 752, name: "Sweden", alpha2: "SE", alpha3: "SWE" },
|
|
238
|
+
{ numeric: 756, name: "Switzerland", alpha2: "CH", alpha3: "CHE" },
|
|
239
|
+
{ numeric: 760, name: "Syrian Arab Republic", alpha2: "SY", alpha3: "SYR" },
|
|
240
|
+
{ numeric: 158, name: "Taiwan, Province of China", alpha2: "TW", alpha3: "TWN" },
|
|
241
|
+
{ numeric: 762, name: "Tajikistan", alpha2: "TJ", alpha3: "TJK" },
|
|
242
|
+
{ numeric: 834, name: "Tanzania, United Republic of", alpha2: "TZ", alpha3: "TZA" },
|
|
243
|
+
{ numeric: 764, name: "Thailand", alpha2: "TH", alpha3: "THA" },
|
|
244
|
+
{ numeric: 626, name: "Timor-Leste", alpha2: "TL", alpha3: "TLS" },
|
|
245
|
+
{ numeric: 768, name: "Togo", alpha2: "TG", alpha3: "TGO" },
|
|
246
|
+
{ numeric: 772, name: "Tokelau", alpha2: "TK", alpha3: "TKL" },
|
|
247
|
+
{ numeric: 776, name: "Tonga", alpha2: "TO", alpha3: "TON" },
|
|
248
|
+
{ numeric: 780, name: "Trinidad and Tobago", alpha2: "TT", alpha3: "TTO" },
|
|
249
|
+
{ numeric: 788, name: "Tunisia", alpha2: "TN", alpha3: "TUN" },
|
|
250
|
+
{ numeric: 792, name: "T\xFCrkiye, The Republic of", alpha2: "TR", alpha3: "TUR" },
|
|
251
|
+
{ numeric: 795, name: "Turkmenistan", alpha2: "TM", alpha3: "TKM" },
|
|
252
|
+
{ numeric: 796, name: "Turks and Caicos Islands", alpha2: "TC", alpha3: "TCA" },
|
|
253
|
+
{ numeric: 798, name: "Tuvalu", alpha2: "TV", alpha3: "TUV" },
|
|
254
|
+
{ numeric: 800, name: "Uganda", alpha2: "UG", alpha3: "UGA" },
|
|
255
|
+
{ numeric: 804, name: "Ukraine", alpha2: "UA", alpha3: "UKR" },
|
|
256
|
+
{ numeric: 784, name: "United Arab Emirates", alpha2: "AE", alpha3: "ARE" },
|
|
257
|
+
{ numeric: 275, name: "Palestine, State of", alpha2: "PS", alpha3: "PSE" },
|
|
258
|
+
{ numeric: 826, name: "United Kingdom", alpha2: "GB", alpha3: "GBR" },
|
|
259
|
+
{ numeric: 840, name: "United States", alpha2: "US", alpha3: "USA" },
|
|
260
|
+
{ numeric: 581, name: "United States Minor Outlying Islands", alpha2: "UM", alpha3: "UMI" },
|
|
261
|
+
{ numeric: 858, name: "Uruguay", alpha2: "UY", alpha3: "URY" },
|
|
262
|
+
{ numeric: 860, name: "Uzbekistan", alpha2: "UZ", alpha3: "UZB" },
|
|
263
|
+
{ numeric: 548, name: "Vanuatu", alpha2: "VU", alpha3: "VUT" },
|
|
264
|
+
{ numeric: 862, name: "Venezuela", alpha2: "VE", alpha3: "VEN" },
|
|
265
|
+
{ numeric: 704, name: "Viet Nam", alpha2: "VN", alpha3: "VNM" },
|
|
266
|
+
{ numeric: 92, name: "Virgin Islands, British", alpha2: "VG", alpha3: "VGB" },
|
|
267
|
+
{ numeric: 850, name: "Virgin Islands, U.s.", alpha2: "VI", alpha3: "VIR" },
|
|
268
|
+
{ numeric: 876, name: "Wallis and Futuna", alpha2: "WF", alpha3: "WLF" },
|
|
269
|
+
{ numeric: 732, name: "Western Sahara", alpha2: "EH", alpha3: "ESH" },
|
|
270
|
+
{ numeric: 887, name: "Yemen", alpha2: "YE", alpha3: "YEM" },
|
|
271
|
+
{ numeric: 894, name: "Zambia", alpha2: "ZM", alpha3: "ZMB" },
|
|
272
|
+
{ numeric: 716, name: "Zimbabwe", alpha2: "ZW", alpha3: "ZWE" },
|
|
273
|
+
{ numeric: 499, name: "Montenegro", alpha2: "ME", alpha3: "MNE" },
|
|
274
|
+
{ numeric: 0, name: "Kosovo", alpha2: "XK", alpha3: "XKX" },
|
|
275
|
+
// Note: XK is user-assigned
|
|
276
|
+
{ numeric: 248, name: "Aland Islands", alpha2: "AX", alpha3: "ALA" },
|
|
277
|
+
{ numeric: 535, name: "Bonaire, Sint Eustatius and Saba", alpha2: "BQ", alpha3: "BES" },
|
|
278
|
+
{ numeric: 531, name: "Curacao", alpha2: "CW", alpha3: "CUW" },
|
|
279
|
+
{ numeric: 831, name: "Guernsey", alpha2: "GG", alpha3: "GGY" },
|
|
280
|
+
{ numeric: 833, name: "Isle of Man", alpha2: "IM", alpha3: "IMN" },
|
|
281
|
+
{ numeric: 832, name: "Jersey", alpha2: "JE", alpha3: "JEY" },
|
|
282
|
+
{ numeric: 652, name: "Saint Barthelemy", alpha2: "BL", alpha3: "BLM" },
|
|
283
|
+
{ numeric: 663, name: "Saint Martin", alpha2: "MF", alpha3: "MAF" },
|
|
284
|
+
{ numeric: 534, name: "Sint Maarten", alpha2: "SX", alpha3: "SXM" },
|
|
285
|
+
{ numeric: 728, name: "South Sudan", alpha2: "SS", alpha3: "SSD" },
|
|
286
|
+
{ numeric: 166, name: "Cocos (Keeling) Islands", alpha2: "CC", alpha3: "CCK" }
|
|
287
|
+
];
|
|
288
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
289
|
+
0 && (module.exports = {
|
|
290
|
+
ISO_3601_1
|
|
291
|
+
});
|
|
292
|
+
//# sourceMappingURL=iso_3601_1.cjs.map
|