@milkdown/exception
Advanced tools
Comparing version 4.7.1 to 4.8.0
@@ -10,3 +10,15 @@ export const docTypeError = (type) => new Error(`Doc type error, unsupported type: ${JSON.stringify(type)}`); | ||
} | ||
return `${msg}, ${JSON.stringify(arg)}`; | ||
const serialize = (x) => { | ||
if (Array.isArray(x)) { | ||
return x.map((y) => serialize(y)).join(', '); | ||
} | ||
if (x.toJSON) { | ||
return JSON.stringify(x.toJSON()); | ||
} | ||
if (x.spec) { | ||
return JSON.stringify(x.spec); | ||
} | ||
return x.toString(); | ||
}; | ||
return `${msg}, ${serialize(arg)}`; | ||
}, 'Create prosemirror node from remark failed in parser'); | ||
@@ -13,0 +25,0 @@ return new Error(message); |
{ | ||
"name": "@milkdown/exception", | ||
"version": "4.7.1", | ||
"main": "lib/index.js", | ||
"module": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"scripts": { | ||
"start": "vite", | ||
"watch": "tsc -w", | ||
"test": "jest", | ||
"tsc": "tsc --noEmit", | ||
"build": "tsc" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"peerDependencies": { | ||
"@milkdown/core": "*" | ||
}, | ||
"dependencies": { | ||
"@types/lodash-es": "^4.17.4", | ||
"lodash-es": "^4.17.21", | ||
"tslib": "^2.2.0" | ||
} | ||
} | ||
"name": "@milkdown/exception", | ||
"version": "4.8.0", | ||
"main": "lib/index.js", | ||
"module": "lib/index.js", | ||
"types": "lib/index.d.ts", | ||
"files": [ | ||
"lib" | ||
], | ||
"peerDependencies": { | ||
"@milkdown/core": "*" | ||
}, | ||
"dependencies": { | ||
"@types/lodash-es": "^4.17.4", | ||
"lodash-es": "^4.17.21", | ||
"tslib": "^2.2.0" | ||
}, | ||
"scripts": { | ||
"start": "vite", | ||
"watch": "tsc -w", | ||
"test": "jest", | ||
"tsc": "tsc --noEmit", | ||
"build": "tsc" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6300
40
7