@prismicio/client 7.21.0-alpha.2 → 7.21.0-canary.147e3f2
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/Client.cjs +926 -0
- package/dist/Client.cjs.map +1 -0
- package/dist/Client.d.cts +704 -0
- package/dist/Client.d.cts.map +1 -0
- package/dist/Client.d.ts +704 -0
- package/dist/Client.d.ts.map +1 -0
- package/dist/Client.js +926 -0
- package/dist/Client.js.map +1 -0
- package/dist/Migration.cjs +284 -0
- package/dist/Migration.cjs.map +1 -0
- package/dist/Migration.d.cts +216 -0
- package/dist/Migration.d.cts.map +1 -0
- package/dist/Migration.d.ts +216 -0
- package/dist/Migration.d.ts.map +1 -0
- package/dist/Migration.js +284 -0
- package/dist/Migration.js.map +1 -0
- package/dist/WriteClient.cjs +488 -0
- package/dist/WriteClient.cjs.map +1 -0
- package/dist/WriteClient.d.cts +262 -0
- package/dist/WriteClient.d.cts.map +1 -0
- package/dist/WriteClient.d.ts +262 -0
- package/dist/WriteClient.d.ts.map +1 -0
- package/dist/WriteClient.js +488 -0
- package/dist/WriteClient.js.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +14 -0
- package/dist/_virtual/rolldown_runtime.js +13 -0
- package/dist/buildQueryURL.cjs +96 -0
- package/dist/buildQueryURL.cjs.map +1 -0
- package/dist/buildQueryURL.d.cts +212 -0
- package/dist/buildQueryURL.d.cts.map +1 -0
- package/dist/buildQueryURL.d.ts +212 -0
- package/dist/buildQueryURL.d.ts.map +1 -0
- package/dist/buildQueryURL.js +96 -0
- package/dist/buildQueryURL.js.map +1 -0
- package/dist/cookie.cjs +19 -0
- package/dist/cookie.cjs.map +1 -0
- package/dist/cookie.d.cts +11 -0
- package/dist/cookie.d.cts.map +1 -0
- package/dist/cookie.d.ts +11 -0
- package/dist/cookie.d.ts.map +1 -0
- package/dist/cookie.js +13 -0
- package/dist/cookie.js.map +1 -0
- package/dist/createClient.cjs +33 -0
- package/dist/createClient.cjs.map +1 -0
- package/dist/createClient.d.cts +41 -0
- package/dist/createClient.d.cts.map +1 -0
- package/dist/createClient.d.ts +41 -0
- package/dist/createClient.d.ts.map +1 -0
- package/dist/createClient.js +33 -0
- package/dist/createClient.js.map +1 -0
- package/dist/createMigration.cjs +22 -0
- package/dist/createMigration.cjs.map +1 -0
- package/dist/createMigration.d.cts +30 -0
- package/dist/createMigration.d.cts.map +1 -0
- package/dist/createMigration.d.ts +30 -0
- package/dist/createMigration.d.ts.map +1 -0
- package/dist/createMigration.js +22 -0
- package/dist/createMigration.js.map +1 -0
- package/dist/createWriteClient.cjs +30 -0
- package/dist/createWriteClient.cjs.map +1 -0
- package/dist/createWriteClient.d.cts +38 -0
- package/dist/createWriteClient.d.cts.map +1 -0
- package/dist/createWriteClient.d.ts +38 -0
- package/dist/createWriteClient.d.ts.map +1 -0
- package/dist/createWriteClient.js +30 -0
- package/dist/createWriteClient.js.map +1 -0
- package/dist/errors.cjs +31 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +46 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.ts +46 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/filter.cjs +104 -0
- package/dist/filter.cjs.map +1 -0
- package/dist/filter.d.cts +213 -0
- package/dist/filter.d.cts.map +1 -0
- package/dist/filter.d.ts +213 -0
- package/dist/filter.d.ts.map +1 -0
- package/dist/filter.js +103 -0
- package/dist/filter.js.map +1 -0
- package/dist/getGraphQLEndpoint.cjs +21 -0
- package/dist/getGraphQLEndpoint.cjs.map +1 -0
- package/dist/getGraphQLEndpoint.d.cts +14 -0
- package/dist/getGraphQLEndpoint.d.cts.map +1 -0
- package/dist/getGraphQLEndpoint.d.ts +14 -0
- package/dist/getGraphQLEndpoint.d.ts.map +1 -0
- package/dist/getGraphQLEndpoint.js +21 -0
- package/dist/getGraphQLEndpoint.js.map +1 -0
- package/dist/getRepositoryEndpoint.cjs +30 -0
- package/dist/getRepositoryEndpoint.cjs.map +1 -0
- package/dist/getRepositoryEndpoint.d.cts +23 -0
- package/dist/getRepositoryEndpoint.d.cts.map +1 -0
- package/dist/getRepositoryEndpoint.d.ts +23 -0
- package/dist/getRepositoryEndpoint.d.ts.map +1 -0
- package/dist/getRepositoryEndpoint.js +30 -0
- package/dist/getRepositoryEndpoint.js.map +1 -0
- package/dist/getRepositoryName.cjs +25 -0
- package/dist/getRepositoryName.cjs.map +1 -0
- package/dist/getRepositoryName.d.cts +16 -0
- package/dist/getRepositoryName.d.cts.map +1 -0
- package/dist/getRepositoryName.d.ts +16 -0
- package/dist/getRepositoryName.d.ts.map +1 -0
- package/dist/getRepositoryName.js +25 -0
- package/dist/getRepositoryName.js.map +1 -0
- package/dist/getToolbarSrc.cjs +45 -0
- package/dist/getToolbarSrc.cjs.map +1 -0
- package/dist/getToolbarSrc.d.cts +38 -0
- package/dist/getToolbarSrc.d.cts.map +1 -0
- package/dist/getToolbarSrc.d.ts +38 -0
- package/dist/getToolbarSrc.d.ts.map +1 -0
- package/dist/getToolbarSrc.js +45 -0
- package/dist/getToolbarSrc.js.map +1 -0
- package/dist/helpers/asDate.cjs +39 -0
- package/dist/helpers/asDate.cjs.map +1 -0
- package/dist/helpers/asDate.d.cts +29 -0
- package/dist/helpers/asDate.d.cts.map +1 -0
- package/dist/helpers/asDate.d.ts +29 -0
- package/dist/helpers/asDate.d.ts.map +1 -0
- package/dist/helpers/asDate.js +38 -0
- package/dist/helpers/asDate.js.map +1 -0
- package/dist/helpers/asHTML.cjs +83 -0
- package/dist/helpers/asHTML.cjs.map +1 -0
- package/dist/helpers/asHTML.d.cts +147 -0
- package/dist/helpers/asHTML.d.cts.map +1 -0
- package/dist/helpers/asHTML.d.ts +147 -0
- package/dist/helpers/asHTML.d.ts.map +1 -0
- package/dist/helpers/asHTML.js +83 -0
- package/dist/helpers/asHTML.js.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.cjs.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.cts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts +59 -0
- package/dist/helpers/asImagePixelDensitySrcSet.d.ts.map +1 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js +60 -0
- package/dist/helpers/asImagePixelDensitySrcSet.js.map +1 -0
- package/dist/helpers/asImageSrc.cjs +33 -0
- package/dist/helpers/asImageSrc.cjs.map +1 -0
- package/dist/helpers/asImageSrc.d.cts +34 -0
- package/dist/helpers/asImageSrc.d.cts.map +1 -0
- package/dist/helpers/asImageSrc.d.ts +34 -0
- package/dist/helpers/asImageSrc.d.ts.map +1 -0
- package/dist/helpers/asImageSrc.js +33 -0
- package/dist/helpers/asImageSrc.js.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.cjs +79 -0
- package/dist/helpers/asImageWidthSrcSet.cjs.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.cts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts +67 -0
- package/dist/helpers/asImageWidthSrcSet.d.ts.map +1 -0
- package/dist/helpers/asImageWidthSrcSet.js +79 -0
- package/dist/helpers/asImageWidthSrcSet.js.map +1 -0
- package/dist/helpers/asLink.cjs +29 -0
- package/dist/helpers/asLink.cjs.map +1 -0
- package/dist/helpers/asLink.d.cts +83 -0
- package/dist/helpers/asLink.d.cts.map +1 -0
- package/dist/helpers/asLink.d.ts +83 -0
- package/dist/helpers/asLink.d.ts.map +1 -0
- package/dist/helpers/asLink.js +29 -0
- package/dist/helpers/asLink.js.map +1 -0
- package/dist/helpers/asLinkAttrs.cjs +47 -0
- package/dist/helpers/asLinkAttrs.cjs.map +1 -0
- package/dist/helpers/asLinkAttrs.d.cts +51 -0
- package/dist/helpers/asLinkAttrs.d.cts.map +1 -0
- package/dist/helpers/asLinkAttrs.d.ts +51 -0
- package/dist/helpers/asLinkAttrs.d.ts.map +1 -0
- package/dist/helpers/asLinkAttrs.js +47 -0
- package/dist/helpers/asLinkAttrs.js.map +1 -0
- package/dist/helpers/asText.cjs +16 -0
- package/dist/helpers/asText.cjs.map +1 -0
- package/dist/helpers/asText.d.cts +62 -0
- package/dist/helpers/asText.d.cts.map +1 -0
- package/dist/helpers/asText.d.ts +62 -0
- package/dist/helpers/asText.d.ts.map +1 -0
- package/dist/helpers/asText.js +16 -0
- package/dist/helpers/asText.js.map +1 -0
- package/dist/helpers/documentToLinkField.cjs +33 -0
- package/dist/helpers/documentToLinkField.cjs.map +1 -0
- package/dist/helpers/documentToLinkField.d.cts +21 -0
- package/dist/helpers/documentToLinkField.d.cts.map +1 -0
- package/dist/helpers/documentToLinkField.d.ts +21 -0
- package/dist/helpers/documentToLinkField.d.ts.map +1 -0
- package/dist/helpers/documentToLinkField.js +33 -0
- package/dist/helpers/documentToLinkField.js.map +1 -0
- package/dist/helpers/isFilled.cjs +250 -0
- package/dist/helpers/isFilled.cjs.map +1 -0
- package/dist/helpers/isFilled.d.cts +199 -0
- package/dist/helpers/isFilled.d.cts.map +1 -0
- package/dist/helpers/isFilled.d.ts +199 -0
- package/dist/helpers/isFilled.d.ts.map +1 -0
- package/dist/helpers/isFilled.js +243 -0
- package/dist/helpers/isFilled.js.map +1 -0
- package/dist/helpers/mapSliceZone.cjs +53 -0
- package/dist/helpers/mapSliceZone.cjs.map +1 -0
- package/dist/helpers/mapSliceZone.d.cts +139 -0
- package/dist/helpers/mapSliceZone.d.cts.map +1 -0
- package/dist/helpers/mapSliceZone.d.ts +139 -0
- package/dist/helpers/mapSliceZone.d.ts.map +1 -0
- package/dist/helpers/mapSliceZone.js +52 -0
- package/dist/helpers/mapSliceZone.js.map +1 -0
- package/dist/index.cjs +109 -3882
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +143 -4394
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +143 -4394
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +55 -0
- package/dist/index.js.map +1 -0
- package/dist/isRepositoryEndpoint.cjs +23 -0
- package/dist/isRepositoryEndpoint.cjs.map +1 -0
- package/dist/isRepositoryEndpoint.d.cts +14 -0
- package/dist/isRepositoryEndpoint.d.cts.map +1 -0
- package/dist/isRepositoryEndpoint.d.ts +14 -0
- package/dist/isRepositoryEndpoint.d.ts.map +1 -0
- package/dist/isRepositoryEndpoint.js +22 -0
- package/dist/isRepositoryEndpoint.js.map +1 -0
- package/dist/isRepositoryName.cjs +17 -0
- package/dist/isRepositoryName.cjs.map +1 -0
- package/dist/isRepositoryName.d.cts +13 -0
- package/dist/isRepositoryName.d.cts.map +1 -0
- package/dist/isRepositoryName.d.ts +13 -0
- package/dist/isRepositoryName.d.ts.map +1 -0
- package/dist/isRepositoryName.js +16 -0
- package/dist/isRepositoryName.js.map +1 -0
- package/dist/lib/devMsg.cjs +25 -0
- package/dist/lib/devMsg.cjs.map +1 -0
- package/dist/lib/devMsg.js +25 -0
- package/dist/lib/devMsg.js.map +1 -0
- package/dist/lib/escapeHTML.cjs +40 -0
- package/dist/lib/escapeHTML.cjs.map +1 -0
- package/dist/lib/escapeHTML.js +39 -0
- package/dist/lib/escapeHTML.js.map +1 -0
- package/dist/lib/getOptionalLinkProperties.cjs +22 -0
- package/dist/lib/getOptionalLinkProperties.cjs.map +1 -0
- package/dist/lib/getOptionalLinkProperties.js +21 -0
- package/dist/lib/getOptionalLinkProperties.js.map +1 -0
- package/dist/lib/getPreviewCookie.cjs +30 -0
- package/dist/lib/getPreviewCookie.cjs.map +1 -0
- package/dist/lib/getPreviewCookie.js +30 -0
- package/dist/lib/getPreviewCookie.js.map +1 -0
- package/dist/lib/isInternalURL.cjs +18 -0
- package/dist/lib/isInternalURL.cjs.map +1 -0
- package/dist/lib/isInternalURL.js +17 -0
- package/dist/lib/isInternalURL.js.map +1 -0
- package/dist/lib/isMigrationValue.cjs +77 -0
- package/dist/lib/isMigrationValue.cjs.map +1 -0
- package/dist/lib/isMigrationValue.js +74 -0
- package/dist/lib/isMigrationValue.js.map +1 -0
- package/dist/lib/isValue.cjs +110 -0
- package/dist/lib/isValue.cjs.map +1 -0
- package/dist/lib/isValue.js +106 -0
- package/dist/lib/isValue.js.map +1 -0
- package/dist/lib/pLimit.cjs +55 -0
- package/dist/lib/pLimit.cjs.map +1 -0
- package/dist/lib/pLimit.js +54 -0
- package/dist/lib/pLimit.js.map +1 -0
- package/dist/lib/request.cjs +60 -0
- package/dist/lib/request.cjs.map +1 -0
- package/dist/lib/request.d.cts +61 -0
- package/dist/lib/request.d.cts.map +1 -0
- package/dist/lib/request.d.ts +61 -0
- package/dist/lib/request.d.ts.map +1 -0
- package/dist/lib/request.js +60 -0
- package/dist/lib/request.js.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.cjs +156 -0
- package/dist/lib/resolveMigrationDocumentData.cjs.map +1 -0
- package/dist/lib/resolveMigrationDocumentData.js +155 -0
- package/dist/lib/resolveMigrationDocumentData.js.map +1 -0
- package/dist/lib/serializerHelpers.cjs +95 -0
- package/dist/lib/serializerHelpers.cjs.map +1 -0
- package/dist/lib/serializerHelpers.js +90 -0
- package/dist/lib/serializerHelpers.js.map +1 -0
- package/dist/lib/throttledWarn.cjs +27 -0
- package/dist/lib/throttledWarn.cjs.map +1 -0
- package/dist/lib/throttledWarn.js +26 -0
- package/dist/lib/throttledWarn.js.map +1 -0
- package/dist/lib/validateAssetMetadata.cjs +48 -0
- package/dist/lib/validateAssetMetadata.cjs.map +1 -0
- package/dist/lib/validateAssetMetadata.js +48 -0
- package/dist/lib/validateAssetMetadata.js.map +1 -0
- package/dist/package.cjs +19 -0
- package/dist/package.cjs.map +1 -0
- package/dist/package.js +7 -0
- package/dist/package.js.map +1 -0
- package/dist/richtext/asText.cjs +21 -0
- package/dist/richtext/asText.cjs.map +1 -0
- package/dist/richtext/asText.d.cts +18 -0
- package/dist/richtext/asText.d.cts.map +1 -0
- package/dist/richtext/asText.d.ts +18 -0
- package/dist/richtext/asText.d.ts.map +1 -0
- package/dist/richtext/asText.js +20 -0
- package/dist/richtext/asText.js.map +1 -0
- package/dist/richtext/asTree.cjs +122 -0
- package/dist/richtext/asTree.cjs.map +1 -0
- package/dist/richtext/asTree.d.cts +20 -0
- package/dist/richtext/asTree.d.cts.map +1 -0
- package/dist/richtext/asTree.d.ts +20 -0
- package/dist/richtext/asTree.d.ts.map +1 -0
- package/dist/richtext/asTree.js +122 -0
- package/dist/richtext/asTree.js.map +1 -0
- package/dist/richtext/composeSerializers.cjs +31 -0
- package/dist/richtext/composeSerializers.cjs.map +1 -0
- package/dist/richtext/composeSerializers.d.cts +22 -0
- package/dist/richtext/composeSerializers.d.cts.map +1 -0
- package/dist/richtext/composeSerializers.d.ts +22 -0
- package/dist/richtext/composeSerializers.d.ts.map +1 -0
- package/dist/richtext/composeSerializers.js +30 -0
- package/dist/richtext/composeSerializers.js.map +1 -0
- package/dist/richtext/serialize.cjs +35 -0
- package/dist/richtext/serialize.cjs.map +1 -0
- package/dist/richtext/serialize.d.cts +25 -0
- package/dist/richtext/serialize.d.cts.map +1 -0
- package/dist/richtext/serialize.d.ts +25 -0
- package/dist/richtext/serialize.d.ts.map +1 -0
- package/dist/richtext/serialize.js +35 -0
- package/dist/richtext/serialize.js.map +1 -0
- package/dist/richtext/types.cjs +13 -0
- package/dist/richtext/types.cjs.map +1 -0
- package/dist/richtext/types.d.cts +71 -0
- package/dist/richtext/types.d.cts.map +1 -0
- package/dist/richtext/types.d.ts +71 -0
- package/dist/richtext/types.d.ts.map +1 -0
- package/dist/richtext/types.js +13 -0
- package/dist/richtext/types.js.map +1 -0
- package/dist/richtext/wrapMapSerializer.cjs +32 -0
- package/dist/richtext/wrapMapSerializer.cjs.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.cts +21 -0
- package/dist/richtext/wrapMapSerializer.d.cts.map +1 -0
- package/dist/richtext/wrapMapSerializer.d.ts +21 -0
- package/dist/richtext/wrapMapSerializer.d.ts.map +1 -0
- package/dist/richtext/wrapMapSerializer.js +32 -0
- package/dist/richtext/wrapMapSerializer.js.map +1 -0
- package/dist/richtext.cjs +13 -0
- package/dist/richtext.d.cts +8 -0
- package/dist/richtext.d.ts +8 -0
- package/dist/richtext.js +8 -0
- package/dist/types/api/asset/asset.d.cts +97 -0
- package/dist/types/api/asset/asset.d.cts.map +1 -0
- package/dist/types/api/asset/asset.d.ts +97 -0
- package/dist/types/api/asset/asset.d.ts.map +1 -0
- package/dist/types/api/asset/tag.d.cts +35 -0
- package/dist/types/api/asset/tag.d.cts.map +1 -0
- package/dist/types/api/asset/tag.d.ts +35 -0
- package/dist/types/api/asset/tag.d.ts.map +1 -0
- package/dist/types/api/integration.d.cts +34 -0
- package/dist/types/api/integration.d.cts.map +1 -0
- package/dist/types/api/integration.d.ts +34 -0
- package/dist/types/api/integration.d.ts.map +1 -0
- package/dist/types/api/query.d.cts +49 -0
- package/dist/types/api/query.d.cts.map +1 -0
- package/dist/types/api/query.d.ts +49 -0
- package/dist/types/api/query.d.ts.map +1 -0
- package/dist/types/api/ref.d.cts +36 -0
- package/dist/types/api/ref.d.cts.map +1 -0
- package/dist/types/api/ref.d.ts +36 -0
- package/dist/types/api/ref.d.ts.map +1 -0
- package/dist/types/api/release.d.cts +17 -0
- package/dist/types/api/release.d.cts.map +1 -0
- package/dist/types/api/release.d.ts +17 -0
- package/dist/types/api/release.d.ts.map +1 -0
- package/dist/types/api/repository.d.cts +115 -0
- package/dist/types/api/repository.d.cts.map +1 -0
- package/dist/types/api/repository.d.ts +115 -0
- package/dist/types/api/repository.d.ts.map +1 -0
- package/dist/types/api/tags.d.cts +13 -0
- package/dist/types/api/tags.d.cts.map +1 -0
- package/dist/types/api/tags.d.ts +13 -0
- package/dist/types/api/tags.d.ts.map +1 -0
- package/dist/types/migration/Asset.cjs +35 -0
- package/dist/types/migration/Asset.cjs.map +1 -0
- package/dist/types/migration/Asset.d.cts +109 -0
- package/dist/types/migration/Asset.d.cts.map +1 -0
- package/dist/types/migration/Asset.d.ts +109 -0
- package/dist/types/migration/Asset.d.ts.map +1 -0
- package/dist/types/migration/Asset.js +34 -0
- package/dist/types/migration/Asset.js.map +1 -0
- package/dist/types/migration/ContentRelationship.d.cts +15 -0
- package/dist/types/migration/ContentRelationship.d.cts.map +1 -0
- package/dist/types/migration/ContentRelationship.d.ts +15 -0
- package/dist/types/migration/ContentRelationship.d.ts.map +1 -0
- package/dist/types/migration/Document.cjs +51 -0
- package/dist/types/migration/Document.cjs.map +1 -0
- package/dist/types/migration/Document.d.cts +97 -0
- package/dist/types/migration/Document.d.cts.map +1 -0
- package/dist/types/migration/Document.d.ts +97 -0
- package/dist/types/migration/Document.d.ts.map +1 -0
- package/dist/types/migration/Document.js +50 -0
- package/dist/types/migration/Document.js.map +1 -0
- package/dist/types/model/boolean.d.cts +21 -0
- package/dist/types/model/boolean.d.cts.map +1 -0
- package/dist/types/model/boolean.d.ts +21 -0
- package/dist/types/model/boolean.d.ts.map +1 -0
- package/dist/types/model/color.d.cts +19 -0
- package/dist/types/model/color.d.cts.map +1 -0
- package/dist/types/model/color.d.ts +19 -0
- package/dist/types/model/color.d.ts.map +1 -0
- package/dist/types/model/contentRelationship.d.cts +59 -0
- package/dist/types/model/contentRelationship.d.cts.map +1 -0
- package/dist/types/model/contentRelationship.d.ts +59 -0
- package/dist/types/model/contentRelationship.d.ts.map +1 -0
- package/dist/types/model/customType.d.cts +54 -0
- package/dist/types/model/customType.d.cts.map +1 -0
- package/dist/types/model/customType.d.ts +54 -0
- package/dist/types/model/customType.d.ts.map +1 -0
- package/dist/types/model/date.d.cts +20 -0
- package/dist/types/model/date.d.cts.map +1 -0
- package/dist/types/model/date.d.ts +20 -0
- package/dist/types/model/date.d.ts.map +1 -0
- package/dist/types/model/embed.d.cts +19 -0
- package/dist/types/model/embed.d.cts.map +1 -0
- package/dist/types/model/embed.d.ts +19 -0
- package/dist/types/model/embed.d.ts.map +1 -0
- package/dist/types/model/geoPoint.d.cts +18 -0
- package/dist/types/model/geoPoint.d.cts.map +1 -0
- package/dist/types/model/geoPoint.d.ts +18 -0
- package/dist/types/model/geoPoint.d.ts.map +1 -0
- package/dist/types/model/group.d.cts +29 -0
- package/dist/types/model/group.d.cts.map +1 -0
- package/dist/types/model/group.d.ts +29 -0
- package/dist/types/model/group.d.ts.map +1 -0
- package/dist/types/model/image.d.cts +37 -0
- package/dist/types/model/image.d.cts.map +1 -0
- package/dist/types/model/image.d.ts +37 -0
- package/dist/types/model/image.d.ts.map +1 -0
- package/dist/types/model/integration.d.cts +20 -0
- package/dist/types/model/integration.d.cts.map +1 -0
- package/dist/types/model/integration.d.ts +20 -0
- package/dist/types/model/integration.d.ts.map +1 -0
- package/dist/types/model/keyText.d.cts +19 -0
- package/dist/types/model/keyText.d.cts.map +1 -0
- package/dist/types/model/keyText.d.ts +19 -0
- package/dist/types/model/keyText.d.ts.map +1 -0
- package/dist/types/model/link.cjs +16 -0
- package/dist/types/model/link.cjs.map +1 -0
- package/dist/types/model/link.d.cts +34 -0
- package/dist/types/model/link.d.cts.map +1 -0
- package/dist/types/model/link.d.ts +34 -0
- package/dist/types/model/link.d.ts.map +1 -0
- package/dist/types/model/link.js +15 -0
- package/dist/types/model/link.js.map +1 -0
- package/dist/types/model/linkToMedia.d.cts +23 -0
- package/dist/types/model/linkToMedia.d.cts.map +1 -0
- package/dist/types/model/linkToMedia.d.ts +23 -0
- package/dist/types/model/linkToMedia.d.ts.map +1 -0
- package/dist/types/model/number.d.cts +21 -0
- package/dist/types/model/number.d.cts.map +1 -0
- package/dist/types/model/number.d.ts +21 -0
- package/dist/types/model/number.d.ts.map +1 -0
- package/dist/types/model/range.d.cts +20 -0
- package/dist/types/model/range.d.cts.map +1 -0
- package/dist/types/model/range.d.ts +20 -0
- package/dist/types/model/range.d.ts.map +1 -0
- package/dist/types/model/richText.d.cts +43 -0
- package/dist/types/model/richText.d.cts.map +1 -0
- package/dist/types/model/richText.d.ts +43 -0
- package/dist/types/model/richText.d.ts.map +1 -0
- package/dist/types/model/select.d.cts +24 -0
- package/dist/types/model/select.d.cts.map +1 -0
- package/dist/types/model/select.d.ts +24 -0
- package/dist/types/model/select.d.ts.map +1 -0
- package/dist/types/model/separator.d.cts +16 -0
- package/dist/types/model/separator.d.cts.map +1 -0
- package/dist/types/model/separator.d.ts +16 -0
- package/dist/types/model/separator.d.ts.map +1 -0
- package/dist/types/model/sharedSlice.d.cts +22 -0
- package/dist/types/model/sharedSlice.d.cts.map +1 -0
- package/dist/types/model/sharedSlice.d.ts +22 -0
- package/dist/types/model/sharedSlice.d.ts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.cts +25 -0
- package/dist/types/model/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/model/sharedSliceVariation.d.ts +25 -0
- package/dist/types/model/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/model/slice.cjs +15 -0
- package/dist/types/model/slice.cjs.map +1 -0
- package/dist/types/model/slice.d.cts +39 -0
- package/dist/types/model/slice.d.cts.map +1 -0
- package/dist/types/model/slice.d.ts +39 -0
- package/dist/types/model/slice.d.ts.map +1 -0
- package/dist/types/model/slice.js +14 -0
- package/dist/types/model/slice.js.map +1 -0
- package/dist/types/model/sliceZone.cjs +15 -0
- package/dist/types/model/sliceZone.cjs.map +1 -0
- package/dist/types/model/sliceZone.d.cts +47 -0
- package/dist/types/model/sliceZone.d.cts.map +1 -0
- package/dist/types/model/sliceZone.d.ts +47 -0
- package/dist/types/model/sliceZone.d.ts.map +1 -0
- package/dist/types/model/sliceZone.js +14 -0
- package/dist/types/model/sliceZone.js.map +1 -0
- package/dist/types/model/table.d.cts +18 -0
- package/dist/types/model/table.d.cts.map +1 -0
- package/dist/types/model/table.d.ts +18 -0
- package/dist/types/model/table.d.ts.map +1 -0
- package/dist/types/model/timestamp.d.cts +20 -0
- package/dist/types/model/timestamp.d.cts.map +1 -0
- package/dist/types/model/timestamp.d.ts +20 -0
- package/dist/types/model/timestamp.d.ts.map +1 -0
- package/dist/types/model/title.d.cts +13 -0
- package/dist/types/model/title.d.cts.map +1 -0
- package/dist/types/model/title.d.ts +13 -0
- package/dist/types/model/title.d.ts.map +1 -0
- package/dist/types/model/types.cjs +32 -0
- package/dist/types/model/types.cjs.map +1 -0
- package/dist/types/model/types.d.cts +82 -0
- package/dist/types/model/types.d.cts.map +1 -0
- package/dist/types/model/types.d.ts +82 -0
- package/dist/types/model/types.d.ts.map +1 -0
- package/dist/types/model/types.js +31 -0
- package/dist/types/model/types.js.map +1 -0
- package/dist/types/model/uid.d.cts +19 -0
- package/dist/types/model/uid.d.cts.map +1 -0
- package/dist/types/model/uid.d.ts +19 -0
- package/dist/types/model/uid.d.ts.map +1 -0
- package/dist/types/value/boolean.d.cts +10 -0
- package/dist/types/value/boolean.d.cts.map +1 -0
- package/dist/types/value/boolean.d.ts +10 -0
- package/dist/types/value/boolean.d.ts.map +1 -0
- package/dist/types/value/color.d.cts +15 -0
- package/dist/types/value/color.d.cts.map +1 -0
- package/dist/types/value/color.d.ts +15 -0
- package/dist/types/value/color.d.ts.map +1 -0
- package/dist/types/value/contentRelationship.d.cts +37 -0
- package/dist/types/value/contentRelationship.d.cts.map +1 -0
- package/dist/types/value/contentRelationship.d.ts +37 -0
- package/dist/types/value/contentRelationship.d.ts.map +1 -0
- package/dist/types/value/date.d.cts +15 -0
- package/dist/types/value/date.d.cts.map +1 -0
- package/dist/types/value/date.d.ts +15 -0
- package/dist/types/value/date.d.ts.map +1 -0
- package/dist/types/value/document.d.cts +120 -0
- package/dist/types/value/document.d.cts.map +1 -0
- package/dist/types/value/document.d.ts +120 -0
- package/dist/types/value/document.d.ts.map +1 -0
- package/dist/types/value/embed.cjs +17 -0
- package/dist/types/value/embed.cjs.map +1 -0
- package/dist/types/value/embed.d.cts +173 -0
- package/dist/types/value/embed.d.cts.map +1 -0
- package/dist/types/value/embed.d.ts +173 -0
- package/dist/types/value/embed.d.ts.map +1 -0
- package/dist/types/value/embed.js +16 -0
- package/dist/types/value/embed.js.map +1 -0
- package/dist/types/value/geoPoint.d.cts +18 -0
- package/dist/types/value/geoPoint.d.cts.map +1 -0
- package/dist/types/value/geoPoint.d.ts +18 -0
- package/dist/types/value/geoPoint.d.ts.map +1 -0
- package/dist/types/value/group.d.cts +19 -0
- package/dist/types/value/group.d.cts.map +1 -0
- package/dist/types/value/group.d.ts +19 -0
- package/dist/types/value/group.d.ts.map +1 -0
- package/dist/types/value/image.d.cts +53 -0
- package/dist/types/value/image.d.cts.map +1 -0
- package/dist/types/value/image.d.ts +53 -0
- package/dist/types/value/image.d.ts.map +1 -0
- package/dist/types/value/integration.d.cts +22 -0
- package/dist/types/value/integration.d.cts.map +1 -0
- package/dist/types/value/integration.d.ts +22 -0
- package/dist/types/value/integration.d.ts.map +1 -0
- package/dist/types/value/keyText.d.cts +15 -0
- package/dist/types/value/keyText.d.cts.map +1 -0
- package/dist/types/value/keyText.d.ts +15 -0
- package/dist/types/value/keyText.d.ts.map +1 -0
- package/dist/types/value/link.cjs +15 -0
- package/dist/types/value/link.cjs.map +1 -0
- package/dist/types/value/link.d.cts +74 -0
- package/dist/types/value/link.d.cts.map +1 -0
- package/dist/types/value/link.d.ts +74 -0
- package/dist/types/value/link.d.ts.map +1 -0
- package/dist/types/value/link.js +14 -0
- package/dist/types/value/link.js.map +1 -0
- package/dist/types/value/linkToMedia.d.cts +33 -0
- package/dist/types/value/linkToMedia.d.cts.map +1 -0
- package/dist/types/value/linkToMedia.d.ts +33 -0
- package/dist/types/value/linkToMedia.d.ts.map +1 -0
- package/dist/types/value/number.d.cts +15 -0
- package/dist/types/value/number.d.cts.map +1 -0
- package/dist/types/value/number.d.ts +15 -0
- package/dist/types/value/number.d.ts.map +1 -0
- package/dist/types/value/richText.cjs +32 -0
- package/dist/types/value/richText.cjs.map +1 -0
- package/dist/types/value/richText.d.cts +221 -0
- package/dist/types/value/richText.d.cts.map +1 -0
- package/dist/types/value/richText.d.ts +221 -0
- package/dist/types/value/richText.d.ts.map +1 -0
- package/dist/types/value/richText.js +31 -0
- package/dist/types/value/richText.js.map +1 -0
- package/dist/types/value/select.d.cts +16 -0
- package/dist/types/value/select.d.cts.map +1 -0
- package/dist/types/value/select.d.ts +16 -0
- package/dist/types/value/select.d.ts.map +1 -0
- package/dist/types/value/sharedSlice.d.cts +17 -0
- package/dist/types/value/sharedSlice.d.cts.map +1 -0
- package/dist/types/value/sharedSlice.d.ts +17 -0
- package/dist/types/value/sharedSlice.d.ts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.cts +16 -0
- package/dist/types/value/sharedSliceVariation.d.cts.map +1 -0
- package/dist/types/value/sharedSliceVariation.d.ts +16 -0
- package/dist/types/value/sharedSliceVariation.d.ts.map +1 -0
- package/dist/types/value/slice.d.cts +19 -0
- package/dist/types/value/slice.d.cts.map +1 -0
- package/dist/types/value/slice.d.ts +19 -0
- package/dist/types/value/slice.d.ts.map +1 -0
- package/dist/types/value/sliceZone.d.cts +18 -0
- package/dist/types/value/sliceZone.d.cts.map +1 -0
- package/dist/types/value/sliceZone.d.ts +18 -0
- package/dist/types/value/sliceZone.d.ts.map +1 -0
- package/dist/types/value/table.d.cts +97 -0
- package/dist/types/value/table.d.cts.map +1 -0
- package/dist/types/value/table.d.ts +97 -0
- package/dist/types/value/table.d.ts.map +1 -0
- package/dist/types/value/timestamp.d.cts +13 -0
- package/dist/types/value/timestamp.d.cts.map +1 -0
- package/dist/types/value/timestamp.d.ts +13 -0
- package/dist/types/value/timestamp.d.ts.map +1 -0
- package/dist/types/value/title.d.cts +16 -0
- package/dist/types/value/title.d.cts.map +1 -0
- package/dist/types/value/title.d.ts +16 -0
- package/dist/types/value/title.d.ts.map +1 -0
- package/dist/types/value/types.d.cts +61 -0
- package/dist/types/value/types.d.cts.map +1 -0
- package/dist/types/value/types.d.ts +61 -0
- package/dist/types/value/types.d.ts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.cts +57 -0
- package/dist/types/webhook/apiUpdate.d.cts.map +1 -0
- package/dist/types/webhook/apiUpdate.d.ts +57 -0
- package/dist/types/webhook/apiUpdate.d.ts.map +1 -0
- package/dist/types/webhook/testTrigger.d.cts +15 -0
- package/dist/types/webhook/testTrigger.d.cts.map +1 -0
- package/dist/types/webhook/testTrigger.d.ts +15 -0
- package/dist/types/webhook/testTrigger.d.ts.map +1 -0
- package/dist/types/webhook/types.cjs +15 -0
- package/dist/types/webhook/types.cjs.map +1 -0
- package/dist/types/webhook/types.d.cts +23 -0
- package/dist/types/webhook/types.d.cts.map +1 -0
- package/dist/types/webhook/types.d.ts +23 -0
- package/dist/types/webhook/types.d.ts.map +1 -0
- package/dist/types/webhook/types.js +14 -0
- package/dist/types/webhook/types.js.map +1 -0
- package/package.json +29 -35
- package/src/Client.ts +682 -1028
- package/src/WriteClient.ts +44 -46
- package/src/buildQueryURL.ts +14 -20
- package/src/createClient.ts +1 -1
- package/src/errors.ts +94 -0
- package/src/getGraphQLEndpoint.ts +1 -1
- package/src/getRepositoryEndpoint.ts +1 -1
- package/src/getRepositoryName.ts +1 -1
- package/src/getToolbarSrc.ts +1 -1
- package/src/helpers/asHTML.ts +4 -4
- package/src/helpers/asImageWidthSrcSet.ts +1 -5
- package/src/helpers/asLink.ts +0 -3
- package/src/helpers/asLinkAttrs.ts +0 -4
- package/src/helpers/mapSliceZone.ts +5 -5
- package/src/index.ts +11 -8
- package/src/lib/isValue.ts +0 -6
- package/src/lib/pLimit.ts +1 -1
- package/src/lib/request.ts +3 -3
- package/src/lib/{throttledLog.ts → throttledWarn.ts} +3 -14
- package/src/lib/validateAssetMetadata.ts +1 -1
- package/src/types/migration/Document.ts +1 -1
- package/src/types/model/contentRelationship.ts +1 -0
- package/src/types/value/date.ts +1 -1
- package/src/types/value/document.ts +3 -3
- package/src/types/value/timestamp.ts +1 -5
- package/dist/index.d.mts +0 -4424
- package/dist/index.mjs +0 -3837
- package/dist/index.mjs.map +0 -1
- package/dist/richtext/index.cjs +0 -244
- package/dist/richtext/index.cjs.map +0 -1
- package/dist/richtext/index.d.cts +0 -78
- package/dist/richtext/index.d.mts +0 -78
- package/dist/richtext/index.d.ts +0 -78
- package/dist/richtext/index.mjs +0 -237
- package/dist/richtext/index.mjs.map +0 -1
- package/dist/shared/client.TSGr56lO.d.cts +0 -899
- package/dist/shared/client.TSGr56lO.d.mts +0 -899
- package/dist/shared/client.TSGr56lO.d.ts +0 -899
- package/src/errors/ForbiddenError.ts +0 -16
- package/src/errors/InvalidDataError.ts +0 -5
- package/src/errors/NotFoundError.ts +0 -5
- package/src/errors/ParsingError.ts +0 -16
- package/src/errors/PreviewTokenExpired.ts +0 -12
- package/src/errors/PrismicError.ts +0 -15
- package/src/errors/RefExpiredError.ts +0 -14
- package/src/errors/RefNotFoundError.ts +0 -14
- package/src/errors/RepositoryNotFoundError.ts +0 -5
- package/src/lib/appendFilters.ts +0 -26
- package/src/lib/castArray.ts +0 -14
- package/src/lib/castThunk.ts +0 -13
- package/src/lib/everyTagFilter.ts +0 -15
- package/src/lib/findMasterRef.ts +0 -16
- package/src/lib/findRef.ts +0 -25
- package/src/lib/findRefByID.ts +0 -17
- package/src/lib/findRefByLabel.ts +0 -17
- package/src/lib/minifyGraphQLQuery.ts +0 -13
- package/src/lib/someTagsFilter.ts +0 -15
- package/src/lib/typeFilter.ts +0 -12
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { asText } from "../richtext/asText.js";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/asText.ts
|
|
4
|
+
const asText$1 = (richTextField, ...configObjectOrTuple) => {
|
|
5
|
+
if (richTextField) {
|
|
6
|
+
const [configObjectOrSeparator] = configObjectOrTuple;
|
|
7
|
+
let config;
|
|
8
|
+
if (typeof configObjectOrSeparator === "string") config = { separator: configObjectOrSeparator };
|
|
9
|
+
else config = { ...configObjectOrSeparator };
|
|
10
|
+
return asText(richTextField, config.separator);
|
|
11
|
+
} else return null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { asText$1 as asText };
|
|
16
|
+
//# sourceMappingURL=asText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asText.js","names":["asText: {\n\t/**\n\t * Converts a rich text field to a plain text string.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const text = asText(document.data.content)\n\t * // => \"Hello world\"\n\t * ```\n\t *\n\t * @param richTextField - A rich text field from Prismic.\n\t * @param config - Configuration that determines the output of `asText()`.\n\t *\n\t * @returns Plain text equivalent of the rich text field, or `null` if the\n\t * field is empty.\n\t *\n\t * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\tconfig?: AsTextConfig,\n\t): AsTextReturnType<Field>\n\n\t/**\n\t * Converts a rich text field to a plain text string.\n\t *\n\t * @deprecated Use object-style configuration instead.\n\t *\n\t * @param richTextField - A rich text field from Prismic.\n\t * @param separator - Separator used to join each element. Defaults to a\n\t * space.\n\t *\n\t * @returns Plain text equivalent of the rich text field, or `null` if the\n\t * field is empty.\n\t *\n\t * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\t...config: AsTextDeprecatedTupleConfig\n\t): AsTextReturnType<Field>\n}","config: AsTextConfig","baseAsText"],"sources":["../../src/helpers/asText.ts"],"sourcesContent":["import type { RichTextField } from \"../types/value/richText\"\n\nimport { asText as baseAsText } from \"../richtext/asText\"\n\n/**\n * Configuration that determines the output of `asText()`.\n */\ntype AsTextConfig = {\n\t/**\n\t * Separator used to join each element.\n\t *\n\t * @defaultValue ` ` (a space)\n\t */\n\tseparator?: string\n}\n\n// TODO: Remove when we remove support for deprecated tuple-style configuration.\n/**\n * @deprecated Use object-style configuration instead.\n */\ntype AsTextDeprecatedTupleConfig = [separator?: string]\n\n/**\n * The return type of `asText()`.\n */\ntype AsTextReturnType<Field extends RichTextField | null | undefined> =\n\tField extends RichTextField ? string : null\n\nexport const asText: {\n\t/**\n\t * Converts a rich text field to a plain text string.\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * const text = asText(document.data.content)\n\t * // => \"Hello world\"\n\t * ```\n\t *\n\t * @param richTextField - A rich text field from Prismic.\n\t * @param config - Configuration that determines the output of `asText()`.\n\t *\n\t * @returns Plain text equivalent of the rich text field, or `null` if the\n\t * field is empty.\n\t *\n\t * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\tconfig?: AsTextConfig,\n\t): AsTextReturnType<Field>\n\n\t/**\n\t * Converts a rich text field to a plain text string.\n\t *\n\t * @deprecated Use object-style configuration instead.\n\t *\n\t * @param richTextField - A rich text field from Prismic.\n\t * @param separator - Separator used to join each element. Defaults to a\n\t * space.\n\t *\n\t * @returns Plain text equivalent of the rich text field, or `null` if the\n\t * field is empty.\n\t *\n\t * @see Learn how to work with rich text fields: {@link https://prismic.io/docs/fields/rich-text}\n\t */\n\t<Field extends RichTextField | null | undefined>(\n\t\trichTextField: Field,\n\t\t...config: AsTextDeprecatedTupleConfig\n\t): AsTextReturnType<Field>\n} = <Field extends RichTextField | null | undefined>(\n\trichTextField: Field,\n\t// TODO: Rename to `config` when we remove support for deprecated tuple-style configuration.\n\t...configObjectOrTuple: [config?: AsTextConfig] | AsTextDeprecatedTupleConfig\n): AsTextReturnType<Field> => {\n\tif (richTextField) {\n\t\t// TODO: Remove when we remove support for deprecated tuple-style configuration.\n\t\tconst [configObjectOrSeparator] = configObjectOrTuple\n\t\tlet config: AsTextConfig\n\t\tif (typeof configObjectOrSeparator === \"string\") {\n\t\t\tconfig = {\n\t\t\t\tseparator: configObjectOrSeparator,\n\t\t\t}\n\t\t} else {\n\t\t\tconfig = { ...configObjectOrSeparator }\n\t\t}\n\n\t\treturn baseAsText(\n\t\t\trichTextField,\n\t\t\tconfig.separator,\n\t\t) as AsTextReturnType<Field>\n\t} else {\n\t\treturn null as AsTextReturnType<Field>\n\t}\n}\n"],"mappings":";;;AA4BA,MAAaA,YA2CZ,eAEA,GAAG,wBAC0B;AAC7B,KAAI,eAAe;EAElB,MAAM,CAAC,2BAA2B;EAClC,IAAIC;AACJ,MAAI,OAAO,4BAA4B,SACtC,UAAS,EACR,WAAW,yBACX;MAED,UAAS,EAAE,GAAG,yBAAyB;AAGxC,SAAOC,OACN,eACA,OAAO,UACP;OAED,QAAO"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_link = require('../types/value/link.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/documentToLinkField.ts
|
|
4
|
+
/**
|
|
5
|
+
* Converts a document into a link field, this is useful when crawling the API
|
|
6
|
+
* for document links
|
|
7
|
+
*
|
|
8
|
+
* @typeParam TDocument - Specific interface of the provided document
|
|
9
|
+
*
|
|
10
|
+
* @param prismicDocument - A document coming from Prismic
|
|
11
|
+
*
|
|
12
|
+
* @returns The equivalent link field to use with `asLink()`
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
const documentToLinkField = (prismicDocument) => {
|
|
17
|
+
var _prismicDocument$slug;
|
|
18
|
+
return {
|
|
19
|
+
link_type: require_link.LinkType.Document,
|
|
20
|
+
id: prismicDocument.id,
|
|
21
|
+
uid: prismicDocument.uid || void 0,
|
|
22
|
+
type: prismicDocument.type,
|
|
23
|
+
tags: prismicDocument.tags,
|
|
24
|
+
lang: prismicDocument.lang,
|
|
25
|
+
url: prismicDocument.url == null ? void 0 : prismicDocument.url,
|
|
26
|
+
slug: (_prismicDocument$slug = prismicDocument.slugs) === null || _prismicDocument$slug === void 0 ? void 0 : _prismicDocument$slug[0],
|
|
27
|
+
...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.documentToLinkField = documentToLinkField;
|
|
33
|
+
//# sourceMappingURL=documentToLinkField.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentToLinkField.cjs","names":["LinkType"],"sources":["../../src/helpers/documentToLinkField.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../types/value/contentRelationship\"\nimport type { PrismicDocument } from \"../types/value/document\"\nimport { LinkType } from \"../types/value/link\"\n\ntype SetOptional<T, Keys extends keyof T> = Omit<T, Keys> &\n\tPartial<Pick<T, Keys>>\n\n/**\n * Converts a document into a link field, this is useful when crawling the API\n * for document links\n *\n * @typeParam TDocument - Specific interface of the provided document\n *\n * @param prismicDocument - A document coming from Prismic\n *\n * @returns The equivalent link field to use with `asLink()`\n *\n * @internal\n */\nexport const documentToLinkField = <\n\tTDocument extends SetOptional<PrismicDocument, \"slugs\">,\n>(\n\tprismicDocument: TDocument,\n): FilledContentRelationshipField<\n\tTDocument[\"type\"],\n\tTDocument[\"lang\"],\n\tTDocument[\"data\"]\n> => {\n\treturn {\n\t\tlink_type: LinkType.Document,\n\t\tid: prismicDocument.id,\n\t\tuid: prismicDocument.uid || undefined,\n\t\ttype: prismicDocument.type,\n\t\ttags: prismicDocument.tags,\n\t\tlang: prismicDocument.lang,\n\t\turl: prismicDocument.url == null ? undefined : prismicDocument.url,\n\t\tslug: prismicDocument.slugs?.[0], // Slug field is not available with GraphQL\n\t\t// The REST API does not include a `data` property if the data\n\t\t// object is empty.\n\t\t//\n\t\t// A presence check for `prismicDocument.data` is done to\n\t\t// support partial documents. While `documentToLinkField` is\n\t\t// not typed to accept partial documents, passing a partial\n\t\t// document can happen in untyped projects.\n\t\t...(prismicDocument.data && Object.keys(prismicDocument.data).length > 0\n\t\t\t? { data: prismicDocument.data }\n\t\t\t: {}),\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAa,uBAGZ,oBAKI;;AACJ,QAAO;EACN,WAAWA,sBAAS;EACpB,IAAI,gBAAgB;EACpB,KAAK,gBAAgB,OAAO;EAC5B,MAAM,gBAAgB;EACtB,MAAM,gBAAgB;EACtB,MAAM,gBAAgB;EACtB,KAAK,gBAAgB,OAAO,OAAO,SAAY,gBAAgB;EAC/D,+BAAM,gBAAgB,qFAAQ;EAQ9B,GAAI,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,KAAK,CAAC,SAAS,IACpE,EAAE,MAAM,gBAAgB,MAAM,GAC9B,EAAE;EACL"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilledContentRelationshipField } from "../types/value/contentRelationship.cjs";
|
|
2
|
+
import { PrismicDocument } from "../types/value/document.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/documentToLinkField.d.ts
|
|
5
|
+
type SetOptional<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
6
|
+
/**
|
|
7
|
+
* Converts a document into a link field, this is useful when crawling the API
|
|
8
|
+
* for document links
|
|
9
|
+
*
|
|
10
|
+
* @typeParam TDocument - Specific interface of the provided document
|
|
11
|
+
*
|
|
12
|
+
* @param prismicDocument - A document coming from Prismic
|
|
13
|
+
*
|
|
14
|
+
* @returns The equivalent link field to use with `asLink()`
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
declare const documentToLinkField: <TDocument extends SetOptional<PrismicDocument, "slugs">>(prismicDocument: TDocument) => FilledContentRelationshipField<TDocument["type"], TDocument["lang"], TDocument["data"]>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { documentToLinkField };
|
|
21
|
+
//# sourceMappingURL=documentToLinkField.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentToLinkField.d.cts","names":[],"sources":["../../src/helpers/documentToLinkField.ts"],"sourcesContent":[],"mappings":";;;;KAIK,kCAAkC,KAAK,KAAK,GAAG,QACnD,QAAQ,KAAK,GAAG;;AAJ6C;;;;;;;;;;AAkB9D;AAC+B,cADlB,mBACkB,EAAA,CAAA,kBAAZ,WAAY,CAAA,eAAA,EAAA,OAAA,CAAA,CAAA,CAAA,eAAA,EAEb,SAFa,EAAA,GAG5B,8BAH4B,CAI9B,SAJ8B,CAAA,MAAA,CAAA,EAK9B,SAL8B,CAAA,MAAA,CAAA,EAM9B,SAN8B,CAAA,MAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { FilledContentRelationshipField } from "../types/value/contentRelationship.js";
|
|
2
|
+
import { PrismicDocument } from "../types/value/document.js";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/documentToLinkField.d.ts
|
|
5
|
+
type SetOptional<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
6
|
+
/**
|
|
7
|
+
* Converts a document into a link field, this is useful when crawling the API
|
|
8
|
+
* for document links
|
|
9
|
+
*
|
|
10
|
+
* @typeParam TDocument - Specific interface of the provided document
|
|
11
|
+
*
|
|
12
|
+
* @param prismicDocument - A document coming from Prismic
|
|
13
|
+
*
|
|
14
|
+
* @returns The equivalent link field to use with `asLink()`
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
declare const documentToLinkField: <TDocument extends SetOptional<PrismicDocument, "slugs">>(prismicDocument: TDocument) => FilledContentRelationshipField<TDocument["type"], TDocument["lang"], TDocument["data"]>;
|
|
19
|
+
//#endregion
|
|
20
|
+
export { documentToLinkField };
|
|
21
|
+
//# sourceMappingURL=documentToLinkField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentToLinkField.d.ts","names":[],"sources":["../../src/helpers/documentToLinkField.ts"],"sourcesContent":[],"mappings":";;;;KAIK,kCAAkC,KAAK,KAAK,GAAG,QACnD,QAAQ,KAAK,GAAG;;AAJ6C;;;;;;;;;;AAkB9D;AAC+B,cADlB,mBACkB,EAAA,CAAA,kBAAZ,WAAY,CAAA,eAAA,EAAA,OAAA,CAAA,CAAA,CAAA,eAAA,EAEb,SAFa,EAAA,GAG5B,8BAH4B,CAI9B,SAJ8B,CAAA,MAAA,CAAA,EAK9B,SAL8B,CAAA,MAAA,CAAA,EAM9B,SAN8B,CAAA,MAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LinkType } from "../types/value/link.js";
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/documentToLinkField.ts
|
|
4
|
+
/**
|
|
5
|
+
* Converts a document into a link field, this is useful when crawling the API
|
|
6
|
+
* for document links
|
|
7
|
+
*
|
|
8
|
+
* @typeParam TDocument - Specific interface of the provided document
|
|
9
|
+
*
|
|
10
|
+
* @param prismicDocument - A document coming from Prismic
|
|
11
|
+
*
|
|
12
|
+
* @returns The equivalent link field to use with `asLink()`
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
const documentToLinkField = (prismicDocument) => {
|
|
17
|
+
var _prismicDocument$slug;
|
|
18
|
+
return {
|
|
19
|
+
link_type: LinkType.Document,
|
|
20
|
+
id: prismicDocument.id,
|
|
21
|
+
uid: prismicDocument.uid || void 0,
|
|
22
|
+
type: prismicDocument.type,
|
|
23
|
+
tags: prismicDocument.tags,
|
|
24
|
+
lang: prismicDocument.lang,
|
|
25
|
+
url: prismicDocument.url == null ? void 0 : prismicDocument.url,
|
|
26
|
+
slug: (_prismicDocument$slug = prismicDocument.slugs) === null || _prismicDocument$slug === void 0 ? void 0 : _prismicDocument$slug[0],
|
|
27
|
+
...prismicDocument.data && Object.keys(prismicDocument.data).length > 0 ? { data: prismicDocument.data } : {}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { documentToLinkField };
|
|
33
|
+
//# sourceMappingURL=documentToLinkField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"documentToLinkField.js","names":[],"sources":["../../src/helpers/documentToLinkField.ts"],"sourcesContent":["import type { FilledContentRelationshipField } from \"../types/value/contentRelationship\"\nimport type { PrismicDocument } from \"../types/value/document\"\nimport { LinkType } from \"../types/value/link\"\n\ntype SetOptional<T, Keys extends keyof T> = Omit<T, Keys> &\n\tPartial<Pick<T, Keys>>\n\n/**\n * Converts a document into a link field, this is useful when crawling the API\n * for document links\n *\n * @typeParam TDocument - Specific interface of the provided document\n *\n * @param prismicDocument - A document coming from Prismic\n *\n * @returns The equivalent link field to use with `asLink()`\n *\n * @internal\n */\nexport const documentToLinkField = <\n\tTDocument extends SetOptional<PrismicDocument, \"slugs\">,\n>(\n\tprismicDocument: TDocument,\n): FilledContentRelationshipField<\n\tTDocument[\"type\"],\n\tTDocument[\"lang\"],\n\tTDocument[\"data\"]\n> => {\n\treturn {\n\t\tlink_type: LinkType.Document,\n\t\tid: prismicDocument.id,\n\t\tuid: prismicDocument.uid || undefined,\n\t\ttype: prismicDocument.type,\n\t\ttags: prismicDocument.tags,\n\t\tlang: prismicDocument.lang,\n\t\turl: prismicDocument.url == null ? undefined : prismicDocument.url,\n\t\tslug: prismicDocument.slugs?.[0], // Slug field is not available with GraphQL\n\t\t// The REST API does not include a `data` property if the data\n\t\t// object is empty.\n\t\t//\n\t\t// A presence check for `prismicDocument.data` is done to\n\t\t// support partial documents. While `documentToLinkField` is\n\t\t// not typed to accept partial documents, passing a partial\n\t\t// document can happen in untyped projects.\n\t\t...(prismicDocument.data && Object.keys(prismicDocument.data).length > 0\n\t\t\t? { data: prismicDocument.data }\n\t\t\t: {}),\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAa,uBAGZ,oBAKI;;AACJ,QAAO;EACN,WAAW,SAAS;EACpB,IAAI,gBAAgB;EACpB,KAAK,gBAAgB,OAAO;EAC5B,MAAM,gBAAgB;EACtB,MAAM,gBAAgB;EACtB,MAAM,gBAAgB;EACtB,KAAK,gBAAgB,OAAO,OAAO,SAAY,gBAAgB;EAC/D,+BAAM,gBAAgB,qFAAQ;EAQ9B,GAAI,gBAAgB,QAAQ,OAAO,KAAK,gBAAgB,KAAK,CAAC,SAAS,IACpE,EAAE,MAAM,gBAAgB,MAAM,GAC9B,EAAE;EACL"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/helpers/isFilled.ts
|
|
4
|
+
var isFilled_exports = /* @__PURE__ */ require_rolldown_runtime.__export({
|
|
5
|
+
color: () => color,
|
|
6
|
+
contentRelationship: () => contentRelationship,
|
|
7
|
+
date: () => date,
|
|
8
|
+
embed: () => embed,
|
|
9
|
+
geoPoint: () => geoPoint,
|
|
10
|
+
group: () => group,
|
|
11
|
+
image: () => image,
|
|
12
|
+
imageThumbnail: () => imageThumbnail,
|
|
13
|
+
integration: () => integration,
|
|
14
|
+
integrationField: () => integrationField,
|
|
15
|
+
integrationFields: () => integrationFields,
|
|
16
|
+
keyText: () => keyText,
|
|
17
|
+
link: () => link,
|
|
18
|
+
linkToMedia: () => linkToMedia,
|
|
19
|
+
number: () => number,
|
|
20
|
+
repeatable: () => repeatable,
|
|
21
|
+
richText: () => richText,
|
|
22
|
+
select: () => select,
|
|
23
|
+
sliceZone: () => sliceZone,
|
|
24
|
+
table: () => table,
|
|
25
|
+
timestamp: () => timestamp,
|
|
26
|
+
title: () => title
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Determines if a value is not nullish (i.e. not `null` or `undefined`). This
|
|
30
|
+
* is used to check if nullable field values are filled.
|
|
31
|
+
*
|
|
32
|
+
* @param input - The value to check.
|
|
33
|
+
*
|
|
34
|
+
* @returns `true` if `input` is not nullish, `false` otherwise.
|
|
35
|
+
*/
|
|
36
|
+
const isNonNullish = (input) => {
|
|
37
|
+
return input != null;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Determines if an array is not empty. This is used to check if array-based
|
|
41
|
+
* fields are filled.
|
|
42
|
+
*
|
|
43
|
+
* @param input - The array to check.
|
|
44
|
+
*
|
|
45
|
+
* @returns `true` if `input` has at least one element, `false` otherwise.
|
|
46
|
+
*/
|
|
47
|
+
const isNonEmptyArray = (input) => {
|
|
48
|
+
return !!input.length;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Determines if a rich text field is filled.
|
|
52
|
+
*
|
|
53
|
+
* @param field - rich text field to check.
|
|
54
|
+
*
|
|
55
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
56
|
+
*/
|
|
57
|
+
const richText = (field) => {
|
|
58
|
+
if (!isNonNullish(field)) return false;
|
|
59
|
+
else if (field.length === 1 && "text" in field[0]) return !!field[0].text;
|
|
60
|
+
else return !!field.length;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Determines if a title field is filled.
|
|
64
|
+
*
|
|
65
|
+
* @param field - Title field to check.
|
|
66
|
+
*
|
|
67
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
68
|
+
*/
|
|
69
|
+
const title = richText;
|
|
70
|
+
/**
|
|
71
|
+
* Determines if an image thumbnail is filled.
|
|
72
|
+
*
|
|
73
|
+
* @param thumbnail - Image thumbnail to check.
|
|
74
|
+
*
|
|
75
|
+
* @returns `true` if the thumbnail is filled, `false` otherwise.
|
|
76
|
+
*/
|
|
77
|
+
const imageThumbnail = (thumbnail) => {
|
|
78
|
+
return isNonNullish(thumbnail) && !!thumbnail.url;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Determines if an image field is filled.
|
|
82
|
+
*
|
|
83
|
+
* @param field - Image field to check.
|
|
84
|
+
*
|
|
85
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
86
|
+
*/
|
|
87
|
+
const image = imageThumbnail;
|
|
88
|
+
/**
|
|
89
|
+
* Determines if a link field is filled.
|
|
90
|
+
*
|
|
91
|
+
* @param field - Link field to check.
|
|
92
|
+
*
|
|
93
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
94
|
+
*/
|
|
95
|
+
const link = (field) => {
|
|
96
|
+
return isNonNullish(field) && ("id" in field || "url" in field);
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Determines if a link to media field is filled.
|
|
100
|
+
*
|
|
101
|
+
* @param field - Link to media field to check.
|
|
102
|
+
*
|
|
103
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
104
|
+
*/
|
|
105
|
+
const linkToMedia = link;
|
|
106
|
+
/**
|
|
107
|
+
* Determines if a content relationship field is filled.
|
|
108
|
+
*
|
|
109
|
+
* @param field - Content relationship field to check.
|
|
110
|
+
*
|
|
111
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
112
|
+
*/
|
|
113
|
+
const contentRelationship = link;
|
|
114
|
+
/**
|
|
115
|
+
* Determines if a date field is filled.
|
|
116
|
+
*
|
|
117
|
+
* @param field - Date field to check.
|
|
118
|
+
*
|
|
119
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
120
|
+
*/
|
|
121
|
+
const date = isNonNullish;
|
|
122
|
+
/**
|
|
123
|
+
* Determines if a timestamp field is filled.
|
|
124
|
+
*
|
|
125
|
+
* @param field - Timestamp field to check.
|
|
126
|
+
*
|
|
127
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
128
|
+
*/
|
|
129
|
+
const timestamp = isNonNullish;
|
|
130
|
+
/**
|
|
131
|
+
* Determines if a color field is filled.
|
|
132
|
+
*
|
|
133
|
+
* @param field - Color field to check.
|
|
134
|
+
*
|
|
135
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
136
|
+
*/
|
|
137
|
+
const color = isNonNullish;
|
|
138
|
+
/**
|
|
139
|
+
* Determines if a number field is filled.
|
|
140
|
+
*
|
|
141
|
+
* @param field - Number field to check.
|
|
142
|
+
*
|
|
143
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
144
|
+
*/
|
|
145
|
+
const number = isNonNullish;
|
|
146
|
+
/**
|
|
147
|
+
* Determines if a key text field is filled.
|
|
148
|
+
*
|
|
149
|
+
* @param field - Key text field to check.
|
|
150
|
+
*
|
|
151
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
152
|
+
*/
|
|
153
|
+
const keyText = (field) => {
|
|
154
|
+
return !!field;
|
|
155
|
+
};
|
|
156
|
+
/**
|
|
157
|
+
* Determines if a select field is filled.
|
|
158
|
+
*
|
|
159
|
+
* @param field - Select field to check.
|
|
160
|
+
*
|
|
161
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
162
|
+
*/
|
|
163
|
+
const select = isNonNullish;
|
|
164
|
+
/**
|
|
165
|
+
* Determines if an embed field is filled.
|
|
166
|
+
*
|
|
167
|
+
* @param field - Embed field to check.
|
|
168
|
+
*
|
|
169
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
170
|
+
*/
|
|
171
|
+
const embed = (field) => {
|
|
172
|
+
return isNonNullish(field) && !!field.embed_url;
|
|
173
|
+
};
|
|
174
|
+
/**
|
|
175
|
+
* Determines if a geopoint field is filled.
|
|
176
|
+
*
|
|
177
|
+
* @param field - Geopoint field to check.
|
|
178
|
+
*
|
|
179
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
180
|
+
*/
|
|
181
|
+
const geoPoint = (field) => {
|
|
182
|
+
return isNonNullish(field) && "longitude" in field;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Determines if a table field is filled.
|
|
186
|
+
*
|
|
187
|
+
* @param field - Table field to check.
|
|
188
|
+
*
|
|
189
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
190
|
+
*/
|
|
191
|
+
const table = isNonNullish;
|
|
192
|
+
/**
|
|
193
|
+
* Determines if an integration field is filled.
|
|
194
|
+
*
|
|
195
|
+
* @param field - Integration field to check.
|
|
196
|
+
*
|
|
197
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
198
|
+
*/
|
|
199
|
+
const integration = isNonNullish;
|
|
200
|
+
/**
|
|
201
|
+
* @deprecated Renamed to `integration`.
|
|
202
|
+
*/
|
|
203
|
+
const integrationField = integration;
|
|
204
|
+
/**
|
|
205
|
+
* @deprecated Renamed to `integrationField`.
|
|
206
|
+
*/
|
|
207
|
+
const integrationFields = integration;
|
|
208
|
+
/**
|
|
209
|
+
* Determines if a repeatable field has at least one item.
|
|
210
|
+
*
|
|
211
|
+
* @param repeatable - Repeatable to check.
|
|
212
|
+
*
|
|
213
|
+
* @returns `true` if `repeatable` contains at least one item, `false`
|
|
214
|
+
* otherwise.
|
|
215
|
+
*/
|
|
216
|
+
const repeatable = (repeatable$1) => {
|
|
217
|
+
return isNonNullish(repeatable$1) && isNonEmptyArray(repeatable$1);
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Determines if a group has at least one item.
|
|
221
|
+
*
|
|
222
|
+
* @param group - Group to check.
|
|
223
|
+
*
|
|
224
|
+
* @returns `true` if the group contains at least one item, `false` otherwise.
|
|
225
|
+
*/
|
|
226
|
+
const group = (group$1) => {
|
|
227
|
+
return isNonNullish(group$1) && isNonEmptyArray(group$1);
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Determines if a slice zone has at least one slice.
|
|
231
|
+
*
|
|
232
|
+
* @param slices - Slice zone to check.
|
|
233
|
+
*
|
|
234
|
+
* @returns `true` if the slice zone contains at least one slice, `false`
|
|
235
|
+
* otherwise.
|
|
236
|
+
*/
|
|
237
|
+
const sliceZone = (slices) => {
|
|
238
|
+
return isNonNullish(slices) && isNonEmptyArray(slices);
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
//#endregion
|
|
242
|
+
exports.imageThumbnail = imageThumbnail;
|
|
243
|
+
Object.defineProperty(exports, 'isFilled_exports', {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function () {
|
|
246
|
+
return isFilled_exports;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
exports.link = link;
|
|
250
|
+
//# sourceMappingURL=isFilled.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isFilled.cjs","names":["repeatable","group"],"sources":["../../src/helpers/isFilled.ts"],"sourcesContent":["import type { ColorField } from \"../types/value/color\"\nimport type {\n\tContentRelationshipField,\n\tEmptyContentRelationshipField,\n} from \"../types/value/contentRelationship\"\nimport type { DateField } from \"../types/value/date\"\nimport type { AnyOEmbed, EmbedField } from \"../types/value/embed\"\nimport type { GeoPointField } from \"../types/value/geoPoint\"\nimport type { GroupField, NestedGroupField } from \"../types/value/group\"\nimport type { ImageField, ImageFieldImage } from \"../types/value/image\"\nimport type {\n\tIntegrationField,\n\tIntegrationFieldData,\n} from \"../types/value/integration\"\nimport type { KeyTextField } from \"../types/value/keyText\"\nimport type { LinkField } from \"../types/value/link\"\nimport type { LinkToMediaField } from \"../types/value/linkToMedia\"\nimport type { NumberField } from \"../types/value/number\"\nimport type { RichTextField } from \"../types/value/richText\"\nimport type { SelectField } from \"../types/value/select\"\nimport type { SharedSlice } from \"../types/value/sharedSlice\"\nimport type { Slice } from \"../types/value/slice\"\nimport type { SliceZone } from \"../types/value/sliceZone\"\nimport type { TableField } from \"../types/value/table\"\nimport type { TimestampField } from \"../types/value/timestamp\"\nimport type { TitleField } from \"../types/value/title\"\nimport type { AnyRegularField, Repeatable } from \"../types/value/types\"\n\n/**\n * Determines if a value is not nullish (i.e. not `null` or `undefined`). This\n * is used to check if nullable field values are filled.\n *\n * @param input - The value to check.\n *\n * @returns `true` if `input` is not nullish, `false` otherwise.\n */\nconst isNonNullish = <T>(input: T): input is NonNullable<T> => {\n\treturn input != null\n}\n\n/**\n * Determines if an array is not empty. This is used to check if array-based\n * fields are filled.\n *\n * @param input - The array to check.\n *\n * @returns `true` if `input` has at least one element, `false` otherwise.\n */\nconst isNonEmptyArray = <T>(input: T[]): input is [T, ...T[]] => {\n\treturn !!input.length\n}\n\n/**\n * Determines if a rich text field is filled.\n *\n * @param field - rich text field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const richText = (\n\tfield: RichTextField | null | undefined,\n): field is RichTextField<\"filled\"> => {\n\tif (!isNonNullish(field)) {\n\t\treturn false\n\t} else if (field.length === 1 && \"text\" in field[0]) {\n\t\treturn !!field[0].text\n\t} else {\n\t\treturn !!field.length\n\t}\n}\n\n/**\n * Determines if a title field is filled.\n *\n * @param field - Title field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const title = richText as (\n\tfield: TitleField | null | undefined,\n) => field is TitleField<\"filled\">\n\n/**\n * Determines if an image thumbnail is filled.\n *\n * @param thumbnail - Image thumbnail to check.\n *\n * @returns `true` if the thumbnail is filled, `false` otherwise.\n */\nexport const imageThumbnail = (\n\tthumbnail: ImageFieldImage | null | undefined,\n): thumbnail is ImageFieldImage<\"filled\"> => {\n\treturn isNonNullish(thumbnail) && !!thumbnail.url\n}\n\n/**\n * Determines if an image field is filled.\n *\n * @param field - Image field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const image = imageThumbnail as <\n\tThumbnailNames extends string | null = never,\n>(\n\tfield: ImageField<ThumbnailNames> | null | undefined,\n) => field is ImageField<ThumbnailNames, \"filled\">\n\n/**\n * Determines if a link field is filled.\n *\n * @param field - Link field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const link = <\n\tTypeEnum = string,\n\tLangEnum = string,\n\tDataInterface extends\n\t\t| Record<string, AnyRegularField | GroupField | SliceZone>\n\t\t| unknown = unknown,\n>(\n\tfield: LinkField<TypeEnum, LangEnum, DataInterface> | null | undefined,\n): field is LinkField<TypeEnum, LangEnum, DataInterface, \"filled\"> => {\n\treturn isNonNullish(field) && (\"id\" in field || \"url\" in field)\n}\n\n/**\n * Determines if a link to media field is filled.\n *\n * @param field - Link to media field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const linkToMedia = link as (\n\tfield: LinkToMediaField | null | undefined,\n) => field is LinkToMediaField<\"filled\">\n\n/**\n * Determines if a content relationship field is filled.\n *\n * @param field - Content relationship field to check.\n *\n * @returns `true` if the field is filled, `false` otherwise.\n */\nexport const contentRelationship = link as <\n\tField extends ContentRelationshipField,\n>(\n\tfield: Field | null | undefined,\n) => field is Exclude<Field, EmptyContentRelationshipField>\n\n/**\n * Determines if a date field is filled.\n *\n * @param field - Date field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const date = isNonNullish as (\n\tfield: DateField | null | undefined,\n) => field is DateField<\"filled\">\n\n/**\n * Determines if a timestamp field is filled.\n *\n * @param field - Timestamp field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const timestamp = isNonNullish as (\n\tfield: TimestampField | null | undefined,\n) => field is TimestampField<\"filled\">\n\n/**\n * Determines if a color field is filled.\n *\n * @param field - Color field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const color = isNonNullish as (\n\tfield: ColorField | null | undefined,\n) => field is ColorField<\"filled\">\n\n/**\n * Determines if a number field is filled.\n *\n * @param field - Number field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const number = isNonNullish as (\n\tfield: NumberField | null | undefined,\n) => field is NumberField<\"filled\">\n\n/**\n * Determines if a key text field is filled.\n *\n * @param field - Key text field to check.\n *\n * @returns `true` if the field is filled, `false` otherwise.\n */\nexport const keyText = (\n\tfield: KeyTextField | null | undefined,\n): field is KeyTextField<\"filled\"> => {\n\treturn !!field\n}\n\n/**\n * Determines if a select field is filled.\n *\n * @param field - Select field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const select = isNonNullish as <Enum extends string>(\n\tfield: SelectField<Enum> | null | undefined,\n) => field is SelectField<Enum, \"filled\">\n\n/**\n * Determines if an embed field is filled.\n *\n * @param field - Embed field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const embed = <Field extends EmbedField<AnyOEmbed>>(\n\tfield: Field | null | undefined,\n): field is Extract<Field, EmbedField<AnyOEmbed, \"filled\">> => {\n\treturn isNonNullish(field) && !!field.embed_url\n}\n\n/**\n * Determines if a geopoint field is filled.\n *\n * @param field - Geopoint field to check.\n *\n * @returns `true` if the field is filled, `false` otherwise.\n */\nexport const geoPoint = (\n\tfield: GeoPointField | null | undefined,\n): field is GeoPointField<\"filled\"> => {\n\treturn isNonNullish(field) && \"longitude\" in field\n}\n\n/**\n * Determines if a table field is filled.\n *\n * @param field - Table field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const table = isNonNullish as (\n\tfield: TableField | null | undefined,\n) => field is TableField<\"filled\">\n\n/**\n * Determines if an integration field is filled.\n *\n * @param field - Integration field to check.\n *\n * @returns `true` if `field` is filled, `false` otherwise.\n */\nexport const integration = isNonNullish as <Data extends IntegrationFieldData>(\n\tfield: IntegrationField<Data> | null | undefined,\n) => field is IntegrationField<Data, \"filled\">\n/**\n * @deprecated Renamed to `integration`.\n */\n// TODO: Remove when we remove support for deprecated `integrationField` export.\nexport const integrationField = integration\n/**\n * @deprecated Renamed to `integrationField`.\n */\n// TODO: Remove when we remove support for deprecated `integrationFields` export.\nexport const integrationFields = integration\n\n/**\n * Determines if a repeatable field has at least one item.\n *\n * @param repeatable - Repeatable to check.\n *\n * @returns `true` if `repeatable` contains at least one item, `false`\n * otherwise.\n */\nexport const repeatable = <T extends LinkField>(\n\trepeatable: Repeatable<T> | null | undefined,\n): repeatable is Repeatable<T, \"filled\"> => {\n\treturn isNonNullish(repeatable) && isNonEmptyArray(repeatable)\n}\n\n/**\n * Determines if a group has at least one item.\n *\n * @param group - Group to check.\n *\n * @returns `true` if the group contains at least one item, `false` otherwise.\n */\nexport const group = <\n\tFields extends Record<string, AnyRegularField | NestedGroupField>,\n>(\n\tgroup: GroupField<Fields> | null | undefined,\n): group is GroupField<Fields, \"filled\"> => {\n\treturn isNonNullish(group) && isNonEmptyArray(group)\n}\n\n/**\n * Determines if a slice zone has at least one slice.\n *\n * @param slices - Slice zone to check.\n *\n * @returns `true` if the slice zone contains at least one slice, `false`\n * otherwise.\n */\nexport const sliceZone = <Slices extends Slice | SharedSlice>(\n\tslices: SliceZone<Slices> | null | undefined,\n): slices is SliceZone<Slices, \"filled\"> => {\n\treturn isNonNullish(slices) && isNonEmptyArray(slices)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,gBAAmB,UAAsC;AAC9D,QAAO,SAAS;;;;;;;;;;AAWjB,MAAM,mBAAsB,UAAqC;AAChE,QAAO,CAAC,CAAC,MAAM;;;;;;;;;AAUhB,MAAa,YACZ,UACsC;AACtC,KAAI,CAAC,aAAa,MAAM,CACvB,QAAO;UACG,MAAM,WAAW,KAAK,UAAU,MAAM,GAChD,QAAO,CAAC,CAAC,MAAM,GAAG;KAElB,QAAO,CAAC,CAAC,MAAM;;;;;;;;;AAWjB,MAAa,QAAQ;;;;;;;;AAWrB,MAAa,kBACZ,cAC4C;AAC5C,QAAO,aAAa,UAAU,IAAI,CAAC,CAAC,UAAU;;;;;;;;;AAU/C,MAAa,QAAQ;;;;;;;;AAarB,MAAa,QAOZ,UACqE;AACrE,QAAO,aAAa,MAAM,KAAK,QAAQ,SAAS,SAAS;;;;;;;;;AAU1D,MAAa,cAAc;;;;;;;;AAW3B,MAAa,sBAAsB;;;;;;;;AAanC,MAAa,OAAO;;;;;;;;AAWpB,MAAa,YAAY;;;;;;;;AAWzB,MAAa,QAAQ;;;;;;;;AAWrB,MAAa,SAAS;;;;;;;;AAWtB,MAAa,WACZ,UACqC;AACrC,QAAO,CAAC,CAAC;;;;;;;;;AAUV,MAAa,SAAS;;;;;;;;AAWtB,MAAa,SACZ,UAC8D;AAC9D,QAAO,aAAa,MAAM,IAAI,CAAC,CAAC,MAAM;;;;;;;;;AAUvC,MAAa,YACZ,UACsC;AACtC,QAAO,aAAa,MAAM,IAAI,eAAe;;;;;;;;;AAU9C,MAAa,QAAQ;;;;;;;;AAWrB,MAAa,cAAc;;;;AAO3B,MAAa,mBAAmB;;;;AAKhC,MAAa,oBAAoB;;;;;;;;;AAUjC,MAAa,cACZ,iBAC2C;AAC3C,QAAO,aAAaA,aAAW,IAAI,gBAAgBA,aAAW;;;;;;;;;AAU/D,MAAa,SAGZ,YAC2C;AAC3C,QAAO,aAAaC,QAAM,IAAI,gBAAgBA,QAAM;;;;;;;;;;AAWrD,MAAa,aACZ,WAC2C;AAC3C,QAAO,aAAa,OAAO,IAAI,gBAAgB,OAAO"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ColorField } from "../types/value/color.cjs";
|
|
2
|
+
import { GroupField, NestedGroupField } from "../types/value/group.cjs";
|
|
3
|
+
import { SharedSlice } from "../types/value/sharedSlice.cjs";
|
|
4
|
+
import { Slice } from "../types/value/slice.cjs";
|
|
5
|
+
import { SliceZone } from "../types/value/sliceZone.cjs";
|
|
6
|
+
import { ContentRelationshipField, EmptyContentRelationshipField } from "../types/value/contentRelationship.cjs";
|
|
7
|
+
import { DateField } from "../types/value/date.cjs";
|
|
8
|
+
import { AnyOEmbed, EmbedField } from "../types/value/embed.cjs";
|
|
9
|
+
import { GeoPointField } from "../types/value/geoPoint.cjs";
|
|
10
|
+
import { ImageField, ImageFieldImage } from "../types/value/image.cjs";
|
|
11
|
+
import { KeyTextField } from "../types/value/keyText.cjs";
|
|
12
|
+
import { LinkToMediaField } from "../types/value/linkToMedia.cjs";
|
|
13
|
+
import { LinkField } from "../types/value/link.cjs";
|
|
14
|
+
import { NumberField } from "../types/value/number.cjs";
|
|
15
|
+
import { RichTextField } from "../types/value/richText.cjs";
|
|
16
|
+
import { SelectField } from "../types/value/select.cjs";
|
|
17
|
+
import { TableField } from "../types/value/table.cjs";
|
|
18
|
+
import { TimestampField } from "../types/value/timestamp.cjs";
|
|
19
|
+
import { TitleField } from "../types/value/title.cjs";
|
|
20
|
+
import { AnyRegularField, Repeatable } from "../types/value/types.cjs";
|
|
21
|
+
import { IntegrationField, IntegrationFieldData } from "../types/value/integration.cjs";
|
|
22
|
+
|
|
23
|
+
//#region src/helpers/isFilled.d.ts
|
|
24
|
+
declare namespace isFilled_d_exports {
|
|
25
|
+
export { color, contentRelationship, date, embed, geoPoint, group, image, imageThumbnail, integration, integrationField, integrationFields, keyText, link, linkToMedia, number, repeatable, richText, select, sliceZone, table, timestamp, title };
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Determines if a rich text field is filled.
|
|
29
|
+
*
|
|
30
|
+
* @param field - rich text field to check.
|
|
31
|
+
*
|
|
32
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
33
|
+
*/
|
|
34
|
+
declare const richText: (field: RichTextField | null | undefined) => field is RichTextField<"filled">;
|
|
35
|
+
/**
|
|
36
|
+
* Determines if a title field is filled.
|
|
37
|
+
*
|
|
38
|
+
* @param field - Title field to check.
|
|
39
|
+
*
|
|
40
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
41
|
+
*/
|
|
42
|
+
declare const title: (field: TitleField | null | undefined) => field is TitleField<"filled">;
|
|
43
|
+
/**
|
|
44
|
+
* Determines if an image thumbnail is filled.
|
|
45
|
+
*
|
|
46
|
+
* @param thumbnail - Image thumbnail to check.
|
|
47
|
+
*
|
|
48
|
+
* @returns `true` if the thumbnail is filled, `false` otherwise.
|
|
49
|
+
*/
|
|
50
|
+
declare const imageThumbnail: (thumbnail: ImageFieldImage | null | undefined) => thumbnail is ImageFieldImage<"filled">;
|
|
51
|
+
/**
|
|
52
|
+
* Determines if an image field is filled.
|
|
53
|
+
*
|
|
54
|
+
* @param field - Image field to check.
|
|
55
|
+
*
|
|
56
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
57
|
+
*/
|
|
58
|
+
declare const image: <ThumbnailNames extends string | null = never>(field: ImageField<ThumbnailNames> | null | undefined) => field is ImageField<ThumbnailNames, "filled">;
|
|
59
|
+
/**
|
|
60
|
+
* Determines if a link field is filled.
|
|
61
|
+
*
|
|
62
|
+
* @param field - Link field to check.
|
|
63
|
+
*
|
|
64
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
65
|
+
*/
|
|
66
|
+
declare const link: <TypeEnum = string, LangEnum = string, DataInterface extends Record<string, AnyRegularField | GroupField | SliceZone> | unknown = unknown>(field: LinkField<TypeEnum, LangEnum, DataInterface> | null | undefined) => field is LinkField<TypeEnum, LangEnum, DataInterface, "filled">;
|
|
67
|
+
/**
|
|
68
|
+
* Determines if a link to media field is filled.
|
|
69
|
+
*
|
|
70
|
+
* @param field - Link to media field to check.
|
|
71
|
+
*
|
|
72
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
73
|
+
*/
|
|
74
|
+
declare const linkToMedia: (field: LinkToMediaField | null | undefined) => field is LinkToMediaField<"filled">;
|
|
75
|
+
/**
|
|
76
|
+
* Determines if a content relationship field is filled.
|
|
77
|
+
*
|
|
78
|
+
* @param field - Content relationship field to check.
|
|
79
|
+
*
|
|
80
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
81
|
+
*/
|
|
82
|
+
declare const contentRelationship: <Field extends ContentRelationshipField>(field: Field | null | undefined) => field is Exclude<Field, EmptyContentRelationshipField>;
|
|
83
|
+
/**
|
|
84
|
+
* Determines if a date field is filled.
|
|
85
|
+
*
|
|
86
|
+
* @param field - Date field to check.
|
|
87
|
+
*
|
|
88
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
89
|
+
*/
|
|
90
|
+
declare const date: (field: DateField | null | undefined) => field is DateField<"filled">;
|
|
91
|
+
/**
|
|
92
|
+
* Determines if a timestamp field is filled.
|
|
93
|
+
*
|
|
94
|
+
* @param field - Timestamp field to check.
|
|
95
|
+
*
|
|
96
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
97
|
+
*/
|
|
98
|
+
declare const timestamp: (field: TimestampField | null | undefined) => field is TimestampField<"filled">;
|
|
99
|
+
/**
|
|
100
|
+
* Determines if a color field is filled.
|
|
101
|
+
*
|
|
102
|
+
* @param field - Color field to check.
|
|
103
|
+
*
|
|
104
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
105
|
+
*/
|
|
106
|
+
declare const color: (field: ColorField | null | undefined) => field is ColorField<"filled">;
|
|
107
|
+
/**
|
|
108
|
+
* Determines if a number field is filled.
|
|
109
|
+
*
|
|
110
|
+
* @param field - Number field to check.
|
|
111
|
+
*
|
|
112
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
113
|
+
*/
|
|
114
|
+
declare const number: (field: NumberField | null | undefined) => field is NumberField<"filled">;
|
|
115
|
+
/**
|
|
116
|
+
* Determines if a key text field is filled.
|
|
117
|
+
*
|
|
118
|
+
* @param field - Key text field to check.
|
|
119
|
+
*
|
|
120
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
121
|
+
*/
|
|
122
|
+
declare const keyText: (field: KeyTextField | null | undefined) => field is KeyTextField<"filled">;
|
|
123
|
+
/**
|
|
124
|
+
* Determines if a select field is filled.
|
|
125
|
+
*
|
|
126
|
+
* @param field - Select field to check.
|
|
127
|
+
*
|
|
128
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
129
|
+
*/
|
|
130
|
+
declare const select: <Enum extends string>(field: SelectField<Enum> | null | undefined) => field is SelectField<Enum, "filled">;
|
|
131
|
+
/**
|
|
132
|
+
* Determines if an embed field is filled.
|
|
133
|
+
*
|
|
134
|
+
* @param field - Embed field to check.
|
|
135
|
+
*
|
|
136
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
137
|
+
*/
|
|
138
|
+
declare const embed: <Field extends EmbedField<AnyOEmbed>>(field: Field | null | undefined) => field is Extract<Field, EmbedField<AnyOEmbed, "filled">>;
|
|
139
|
+
/**
|
|
140
|
+
* Determines if a geopoint field is filled.
|
|
141
|
+
*
|
|
142
|
+
* @param field - Geopoint field to check.
|
|
143
|
+
*
|
|
144
|
+
* @returns `true` if the field is filled, `false` otherwise.
|
|
145
|
+
*/
|
|
146
|
+
declare const geoPoint: (field: GeoPointField | null | undefined) => field is GeoPointField<"filled">;
|
|
147
|
+
/**
|
|
148
|
+
* Determines if a table field is filled.
|
|
149
|
+
*
|
|
150
|
+
* @param field - Table field to check.
|
|
151
|
+
*
|
|
152
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
153
|
+
*/
|
|
154
|
+
declare const table: (field: TableField | null | undefined) => field is TableField<"filled">;
|
|
155
|
+
/**
|
|
156
|
+
* Determines if an integration field is filled.
|
|
157
|
+
*
|
|
158
|
+
* @param field - Integration field to check.
|
|
159
|
+
*
|
|
160
|
+
* @returns `true` if `field` is filled, `false` otherwise.
|
|
161
|
+
*/
|
|
162
|
+
declare const integration: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">;
|
|
163
|
+
/**
|
|
164
|
+
* @deprecated Renamed to `integration`.
|
|
165
|
+
*/
|
|
166
|
+
declare const integrationField: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">;
|
|
167
|
+
/**
|
|
168
|
+
* @deprecated Renamed to `integrationField`.
|
|
169
|
+
*/
|
|
170
|
+
declare const integrationFields: <Data extends IntegrationFieldData>(field: IntegrationField<Data> | null | undefined) => field is IntegrationField<Data, "filled">;
|
|
171
|
+
/**
|
|
172
|
+
* Determines if a repeatable field has at least one item.
|
|
173
|
+
*
|
|
174
|
+
* @param repeatable - Repeatable to check.
|
|
175
|
+
*
|
|
176
|
+
* @returns `true` if `repeatable` contains at least one item, `false`
|
|
177
|
+
* otherwise.
|
|
178
|
+
*/
|
|
179
|
+
declare const repeatable: <T extends LinkField>(repeatable: Repeatable<T> | null | undefined) => repeatable is Repeatable<T, "filled">;
|
|
180
|
+
/**
|
|
181
|
+
* Determines if a group has at least one item.
|
|
182
|
+
*
|
|
183
|
+
* @param group - Group to check.
|
|
184
|
+
*
|
|
185
|
+
* @returns `true` if the group contains at least one item, `false` otherwise.
|
|
186
|
+
*/
|
|
187
|
+
declare const group: <Fields extends Record<string, AnyRegularField | NestedGroupField>>(group: GroupField<Fields> | null | undefined) => group is GroupField<Fields, "filled">;
|
|
188
|
+
/**
|
|
189
|
+
* Determines if a slice zone has at least one slice.
|
|
190
|
+
*
|
|
191
|
+
* @param slices - Slice zone to check.
|
|
192
|
+
*
|
|
193
|
+
* @returns `true` if the slice zone contains at least one slice, `false`
|
|
194
|
+
* otherwise.
|
|
195
|
+
*/
|
|
196
|
+
declare const sliceZone: <Slices extends Slice | SharedSlice>(slices: SliceZone<Slices> | null | undefined) => slices is SliceZone<Slices, "filled">;
|
|
197
|
+
//#endregion
|
|
198
|
+
export { isFilled_d_exports };
|
|
199
|
+
//# sourceMappingURL=isFilled.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isFilled.d.cts","names":[],"sources":["../../src/helpers/isFilled.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2Da,kBACL,8CACI;;;;;;;;cAiBC,eACL,2CACM;;;;;;;;cASD,4BACD,oDACI;;;;AAhChB;AAmBA;AAWA;AAaA;AAGmB,cAHN,KAGM,EAAA,CAAA,uBAAA,MAAA,GAAA,IAAA,GAAA,KAAA,CAAA,CAAA,KAAA,EAAX,UAAW,CAAA,cAAA,CAAA,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IACL,UADK,CACM,cADN,EAAA,QAAA,CAAA;;;;;AAUnB;;;AAIkD,cAJrC,IAIqC,EAAA,CAAA,WAAA,MAAA,EAAA,WAAA,MAAA,EAAA,sBAA9C,MAA8C,CAAA,MAAA,EAA/B,eAA+B,GAAb,UAAa,GAAA,SAAA,CAAA,GAAA,OAAA,GAAA,OAAA,CAAA,CAAA,KAAA,EAG1C,SAH0C,CAGhC,QAHgC,EAGtB,QAHsB,EAGZ,aAHY,CAAA,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAItC,SAJsC,CAI5B,QAJ4B,EAIlB,QAJkB,EAIR,aAJQ,EAAA,QAAA,CAAA;;;;;;;;AAIR,cAW7B,WAX6B,EAAA,CAAA,KAAA,EAYlC,gBAZkC,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAa5B,gBAb4B,CAAA,QAAA,CAAA;;;AAW1C;AAWA;;;;AAI6B,cAJhB,mBAIgB,EAAA,CAAA,cAHd,wBAGc,CAAA,CAAA,KAAA,EADrB,KACqB,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAAf,OAAe,CAAP,KAAO,EAAA,6BAAA,CAAA;;;AAS7B;AAWA;AAWA;AAWA;AAWA;AAaa,cAzDA,IA2D4B,EAAA,CAAA,KAAA,EA1DjC,SA0DiC,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAzD3B,SAyD2B,CAAA,QAAA,CAAA;;;;;;AASzC;;AAAoC,cAzDvB,SAyDuB,EAAA,CAAA,KAAA,EAxD5B,cAwD4B,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAvDtB,cAuDsB,CAAA,QAAA,CAAA;;;;;;;AAapC;AAaa,cAxEA,KAyEL,EAAA,CAAA,KAAA,EAxEA,UAyEM,GAAU,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAxEV,UAwEU,CAAA,QAAA,CAAA;AASxB;;;;;;;AAOa,cA/EA,MA+E8B,EAAA,CAAA,KAAA,EA9EnC,WA8EmC,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IA7E7B,WA6E6B,CAAA,QAAA,CAAA;;;;;;;AAK3C;AAZyD,cA7D5C,OA6D4C,EAAA,CAAA,KAAA,EA5DjD,YA4DiD,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IA3D7C,YA2D6C,CAAA,QAAA,CAAA;;;;;;AAsBzD;;AACwB,cAvEX,MAuEW,EAAA,CAAA,aAAA,MAAA,CAAA,CAAA,KAAA,EAtEhB,WAsEgB,CAtEJ,IAsEI,CAAA,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IArEV,WAqEU,CArEE,IAqEF,EAAA,QAAA,CAAA;;;;;AAYxB;;;AACgB,cAzEH,KAyEG,EAAA,CAAA,cAzEoB,UAyEpB,CAzE+B,SAyE/B,CAAA,CAAA,CAAA,KAAA,EAxER,KAwEQ,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAvEJ,OAuEI,CAvEI,KAuEJ,EAvEW,UAuEX,CAvEsB,SAuEtB,EAAA,QAAA,CAAA,CAAA;;;;;;AAehB;;AAAiD,cA3EpC,QA2EoC,EAAA,CAAA,KAAA,EA1EzC,aA0EyC,GAAA,IAAA,GAAA,SAAA,EAAA,GAAA,KAAA,IAzErC,aAyEqC,CAAA,QAAA,CAAA;;;;;;;;cA9DpC,eACL,2CACM;;;;;;;;cASD,2BAA4C,6BACjD,iBAAiB,sCACX,iBAAiB;;;;cAKlB,gCAP4C,6BACjD,iBAAiB,sCACX,iBAAiB;;;;cAUlB,iCAZ4C,6BACjD,iBAAiB,sCACX,iBAAiB;;;;;;;;;cAoBlB,uBAAwB,uBACxB,WAAW,wCACP,WAAW;;;;;;;;cAWf,uBACG,eAAe,kBAAkB,0BAEzC,WAAW,wCACP,WAAW;;;;;;;;;cAYV,2BAA4B,QAAQ,qBACxC,UAAU,yCACN,UAAU"}
|