@c-time/frelio-data-json 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* frelio-data-json 操作タイプ
|
|
3
|
+
*/
|
|
4
|
+
export type FrelioDataJsonType = "create" | "update" | "delete";
|
|
5
|
+
/**
|
|
6
|
+
* frelio-data-json 単一エントリ
|
|
7
|
+
*/
|
|
8
|
+
export type FrelioDataJson = {
|
|
9
|
+
type: FrelioDataJsonType;
|
|
10
|
+
template: string;
|
|
11
|
+
outputFile: string;
|
|
12
|
+
data: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* 型ガード: FrelioDataJson
|
|
16
|
+
*/
|
|
17
|
+
export declare function isFrelioDataJson(value: unknown): value is FrelioDataJson;
|
|
18
|
+
/**
|
|
19
|
+
* 型ガード: FrelioDataJson[]
|
|
20
|
+
*/
|
|
21
|
+
export declare function isFrelioDataJsonArray(value: unknown): value is FrelioDataJson[];
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,kBAAkB,CAAA;IACxB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC9B,CAAA;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAYxE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,EAAE,CAE/E"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 型ガード: FrelioDataJson
|
|
3
|
+
*/
|
|
4
|
+
export function isFrelioDataJson(value) {
|
|
5
|
+
if (typeof value !== 'object' || value === null) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
const obj = value;
|
|
9
|
+
return ((obj.type === 'create' || obj.type === 'update' || obj.type === 'delete') &&
|
|
10
|
+
typeof obj.template === 'string' &&
|
|
11
|
+
typeof obj.outputFile === 'string' &&
|
|
12
|
+
typeof obj.data === 'object' &&
|
|
13
|
+
obj.data !== null);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* 型ガード: FrelioDataJson[]
|
|
17
|
+
*/
|
|
18
|
+
export function isFrelioDataJsonArray(value) {
|
|
19
|
+
return Array.isArray(value) && value.every(isFrelioDataJson);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,GAAG,GAAG,KAAgC,CAAA;IAC5C,OAAO,CACL,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC;QACzE,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAChC,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;QAC5B,GAAG,CAAC,IAAI,KAAK,IAAI,CAClB,CAAA;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAc;IAClD,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAA;AAC9D,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@c-time/frelio-data-json",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Type definitions for frelio data JSON output",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc -p tsconfig.build.json",
|
|
20
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"keywords": [
|
|
24
|
+
"frelio",
|
|
25
|
+
"data-json",
|
|
26
|
+
"typescript",
|
|
27
|
+
"types",
|
|
28
|
+
"cms"
|
|
29
|
+
],
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"typescript": "^5.7.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=18"
|
|
36
|
+
}
|
|
37
|
+
}
|