{"id":19895352,"url":"https://github.com/razshare/svelte-unsafe","last_synced_at":"2025-10-04T02:12:28.087Z","repository":{"id":230812564,"uuid":"780247390","full_name":"razshare/svelte-unsafe","owner":"razshare","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-07T01:08:33.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T16:46:30.445Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/razshare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-01T04:05:52.000Z","updated_at":"2024-04-06T16:44:27.000Z","dependencies_parsed_at":"2024-04-01T05:26:07.772Z","dependency_job_id":"b92d4a00-9b05-4712-a99c-992dc8c4634f","html_url":"https://github.com/razshare/svelte-unsafe","commit_stats":null,"previous_names":["tncrazvan/sveltekit-unsafe","razshare/svelte-unsafe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/razshare/svelte-unsafe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fsvelte-unsafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fsvelte-unsafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fsvelte-unsafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fsvelte-unsafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razshare","download_url":"https://codeload.github.com/razshare/svelte-unsafe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razshare%2Fsvelte-unsafe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278254466,"owners_count":25956604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T18:36:28.557Z","updated_at":"2025-10-04T02:12:28.069Z","avatar_url":"https://github.com/razshare.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Svelte Unsafe\n\nManage errors through conditionals.\n\nInstall with\n\n```sh\nnpm i -D svelte-unsafe\n```\n\nUse `ok()` to create a successful result\n\n```js\nimport { ok } from 'svelte-unsafe'\n/**\n * @returns {import(\"./types\").Unsafe\u003cstring\u003e}\n */\nfunction greeting(){\n  return ok(\"hello world\")\n}\n```\n\nOr `error()` to create errors\n\n```js\n/**\n * @param {string} name\n * @returns {import(\"./types\").Unsafe\u003cstring\u003e}\n */\nfunction greet(name){\n  if(name.length \u003c 2){\n    return error('Name must be at least 2 characters.')\n  }\n  return ok('hello world')\n}\n```\n\nThen manage your errors through conditionals\n\n```js\nconst greetAttempt = greet('A')\nif(greetAttempt.error){\n  console.error(greetAttempt.error)\n} else {\n  console.log(greetAttempt.value)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fsvelte-unsafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazshare%2Fsvelte-unsafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazshare%2Fsvelte-unsafe/lists"}