prismic-ts-codegen 0.1.11 → 0.1.13
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/_node_modules/quick-lru/index.cjs +234 -0
- package/dist/_node_modules/quick-lru/index.cjs.map +1 -0
- package/dist/_node_modules/quick-lru/index.js +235 -0
- package/dist/_node_modules/quick-lru/index.js.map +1 -0
- package/dist/constants.cjs +19 -21
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.ts +2 -3
- package/dist/constants.js +19 -21
- package/dist/constants.js.map +1 -1
- package/dist/generateTypes.cjs +71 -90
- package/dist/generateTypes.cjs.map +1 -1
- package/dist/generateTypes.d.ts +2 -1
- package/dist/generateTypes.js +71 -90
- package/dist/generateTypes.js.map +1 -1
- package/dist/lib/addBlankLine.cjs +12 -0
- package/dist/lib/addBlankLine.cjs.map +1 -0
- package/dist/lib/addBlankLine.d.ts +5 -0
- package/dist/lib/addBlankLine.js +12 -0
- package/dist/lib/addBlankLine.js.map +1 -0
- package/dist/lib/addLine.cjs +8 -0
- package/dist/lib/addLine.cjs.map +1 -0
- package/dist/lib/addLine.d.ts +1 -0
- package/dist/lib/addLine.js +8 -0
- package/dist/lib/addLine.js.map +1 -0
- package/dist/lib/addSection.cjs +8 -0
- package/dist/lib/addSection.cjs.map +1 -0
- package/dist/lib/addSection.d.ts +1 -0
- package/dist/lib/addSection.js +8 -0
- package/dist/lib/addSection.js.map +1 -0
- package/dist/lib/addTrailingNewLine.cjs +11 -0
- package/dist/lib/addTrailingNewLine.cjs.map +1 -0
- package/dist/lib/addTrailingNewLine.d.ts +5 -0
- package/dist/lib/addTrailingNewLine.js +11 -0
- package/dist/lib/addTrailingNewLine.js.map +1 -0
- package/dist/lib/buildCustomTypeDataType.cjs +51 -0
- package/dist/lib/buildCustomTypeDataType.cjs.map +1 -0
- package/dist/lib/buildCustomTypeDataType.d.ts +13 -0
- package/dist/lib/buildCustomTypeDataType.js +51 -0
- package/dist/lib/buildCustomTypeDataType.js.map +1 -0
- package/dist/lib/buildCustomTypeType.cjs +60 -0
- package/dist/lib/buildCustomTypeType.cjs.map +1 -0
- package/dist/lib/buildCustomTypeType.d.ts +17 -0
- package/dist/lib/buildCustomTypeType.js +60 -0
- package/dist/lib/buildCustomTypeType.js.map +1 -0
- package/dist/lib/buildFieldDocs.cjs +67 -35
- package/dist/lib/buildFieldDocs.cjs.map +1 -1
- package/dist/lib/buildFieldDocs.d.ts +7 -11
- package/dist/lib/buildFieldDocs.js +67 -35
- package/dist/lib/buildFieldDocs.js.map +1 -1
- package/dist/lib/buildFieldProperties.cjs +300 -0
- package/dist/lib/buildFieldProperties.cjs.map +1 -0
- package/dist/lib/buildFieldProperties.d.ts +14 -0
- package/dist/lib/buildFieldProperties.js +300 -0
- package/dist/lib/buildFieldProperties.js.map +1 -0
- package/dist/lib/buildSharedSliceType.cjs +140 -0
- package/dist/lib/buildSharedSliceType.cjs.map +1 -0
- package/dist/lib/buildSharedSliceType.d.ts +16 -0
- package/dist/lib/buildSharedSliceType.js +140 -0
- package/dist/lib/buildSharedSliceType.js.map +1 -0
- package/dist/lib/buildTypeName.cjs +4 -2
- package/dist/lib/buildTypeName.cjs.map +1 -1
- package/dist/lib/buildTypeName.js +4 -2
- package/dist/lib/buildTypeName.js.map +1 -1
- package/dist/lib/buildUnion.cjs +7 -0
- package/dist/lib/buildUnion.cjs.map +1 -0
- package/dist/lib/buildUnion.d.ts +1 -0
- package/dist/lib/buildUnion.js +7 -0
- package/dist/lib/buildUnion.js.map +1 -0
- package/dist/lib/checkHasUIDFIeld.cjs +7 -0
- package/dist/lib/checkHasUIDFIeld.cjs.map +1 -0
- package/dist/lib/checkHasUIDFIeld.d.ts +2 -0
- package/dist/lib/checkHasUIDFIeld.js +7 -0
- package/dist/lib/checkHasUIDFIeld.js.map +1 -0
- package/dist/lib/getAPIIDPath.cjs +18 -14
- package/dist/lib/getAPIIDPath.cjs.map +1 -1
- package/dist/lib/getAPIIDPath.d.ts +4 -8
- package/dist/lib/getAPIIDPath.js +18 -14
- package/dist/lib/getAPIIDPath.js.map +1 -1
- package/dist/lib/getCacheKey.cjs +25 -0
- package/dist/lib/getCacheKey.cjs.map +1 -0
- package/dist/lib/getCacheKey.d.ts +9 -0
- package/dist/lib/getCacheKey.js +8 -0
- package/dist/lib/getCacheKey.js.map +1 -0
- package/dist/lib/getHumanReadableModelName.cjs +13 -17
- package/dist/lib/getHumanReadableModelName.cjs.map +1 -1
- package/dist/lib/getHumanReadableModelName.d.ts +3 -3
- package/dist/lib/getHumanReadableModelName.js +13 -17
- package/dist/lib/getHumanReadableModelName.js.map +1 -1
- package/dist/lib/{getHumanReadableFieldPath.cjs → getHumanReadablePath.cjs} +8 -8
- package/dist/lib/getHumanReadablePath.cjs.map +1 -0
- package/dist/lib/getHumanReadablePath.d.ts +6 -0
- package/dist/lib/{getHumanReadableFieldPath.js → getHumanReadablePath.js} +8 -8
- package/dist/lib/getHumanReadablePath.js.map +1 -0
- package/dist/types.d.ts +9 -1
- package/package.json +18 -17
- package/src/constants.ts +19 -22
- package/src/generateTypes.ts +109 -108
- package/src/lib/addBlankLine.ts +13 -0
- package/src/lib/addLine.ts +5 -0
- package/src/lib/addSection.ts +5 -0
- package/src/lib/addTrailingNewLine.ts +14 -0
- package/src/lib/buildCustomTypeDataType.ts +74 -0
- package/src/lib/buildCustomTypeType.ts +101 -0
- package/src/lib/buildFieldDocs.ts +128 -68
- package/src/lib/buildFieldProperties.ts +513 -0
- package/src/lib/buildSharedSliceType.ts +213 -0
- package/src/lib/buildTypeName.ts +4 -2
- package/src/lib/buildUnion.ts +3 -0
- package/src/lib/checkHasUIDFIeld.ts +5 -0
- package/src/lib/getAPIIDPath.ts +40 -41
- package/src/lib/getCacheKey.ts +13 -0
- package/src/lib/getHumanReadableModelName.ts +23 -20
- package/src/lib/getHumanReadablePath.ts +24 -0
- package/src/types.ts +11 -1
- package/dist/lib/addInterfacePropertiesForFields.cjs +0 -489
- package/dist/lib/addInterfacePropertiesForFields.cjs.map +0 -1
- package/dist/lib/addInterfacePropertiesForFields.d.ts +0 -21
- package/dist/lib/addInterfacePropertiesForFields.js +0 -489
- package/dist/lib/addInterfacePropertiesForFields.js.map +0 -1
- package/dist/lib/addTypeAliasForCustomType.cjs +0 -81
- package/dist/lib/addTypeAliasForCustomType.cjs.map +0 -1
- package/dist/lib/addTypeAliasForCustomType.d.ts +0 -11
- package/dist/lib/addTypeAliasForCustomType.js +0 -81
- package/dist/lib/addTypeAliasForCustomType.js.map +0 -1
- package/dist/lib/addTypeAliasForSharedSlice.cjs +0 -149
- package/dist/lib/addTypeAliasForSharedSlice.cjs.map +0 -1
- package/dist/lib/addTypeAliasForSharedSlice.d.ts +0 -10
- package/dist/lib/addTypeAliasForSharedSlice.js +0 -149
- package/dist/lib/addTypeAliasForSharedSlice.js.map +0 -1
- package/dist/lib/buildSharedSliceInterfaceNamePart.cjs +0 -8
- package/dist/lib/buildSharedSliceInterfaceNamePart.cjs.map +0 -1
- package/dist/lib/buildSharedSliceInterfaceNamePart.d.ts +0 -5
- package/dist/lib/buildSharedSliceInterfaceNamePart.js +0 -8
- package/dist/lib/buildSharedSliceInterfaceNamePart.js.map +0 -1
- package/dist/lib/getFieldDocumentationURL.cjs +0 -8
- package/dist/lib/getFieldDocumentationURL.cjs.map +0 -1
- package/dist/lib/getFieldDocumentationURL.d.ts +0 -6
- package/dist/lib/getFieldDocumentationURL.js +0 -8
- package/dist/lib/getFieldDocumentationURL.js.map +0 -1
- package/dist/lib/getHumanReadableFieldPath.cjs.map +0 -1
- package/dist/lib/getHumanReadableFieldPath.d.ts +0 -10
- package/dist/lib/getHumanReadableFieldPath.js.map +0 -1
- package/dist/lib/getHumanReadableFieldType.cjs +0 -36
- package/dist/lib/getHumanReadableFieldType.cjs.map +0 -1
- package/dist/lib/getHumanReadableFieldType.d.ts +0 -6
- package/dist/lib/getHumanReadableFieldType.js +0 -36
- package/dist/lib/getHumanReadableFieldType.js.map +0 -1
- package/dist/lib/getSourceFileText.cjs +0 -9
- package/dist/lib/getSourceFileText.cjs.map +0 -1
- package/dist/lib/getSourceFileText.d.ts +0 -2
- package/dist/lib/getSourceFileText.js +0 -9
- package/dist/lib/getSourceFileText.js.map +0 -1
- package/dist/lib/hasOwnProperty.cjs +0 -7
- package/dist/lib/hasOwnProperty.cjs.map +0 -1
- package/dist/lib/hasOwnProperty.d.ts +0 -10
- package/dist/lib/hasOwnProperty.js +0 -7
- package/dist/lib/hasOwnProperty.js.map +0 -1
- package/dist/lib/isCustomTypeModel.cjs +0 -7
- package/dist/lib/isCustomTypeModel.cjs.map +0 -1
- package/dist/lib/isCustomTypeModel.d.ts +0 -2
- package/dist/lib/isCustomTypeModel.js +0 -7
- package/dist/lib/isCustomTypeModel.js.map +0 -1
- package/dist/lib/isCustomTypeModelField.cjs +0 -7
- package/dist/lib/isCustomTypeModelField.cjs.map +0 -1
- package/dist/lib/isCustomTypeModelField.d.ts +0 -2
- package/dist/lib/isCustomTypeModelField.js +0 -7
- package/dist/lib/isCustomTypeModelField.js.map +0 -1
- package/dist/lib/isCustomTypeModelSlice.cjs +0 -8
- package/dist/lib/isCustomTypeModelSlice.cjs.map +0 -1
- package/dist/lib/isCustomTypeModelSlice.d.ts +0 -2
- package/dist/lib/isCustomTypeModelSlice.js +0 -8
- package/dist/lib/isCustomTypeModelSlice.js.map +0 -1
- package/dist/lib/isSharedSliceModel.cjs +0 -8
- package/dist/lib/isSharedSliceModel.cjs.map +0 -1
- package/dist/lib/isSharedSliceModel.d.ts +0 -2
- package/dist/lib/isSharedSliceModel.js +0 -8
- package/dist/lib/isSharedSliceModel.js.map +0 -1
- package/dist/lib/pascalCase.cjs +0 -8
- package/dist/lib/pascalCase.cjs.map +0 -1
- package/dist/lib/pascalCase.d.ts +0 -1
- package/dist/lib/pascalCase.js +0 -8
- package/dist/lib/pascalCase.js.map +0 -1
- package/dist/lib/writeFieldDocsDescription.cjs +0 -29
- package/dist/lib/writeFieldDocsDescription.cjs.map +0 -1
- package/dist/lib/writeFieldDocsDescription.d.ts +0 -13
- package/dist/lib/writeFieldDocsDescription.js +0 -29
- package/dist/lib/writeFieldDocsDescription.js.map +0 -1
- package/src/lib/addInterfacePropertiesForFields.ts +0 -665
- package/src/lib/addTypeAliasForCustomType.ts +0 -120
- package/src/lib/addTypeAliasForSharedSlice.ts +0 -201
- package/src/lib/buildSharedSliceInterfaceNamePart.ts +0 -11
- package/src/lib/getFieldDocumentationURL.ts +0 -15
- package/src/lib/getHumanReadableFieldPath.ts +0 -36
- package/src/lib/getHumanReadableFieldType.ts +0 -55
- package/src/lib/getSourceFileText.ts +0 -14
- package/src/lib/hasOwnProperty.ts +0 -15
- package/src/lib/isCustomTypeModel.ts +0 -5
- package/src/lib/isCustomTypeModelField.ts +0 -7
- package/src/lib/isCustomTypeModelSlice.ts +0 -14
- package/src/lib/isSharedSliceModel.ts +0 -14
- package/src/lib/pascalCase.ts +0 -9
- package/src/lib/writeFieldDocsDescription.ts +0 -51
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const constants = require("../constants.cjs");
|
|
4
|
-
const getSourceFileText = (sourceFile) => {
|
|
5
|
-
const text = sourceFile.print().replace(new RegExp(constants.BLANK_LINE_IDENTIFIER, "g"), "");
|
|
6
|
-
return text;
|
|
7
|
-
};
|
|
8
|
-
exports.getSourceFileText = getSourceFileText;
|
|
9
|
-
//# sourceMappingURL=getSourceFileText.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceFileText.cjs","sources":["../../../src/lib/getSourceFileText.ts"],"sourcesContent":["import * as tsm from \"ts-morph\";\n\n// import prettier from \"prettier\";\nimport { BLANK_LINE_IDENTIFIER } from \"../constants\";\n\nexport const getSourceFileText = (sourceFile: tsm.SourceFile): string => {\n\tconst text = sourceFile\n\t\t.print()\n\t\t.replace(new RegExp(BLANK_LINE_IDENTIFIER, \"g\"), \"\");\n\n\treturn text;\n\n\t// return prettier.format(text, { parser: \"typescript\" });\n};\n"],"names":["BLANK_LINE_IDENTIFIER"],"mappings":";;;AAKa,MAAA,oBAAoB,CAAC,eAAsC;AACjE,QAAA,OAAO,WACX,MAAA,EACA,QAAQ,IAAI,OAAOA,iCAAuB,GAAG,GAAG,EAAE;AAE7C,SAAA;AAGR;;"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BLANK_LINE_IDENTIFIER } from "../constants.js";
|
|
2
|
-
const getSourceFileText = (sourceFile) => {
|
|
3
|
-
const text = sourceFile.print().replace(new RegExp(BLANK_LINE_IDENTIFIER, "g"), "");
|
|
4
|
-
return text;
|
|
5
|
-
};
|
|
6
|
-
export {
|
|
7
|
-
getSourceFileText
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=getSourceFileText.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getSourceFileText.js","sources":["../../../src/lib/getSourceFileText.ts"],"sourcesContent":["import * as tsm from \"ts-morph\";\n\n// import prettier from \"prettier\";\nimport { BLANK_LINE_IDENTIFIER } from \"../constants\";\n\nexport const getSourceFileText = (sourceFile: tsm.SourceFile): string => {\n\tconst text = sourceFile\n\t\t.print()\n\t\t.replace(new RegExp(BLANK_LINE_IDENTIFIER, \"g\"), \"\");\n\n\treturn text;\n\n\t// return prettier.format(text, { parser: \"typescript\" });\n};\n"],"names":[],"mappings":";AAKa,MAAA,oBAAoB,CAAC,eAAsC;AACjE,QAAA,OAAO,WACX,MAAA,EACA,QAAQ,IAAI,OAAO,uBAAuB,GAAG,GAAG,EAAE;AAE7C,SAAA;AAGR;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasOwnProperty.cjs","sources":["../../../src/lib/hasOwnProperty.ts"],"sourcesContent":["/**\n * Determines if an object contains a given property. It augments the provided\n * object's type to include the property.\n *\n * @remarks\n * This function is only necessary because TypeScript does not narrow a type\n * after using the `in` operator on `object`.\n * @returns `true` if `obj` contains a `prop` property, `false` otherwise.\n */\nexport const hasOwnProperty = <X extends object, Y extends PropertyKey>(\n\tobj: X,\n\tprop: Y,\n): obj is X & Record<Y, unknown> => {\n\treturn obj.hasOwnProperty(prop);\n};\n"],"names":[],"mappings":";;AASa,MAAA,iBAAiB,CAC7B,KACA,SACkC;AAC3B,SAAA,IAAI,eAAe,IAAI;AAC/B;;"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Determines if an object contains a given property. It augments the provided
|
|
3
|
-
* object's type to include the property.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* This function is only necessary because TypeScript does not narrow a type
|
|
7
|
-
* after using the `in` operator on `object`.
|
|
8
|
-
* @returns `true` if `obj` contains a `prop` property, `false` otherwise.
|
|
9
|
-
*/
|
|
10
|
-
export declare const hasOwnProperty: <X extends object, Y extends PropertyKey>(obj: X, prop: Y) => obj is X & Record<Y, unknown>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hasOwnProperty.js","sources":["../../../src/lib/hasOwnProperty.ts"],"sourcesContent":["/**\n * Determines if an object contains a given property. It augments the provided\n * object's type to include the property.\n *\n * @remarks\n * This function is only necessary because TypeScript does not narrow a type\n * after using the `in` operator on `object`.\n * @returns `true` if `obj` contains a `prop` property, `false` otherwise.\n */\nexport const hasOwnProperty = <X extends object, Y extends PropertyKey>(\n\tobj: X,\n\tprop: Y,\n): obj is X & Record<Y, unknown> => {\n\treturn obj.hasOwnProperty(prop);\n};\n"],"names":[],"mappings":"AASa,MAAA,iBAAiB,CAC7B,KACA,SACkC;AAC3B,SAAA,IAAI,eAAe,IAAI;AAC/B;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const isCustomTypeModel = (model) => {
|
|
4
|
-
return typeof model === "object" && model !== null && "json" in model;
|
|
5
|
-
};
|
|
6
|
-
exports.isCustomTypeModel = isCustomTypeModel;
|
|
7
|
-
//# sourceMappingURL=isCustomTypeModel.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModel.cjs","sources":["../../../src/lib/isCustomTypeModel.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\n\nexport const isCustomTypeModel = (model: unknown): model is CustomTypeModel => {\n\treturn typeof model === \"object\" && model !== null && \"json\" in model;\n};\n"],"names":[],"mappings":";;AAEa,MAAA,oBAAoB,CAAC,UAA4C;AAC7E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModel.js","sources":["../../../src/lib/isCustomTypeModel.ts"],"sourcesContent":["import type { CustomTypeModel } from \"@prismicio/client\";\n\nexport const isCustomTypeModel = (model: unknown): model is CustomTypeModel => {\n\treturn typeof model === \"object\" && model !== null && \"json\" in model;\n};\n"],"names":[],"mappings":"AAEa,MAAA,oBAAoB,CAAC,UAA4C;AAC7E,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const isCustomTypeModelField = (model) => {
|
|
4
|
-
return typeof model === "object" && model !== null && "type" in model;
|
|
5
|
-
};
|
|
6
|
-
exports.isCustomTypeModelField = isCustomTypeModelField;
|
|
7
|
-
//# sourceMappingURL=isCustomTypeModelField.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModelField.cjs","sources":["../../../src/lib/isCustomTypeModelField.ts"],"sourcesContent":["import type { CustomTypeModelField } from \"@prismicio/client\";\n\nexport const isCustomTypeModelField = (\n\tmodel: unknown,\n): model is CustomTypeModelField => {\n\treturn typeof model === \"object\" && model !== null && \"type\" in model;\n};\n"],"names":[],"mappings":";;AAEa,MAAA,yBAAyB,CACrC,UACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModelField.js","sources":["../../../src/lib/isCustomTypeModelField.ts"],"sourcesContent":["import type { CustomTypeModelField } from \"@prismicio/client\";\n\nexport const isCustomTypeModelField = (\n\tmodel: unknown,\n): model is CustomTypeModelField => {\n\treturn typeof model === \"object\" && model !== null && \"type\" in model;\n};\n"],"names":[],"mappings":"AAEa,MAAA,yBAAyB,CACrC,UACkC;AAClC,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AACjE;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hasOwnProperty = require("./hasOwnProperty.cjs");
|
|
4
|
-
const isCustomTypeModelSlice = (model) => {
|
|
5
|
-
return typeof model === "object" && model !== null && hasOwnProperty.hasOwnProperty(model, "type") && model.type === "Slice";
|
|
6
|
-
};
|
|
7
|
-
exports.isCustomTypeModelSlice = isCustomTypeModelSlice;
|
|
8
|
-
//# sourceMappingURL=isCustomTypeModelSlice.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModelSlice.cjs","sources":["../../../src/lib/isCustomTypeModelSlice.ts"],"sourcesContent":["import type { CustomTypeModelSlice } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isCustomTypeModelSlice = (\n\tmodel: unknown,\n): model is CustomTypeModelSlice => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"Slice\"\n\t);\n};\n"],"names":["hasOwnProperty"],"mappings":";;;AAIa,MAAA,yBAAyB,CACrC,UACkC;AAEjC,SAAA,OAAO,UAAU,YACjB,UAAU,QACVA,eAAAA,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { CustomTypeModelSlice } from "@prismicio/client";
|
|
2
|
-
export declare const isCustomTypeModelSlice: (model: unknown) => model is CustomTypeModelSlice<Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { hasOwnProperty } from "./hasOwnProperty.js";
|
|
2
|
-
const isCustomTypeModelSlice = (model) => {
|
|
3
|
-
return typeof model === "object" && model !== null && hasOwnProperty(model, "type") && model.type === "Slice";
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
isCustomTypeModelSlice
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=isCustomTypeModelSlice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isCustomTypeModelSlice.js","sources":["../../../src/lib/isCustomTypeModelSlice.ts"],"sourcesContent":["import type { CustomTypeModelSlice } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isCustomTypeModelSlice = (\n\tmodel: unknown,\n): model is CustomTypeModelSlice => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"Slice\"\n\t);\n};\n"],"names":[],"mappings":";AAIa,MAAA,yBAAyB,CACrC,UACkC;AAEjC,SAAA,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const hasOwnProperty = require("./hasOwnProperty.cjs");
|
|
4
|
-
const isSharedSliceModel = (model) => {
|
|
5
|
-
return typeof model === "object" && model !== null && hasOwnProperty.hasOwnProperty(model, "type") && model.type === "SharedSlice";
|
|
6
|
-
};
|
|
7
|
-
exports.isSharedSliceModel = isSharedSliceModel;
|
|
8
|
-
//# sourceMappingURL=isSharedSliceModel.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isSharedSliceModel.cjs","sources":["../../../src/lib/isSharedSliceModel.ts"],"sourcesContent":["import type { SharedSliceModel } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isSharedSliceModel = (\n\tmodel: unknown,\n): model is SharedSliceModel => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"SharedSlice\"\n\t);\n};\n"],"names":["hasOwnProperty"],"mappings":";;;AAIa,MAAA,qBAAqB,CACjC,UAC8B;AAE7B,SAAA,OAAO,UAAU,YACjB,UAAU,QACVA,eAAAA,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;;"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import type { SharedSliceModel } from "@prismicio/client";
|
|
2
|
-
export declare const isSharedSliceModel: (model: unknown) => model is SharedSliceModel<string, import("@prismicio/client").SharedSliceModelVariation<string, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>, Record<string, import("@prismicio/client").CustomTypeModelFieldForGroup>>>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { hasOwnProperty } from "./hasOwnProperty.js";
|
|
2
|
-
const isSharedSliceModel = (model) => {
|
|
3
|
-
return typeof model === "object" && model !== null && hasOwnProperty(model, "type") && model.type === "SharedSlice";
|
|
4
|
-
};
|
|
5
|
-
export {
|
|
6
|
-
isSharedSliceModel
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=isSharedSliceModel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isSharedSliceModel.js","sources":["../../../src/lib/isSharedSliceModel.ts"],"sourcesContent":["import type { SharedSliceModel } from \"@prismicio/client\";\n\nimport { hasOwnProperty } from \"./hasOwnProperty\";\n\nexport const isSharedSliceModel = (\n\tmodel: unknown,\n): model is SharedSliceModel => {\n\treturn (\n\t\ttypeof model === \"object\" &&\n\t\tmodel !== null &&\n\t\thasOwnProperty(model, \"type\") &&\n\t\tmodel.type === \"SharedSlice\"\n\t);\n};\n"],"names":[],"mappings":";AAIa,MAAA,qBAAqB,CACjC,UAC8B;AAE7B,SAAA,OAAO,UAAU,YACjB,UAAU,QACV,eAAe,OAAO,MAAM,KAC5B,MAAM,SAAS;AAEjB;"}
|
package/dist/lib/pascalCase.cjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const pascalCase$1 = require("pascal-case");
|
|
4
|
-
const pascalCase = (input) => pascalCase$1.pascalCase(input, {
|
|
5
|
-
transform: pascalCase$1.pascalCaseTransformMerge
|
|
6
|
-
});
|
|
7
|
-
exports.pascalCase = pascalCase;
|
|
8
|
-
//# sourceMappingURL=pascalCase.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pascalCase.cjs","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import {\n\tpascalCase as pascalCaseBase,\n\tpascalCaseTransformMerge,\n} from \"pascal-case\";\n\nexport const pascalCase = (input: string): string =>\n\tpascalCaseBase(input, {\n\t\ttransform: pascalCaseTransformMerge,\n\t});\n"],"names":["pascalCaseBase","pascalCaseTransformMerge"],"mappings":";;;AAKO,MAAM,aAAa,CAAC,UAC1BA,aAAA,WAAe,OAAO;AAAA,EACrB,WAAWC,aAAA;AACX,CAAA;;"}
|
package/dist/lib/pascalCase.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pascalCase: (input: string) => string;
|
package/dist/lib/pascalCase.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pascalCase.js","sources":["../../../src/lib/pascalCase.ts"],"sourcesContent":["import {\n\tpascalCase as pascalCaseBase,\n\tpascalCaseTransformMerge,\n} from \"pascal-case\";\n\nexport const pascalCase = (input: string): string =>\n\tpascalCaseBase(input, {\n\t\ttransform: pascalCaseTransformMerge,\n\t});\n"],"names":["pascalCaseBase"],"mappings":";AAKO,MAAM,aAAa,CAAC,UAC1BA,aAAe,OAAO;AAAA,EACrB,WAAW;AACX,CAAA;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const writeFieldDocsDescription = (config) => {
|
|
4
|
-
if (config.description) {
|
|
5
|
-
config.writer.writeLine(config.description);
|
|
6
|
-
}
|
|
7
|
-
config.writer.blankLineIfLastNot();
|
|
8
|
-
if (config.fieldType) {
|
|
9
|
-
config.writer.writeLine(`- **Field Type**: ${config.fieldType}`);
|
|
10
|
-
}
|
|
11
|
-
if (config.placeholder) {
|
|
12
|
-
config.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);
|
|
13
|
-
}
|
|
14
|
-
if (config.defaultValue !== void 0) {
|
|
15
|
-
const stringifiedDefaultValue = typeof config.defaultValue === "boolean" ? `${config.defaultValue}` : config.defaultValue;
|
|
16
|
-
config.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);
|
|
17
|
-
}
|
|
18
|
-
if (config.apiIDPath) {
|
|
19
|
-
config.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);
|
|
20
|
-
}
|
|
21
|
-
if (config.tabName) {
|
|
22
|
-
config.writer.writeLine(`- **Tab**: ${config.tabName}`);
|
|
23
|
-
}
|
|
24
|
-
if (config.documentationURL) {
|
|
25
|
-
config.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.writeFieldDocsDescription = writeFieldDocsDescription;
|
|
29
|
-
//# sourceMappingURL=writeFieldDocsDescription.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeFieldDocsDescription.cjs","sources":["../../../src/lib/writeFieldDocsDescription.ts"],"sourcesContent":["import type { CodeBlockWriter } from \"ts-morph\";\n\ntype BuildFieldDocsConfig = {\n\twriter: CodeBlockWriter;\n\tdescription?: string;\n\tfieldType?: string;\n\tdefaultValue?: string | boolean;\n\tplaceholder?: string;\n\tapiIDPath?: string;\n\ttabName?: string;\n\tdocumentationURL?: string;\n};\n\nexport const writeFieldDocsDescription = (\n\tconfig: BuildFieldDocsConfig,\n): void => {\n\tif (config.description) {\n\t\tconfig.writer.writeLine(config.description);\n\t}\n\n\tconfig.writer.blankLineIfLastNot();\n\n\tif (config.fieldType) {\n\t\tconfig.writer.writeLine(`- **Field Type**: ${config.fieldType}`);\n\t}\n\n\tif (config.placeholder) {\n\t\tconfig.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);\n\t}\n\n\tif (config.defaultValue !== undefined) {\n\t\tconst stringifiedDefaultValue =\n\t\t\ttypeof config.defaultValue === \"boolean\"\n\t\t\t\t? `${config.defaultValue}`\n\t\t\t\t: config.defaultValue;\n\n\t\tconfig.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);\n\t}\n\n\tif (config.apiIDPath) {\n\t\tconfig.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);\n\t}\n\n\tif (config.tabName) {\n\t\tconfig.writer.writeLine(`- **Tab**: ${config.tabName}`);\n\t}\n\n\tif (config.documentationURL) {\n\t\tconfig.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);\n\t}\n};\n"],"names":[],"mappings":";;AAaa,MAAA,4BAA4B,CACxC,WACS;AACT,MAAI,OAAO,aAAa;AAChB,WAAA,OAAO,UAAU,OAAO,WAAW;AAAA,EAC1C;AAED,SAAO,OAAO;AAEd,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,qBAAqB,OAAO,WAAW;AAAA,EAC/D;AAED,MAAI,OAAO,aAAa;AACvB,WAAO,OAAO,UAAU,sBAAsB,OAAO,aAAa;AAAA,EAClE;AAEG,MAAA,OAAO,iBAAiB,QAAW;AAChC,UAAA,0BACL,OAAO,OAAO,iBAAiB,YAC5B,GAAG,OAAO,iBACV,OAAO;AAEJ,WAAA,OAAO,UAAU,wBAAwB,yBAAyB;AAAA,EACzE;AAED,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,sBAAsB,OAAO,WAAW;AAAA,EAChE;AAED,MAAI,OAAO,SAAS;AACnB,WAAO,OAAO,UAAU,cAAc,OAAO,SAAS;AAAA,EACtD;AAED,MAAI,OAAO,kBAAkB;AAC5B,WAAO,OAAO,UAAU,wBAAwB,OAAO,kBAAkB;AAAA,EACzE;AACF;;"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { CodeBlockWriter } from "ts-morph";
|
|
2
|
-
type BuildFieldDocsConfig = {
|
|
3
|
-
writer: CodeBlockWriter;
|
|
4
|
-
description?: string;
|
|
5
|
-
fieldType?: string;
|
|
6
|
-
defaultValue?: string | boolean;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
apiIDPath?: string;
|
|
9
|
-
tabName?: string;
|
|
10
|
-
documentationURL?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare const writeFieldDocsDescription: (config: BuildFieldDocsConfig) => void;
|
|
13
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const writeFieldDocsDescription = (config) => {
|
|
2
|
-
if (config.description) {
|
|
3
|
-
config.writer.writeLine(config.description);
|
|
4
|
-
}
|
|
5
|
-
config.writer.blankLineIfLastNot();
|
|
6
|
-
if (config.fieldType) {
|
|
7
|
-
config.writer.writeLine(`- **Field Type**: ${config.fieldType}`);
|
|
8
|
-
}
|
|
9
|
-
if (config.placeholder) {
|
|
10
|
-
config.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);
|
|
11
|
-
}
|
|
12
|
-
if (config.defaultValue !== void 0) {
|
|
13
|
-
const stringifiedDefaultValue = typeof config.defaultValue === "boolean" ? `${config.defaultValue}` : config.defaultValue;
|
|
14
|
-
config.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);
|
|
15
|
-
}
|
|
16
|
-
if (config.apiIDPath) {
|
|
17
|
-
config.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);
|
|
18
|
-
}
|
|
19
|
-
if (config.tabName) {
|
|
20
|
-
config.writer.writeLine(`- **Tab**: ${config.tabName}`);
|
|
21
|
-
}
|
|
22
|
-
if (config.documentationURL) {
|
|
23
|
-
config.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
writeFieldDocsDescription
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=writeFieldDocsDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"writeFieldDocsDescription.js","sources":["../../../src/lib/writeFieldDocsDescription.ts"],"sourcesContent":["import type { CodeBlockWriter } from \"ts-morph\";\n\ntype BuildFieldDocsConfig = {\n\twriter: CodeBlockWriter;\n\tdescription?: string;\n\tfieldType?: string;\n\tdefaultValue?: string | boolean;\n\tplaceholder?: string;\n\tapiIDPath?: string;\n\ttabName?: string;\n\tdocumentationURL?: string;\n};\n\nexport const writeFieldDocsDescription = (\n\tconfig: BuildFieldDocsConfig,\n): void => {\n\tif (config.description) {\n\t\tconfig.writer.writeLine(config.description);\n\t}\n\n\tconfig.writer.blankLineIfLastNot();\n\n\tif (config.fieldType) {\n\t\tconfig.writer.writeLine(`- **Field Type**: ${config.fieldType}`);\n\t}\n\n\tif (config.placeholder) {\n\t\tconfig.writer.writeLine(`- **Placeholder**: ${config.placeholder}`);\n\t}\n\n\tif (config.defaultValue !== undefined) {\n\t\tconst stringifiedDefaultValue =\n\t\t\ttypeof config.defaultValue === \"boolean\"\n\t\t\t\t? `${config.defaultValue}`\n\t\t\t\t: config.defaultValue;\n\n\t\tconfig.writer.writeLine(`- **Default Value**: ${stringifiedDefaultValue}`);\n\t}\n\n\tif (config.apiIDPath) {\n\t\tconfig.writer.writeLine(`- **API ID Path**: ${config.apiIDPath}`);\n\t}\n\n\tif (config.tabName) {\n\t\tconfig.writer.writeLine(`- **Tab**: ${config.tabName}`);\n\t}\n\n\tif (config.documentationURL) {\n\t\tconfig.writer.writeLine(`- **Documentation**: ${config.documentationURL}`);\n\t}\n};\n"],"names":[],"mappings":"AAaa,MAAA,4BAA4B,CACxC,WACS;AACT,MAAI,OAAO,aAAa;AAChB,WAAA,OAAO,UAAU,OAAO,WAAW;AAAA,EAC1C;AAED,SAAO,OAAO;AAEd,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,qBAAqB,OAAO,WAAW;AAAA,EAC/D;AAED,MAAI,OAAO,aAAa;AACvB,WAAO,OAAO,UAAU,sBAAsB,OAAO,aAAa;AAAA,EAClE;AAEG,MAAA,OAAO,iBAAiB,QAAW;AAChC,UAAA,0BACL,OAAO,OAAO,iBAAiB,YAC5B,GAAG,OAAO,iBACV,OAAO;AAEJ,WAAA,OAAO,UAAU,wBAAwB,yBAAyB;AAAA,EACzE;AAED,MAAI,OAAO,WAAW;AACrB,WAAO,OAAO,UAAU,sBAAsB,OAAO,WAAW;AAAA,EAChE;AAED,MAAI,OAAO,SAAS;AACnB,WAAO,OAAO,UAAU,cAAc,OAAO,SAAS;AAAA,EACtD;AAED,MAAI,OAAO,kBAAkB;AAC5B,WAAO,OAAO,UAAU,wBAAwB,OAAO,kBAAkB;AAAA,EACzE;AACF;"}
|