@polotno/schema 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/errors.d.ts CHANGED
@@ -3,8 +3,8 @@
3
3
  * `code` property (branch on it, like `err.code === 'ENOENT'`) and optional
4
4
  * JSON-serializable `details`. Messages are for humans and may change in any
5
5
  * release — never match on them. No classes, no instanceof — a code check
6
- * works on any copy of any package. See the error-codes table in the repo
7
- * root CLAUDE.md.
6
+ * works on any copy of any package. The rules live in the header of
7
+ * `@polotno/core`'s `src/errors.ts`, beside the canonical map.
8
8
  *
9
9
  * `@polotno/schema` is the layer *below* `@polotno/core`, so it can't import
10
10
  * core's shared error map — it defines its own. It only ever throws
package/lib/errors.js CHANGED
@@ -3,8 +3,8 @@
3
3
  * `code` property (branch on it, like `err.code === 'ENOENT'`) and optional
4
4
  * JSON-serializable `details`. Messages are for humans and may change in any
5
5
  * release — never match on them. No classes, no instanceof — a code check
6
- * works on any copy of any package. See the error-codes table in the repo
7
- * root CLAUDE.md.
6
+ * works on any copy of any package. The rules live in the header of
7
+ * `@polotno/core`'s `src/errors.ts`, beside the canonical map.
8
8
  *
9
9
  * `@polotno/schema` is the layer *below* `@polotno/core`, so it can't import
10
10
  * core's shared error map — it defines its own. It only ever throws
package/lib/migrate.js CHANGED
@@ -123,7 +123,7 @@ export function migrateDesign(json, options = {}) {
123
123
  // Guard BEFORE the round-trip: JSON.parse(JSON.stringify(undefined)) throws a
124
124
  // raw SyntaxError, and a circular object throws TypeError. Non-designs must
125
125
  // reach the zod pass untouched so they surface as a structured
126
- // DESIGN_INVALID, per the error contract in the root CLAUDE.md.
126
+ // DESIGN_INVALID, per the error contract in core's errors.ts header.
127
127
  if (!json || typeof json !== 'object')
128
128
  return json;
129
129
  const data = JSON.parse(JSON.stringify(json));