{"id":16645579,"url":"https://github.com/hishamhm/safer","last_synced_at":"2025-10-30T12:31:52.752Z","repository":{"id":143239332,"uuid":"54422758","full_name":"hishamhm/safer","owner":"hishamhm","description":"Paranoid Lua programming","archived":false,"fork":false,"pushed_at":"2024-03-04T14:44:46.000Z","size":4,"stargazers_count":14,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-02T08:42:05.224Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","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/hishamhm.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}},"created_at":"2016-03-21T21:07:00.000Z","updated_at":"2024-03-04T14:44:51.000Z","dependencies_parsed_at":"2023-06-19T05:56:16.321Z","dependency_job_id":null,"html_url":"https://github.com/hishamhm/safer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hishamhm%2Fsafer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hishamhm%2Fsafer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hishamhm%2Fsafer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hishamhm%2Fsafer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hishamhm","download_url":"https://codeload.github.com/hishamhm/safer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238968463,"owners_count":19560586,"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","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-10-12T08:24:21.430Z","updated_at":"2025-10-30T12:31:52.403Z","avatar_url":"https://github.com/hishamhm.png","language":"Lua","funding_links":[],"categories":["Resources"],"sub_categories":["Programming Paradigms"],"readme":"\n# Safer - Paranoid Lua programming\n\nTaking defensive programming to the next level. Use this module\nto avoid unexpected globals creeping up in your code, and stopping\nsub-modules from fiddling with fields of tables as you pass them\naround.\n\n## API\n\n#### `safer.globals([exception_globals], [exception_nils])`\n\nNo new globals after this point.\n\n`exception_globals` is an optional set (keys are strings, values are `true`) specifying names\nto be exceptionally accepted as new globals. Use this in case you have to declare a legacy\nmodule that declares a global, for example. A few legacy modules are already handled by default.\n\n`exception_nils` is an optional set (keys are strings, values are `true`) specifying names\nto be exceptionally accepted to be accessed as nonexisting globals. Use this in case code\ndoes feature-testing based on checking the presence of globals. A few common feature-test\nnils such as `jit` and `unpack` are already handled by default.\n\n#### `t = safer.table(t)`\n\nBlock creation of new fields in this table.\n\nNote that this is implemented creating a proxy table, so:\n\n* Equality tests will fail: `safer.table(t) ~= t`\n* If anyone still has a reference to this table prior\n  to creating the safer version, they can still mess\n  with the unsafe table and affect the safe one.\n\n#### `t = safer.readonly(t)`\n\nMake table read-only: block creation of new fields in this table\nand setting new values to existing fields.\n\nNote that this is implemented creating a proxy table, so:\n\n* Equality tests will fail: `safer.readonly(t) ~= t`\n* If anyone still has a reference to this table prior\n  to creating the safer version, they can still mess\n  with the unsafe table and affect the safe one.\n\nAbout\n-----\n\nThis module was created by [Hisham Muhammad](http://hisham.hm/) - [@hisham_hm](http://twitter.com/hisham_hm)\n\nLicensed under the terms of the MIT License, the same as Lua.\n\nDuring its genesis, this module was called \"safe\", but I renamed it\nto \"safer\" to remind us that we are never fully safe. ;)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhishamhm%2Fsafer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhishamhm%2Fsafer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhishamhm%2Fsafer/lists"}