Spaces:
Paused
Paused
Download node_modules/@standard-schema/utils/dist/index.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 860 Bytes
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40standard-schema/utils/dist/index.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@standard-schema/utils/dist/index.js
-
curl -L -o index.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40standard-schema/utils/dist/index.js
860 Bytes
| // src/getDotPath/getDotPath.ts | |
| function getDotPath(issue) { | |
| if (issue.path?.length) { | |
| let dotPath = ""; | |
| for (const item of issue.path) { | |
| const key = typeof item === "object" ? item.key : item; | |
| if (typeof key === "string" || typeof key === "number") { | |
| if (dotPath) { | |
| dotPath += `.${key}`; | |
| } else { | |
| dotPath += key; | |
| } | |
| } else { | |
| return null; | |
| } | |
| } | |
| return dotPath; | |
| } | |
| return null; | |
| } | |
| // src/SchemaError/SchemaError.ts | |
| var SchemaError = class extends Error { | |
| /** | |
| * The schema issues. | |
| */ | |
| issues; | |
| /** | |
| * Creates a schema error with useful information. | |
| * | |
| * @param issues The schema issues. | |
| */ | |
| constructor(issues) { | |
| super(issues[0].message); | |
| this.name = "SchemaError"; | |
| this.issues = issues; | |
| } | |
| }; | |
| export { | |
| SchemaError, | |
| getDotPath | |
| }; | |