@bouko/ts 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,4 @@
1
- export type StringMap = Record<string, string>;
2
- export type JsonMap = {
3
- [key: string]: JsonValue | JsonValue[];
4
- };
5
- export type JsonValue = string | number | boolean | null | undefined | JsonMap;
1
+ import type { JsonMap, JsonValue } from "./types";
2
+ export * from "./types";
6
3
  export declare const isJsonMap: (value: unknown) => value is JsonMap;
7
4
  export declare const isJsonValue: (value: unknown) => value is JsonValue;
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from "./types";
1
2
  export const isJsonMap = (value) => {
2
3
  if (typeof value !== "object" ||
3
4
  value === null ||
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Type definitions for common data structures.
3
+ *
4
+ * - `StringMap`: Map of string keys to string values.
5
+ * - `JsonMap`: Object of primitives, arrays, or nested maps.
6
+ * - `JsonValue`: Union type representing a valid JSON value.
7
+ *
8
+ * They are intended to facilitate type-safe handling
9
+ * of generic objects (ex. forms)
10
+ **/
11
+ export type StringMap = Record<string, string>;
12
+ export type JsonMap = {
13
+ [key: string]: JsonValue | JsonValue[];
14
+ };
15
+ export type JsonValue = string | number | boolean | null | undefined | JsonMap;
package/dist/types.js ADDED
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Type definitions for common data structures.
3
+ *
4
+ * - `StringMap`: Map of string keys to string values.
5
+ * - `JsonMap`: Object of primitives, arrays, or nested maps.
6
+ * - `JsonValue`: Union type representing a valid JSON value.
7
+ *
8
+ * They are intended to facilitate type-safe handling
9
+ * of generic objects (ex. forms)
10
+ **/
11
+ export {};
12
+ // clean
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/ts",
4
- "version": "0.1.2",
4
+ "version": "0.1.3",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",