payload-live-preview 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/adapters/astro/index.cjs +2 -2
- package/dist/adapters/astro/index.cjs.map +1 -1
- package/dist/adapters/astro/index.js +2 -2
- package/dist/adapters/astro/index.js.map +1 -1
- package/dist/adapters/astro/middleware-entry.cjs +2 -2
- package/dist/adapters/astro/middleware-entry.cjs.map +1 -1
- package/dist/adapters/astro/middleware-entry.js +2 -2
- package/dist/adapters/astro/middleware-entry.js.map +1 -1
- package/dist/adapters/nextjs/index.cjs +2 -2
- package/dist/adapters/nextjs/index.cjs.map +1 -1
- package/dist/adapters/nextjs/index.js +2 -2
- package/dist/adapters/nextjs/index.js.map +1 -1
- package/dist/adapters/nuxt/index.cjs +2 -2
- package/dist/adapters/nuxt/index.cjs.map +1 -1
- package/dist/adapters/nuxt/index.js +2 -2
- package/dist/adapters/nuxt/index.js.map +1 -1
- package/dist/adapters/sveltekit/index.cjs +2 -2
- package/dist/adapters/sveltekit/index.cjs.map +1 -1
- package/dist/adapters/sveltekit/index.js +2 -2
- package/dist/adapters/sveltekit/index.js.map +1 -1
- package/dist/core.cjs +13 -9
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +13 -9
- package/dist/core.js.map +1 -1
- package/dist/index.cjs +15 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
|
-
version: "1.0.
|
|
3
|
+
version: "1.0.3"};
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
6
|
var VERSION = package_default.version;
|
|
@@ -453,16 +453,20 @@ function isObjectMessage(value) {
|
|
|
453
453
|
}
|
|
454
454
|
function isLivePreviewMessage(value) {
|
|
455
455
|
const v = value;
|
|
456
|
-
if (v["data"] !== void 0 && !isPlainObject(v["data"])) return false;
|
|
457
|
-
if (v["fieldSchemaJSON"]
|
|
458
|
-
if (v["globalSlug"]
|
|
459
|
-
if (v["collectionSlug"]
|
|
460
|
-
if (v["locale"]
|
|
461
|
-
if (v["ready"]
|
|
462
|
-
if (v["previewToken"]
|
|
463
|
-
if (v["protocolVersion"]
|
|
456
|
+
if (v["data"] !== void 0 && v["data"] !== null && !isPlainObject(v["data"])) return false;
|
|
457
|
+
if (!optionalTypeOk(v["fieldSchemaJSON"], (x) => Array.isArray(x))) return false;
|
|
458
|
+
if (!optionalTypeOk(v["globalSlug"], (x) => typeof x === "string")) return false;
|
|
459
|
+
if (!optionalTypeOk(v["collectionSlug"], (x) => typeof x === "string")) return false;
|
|
460
|
+
if (!optionalTypeOk(v["locale"], (x) => typeof x === "string")) return false;
|
|
461
|
+
if (!optionalTypeOk(v["ready"], (x) => typeof x === "boolean")) return false;
|
|
462
|
+
if (!optionalTypeOk(v["previewToken"], (x) => typeof x === "string")) return false;
|
|
463
|
+
if (!optionalTypeOk(v["protocolVersion"], (x) => typeof x === "number")) return false;
|
|
464
464
|
return true;
|
|
465
465
|
}
|
|
466
|
+
function optionalTypeOk(value, check) {
|
|
467
|
+
if (value === void 0 || value === null) return true;
|
|
468
|
+
return check(value);
|
|
469
|
+
}
|
|
466
470
|
function isPlainObject(value) {
|
|
467
471
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
468
472
|
}
|