1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Plugins: Fixes #4285: Allow API paths that contain 4 elements

This commit is contained in:
Laurent Cozic
2021-01-04 16:17:06 +00:00
parent ec7cccf573
commit 794fb6a122

View File

@ -54,7 +54,7 @@ export default class JoplinData {
if (!Array.isArray(path)) throw new Error(`Path must be an array: ${JSON.stringify(path)}`);
if (path.length < 1) throw new Error(`Path must have at least one element: ${JSON.stringify(path)}`);
if (path.length > 3) throw new Error(`Path must have no more than 3 elements: ${JSON.stringify(path)}`);
if (path.length > 4) throw new Error(`Path must have no more than 4 elements: ${JSON.stringify(path)}`);
for (const p of path) {
if (!this.pathSegmentRegex_.test(p)) throw new Error(`Path segments must only contain lowercase letters and digits: ${JSON.stringify(path)}`);