{"id":"chipioindustries/error-on-nil-index","name":"error-on-nil-index","scope":"chipioindustries","platform":"roblox","description":"Utility function for throwing errors when a nonexistent key is indexed in a table.","version":"1.2.0","latest":"1.2.0","versions":["1.0.1","1.1.0","1.2.0"],"license":"AGPL-3.0","licenseRating":"unsafe","licenseCaveats":["Strongest copyleft: even network use counts as distribution, so running this in a live game plausibly requires releasing your game's entire source under AGPL-3.0. Not recommended for closed-source projects.","License identified from the packaged LICENSE file; the manifest declared none."],"licenseVerified":true,"dependencies":{"osyrisrblx/t":{"version":"^3.0.0","alias":"t"}},"integrity":"9041bcfb97881c7c5b8c6b7534150d880a9a50c482d4f06e0c2084a8c38df883","likes":0,"downloads":0,"install":"forest install chipioindustries/error-on-nil-index","url":"https://forest.dev/p/roblox/chipioindustries/error-on-nil-index","files":"https://api.forest.dev/ai/package/roblox/chipioindustries/error-on-nil-index/files","readme":"# error-on-nil-index\n\nThrows an error when a nonexistent table index is attempted to be located. Useful for tables of constants and settings. Returns the exact same table passed in.\n\n```\ntable errorOnNilIndex(table targetTable, bool shouldApplyToEntireTree)\n```\n\n```lua\nlocal errorOnNilIndex = require(script.Parent.errorOnNilIndex)\n\nlocal myTable = {\n\tSetting1 = \"Hi\";\n\tSetting2 = \"Hello!\";\n\tRandomList = {\n\t\ttest = \"hi\";\n\t};\n}\n\nerrorOnNilIndex(myTable)\n\nprint(myTable.RandomList.test2) -- does not throw an error\nprint(myTable.Setting3) -- throws an error\n\nlocal myTable2 = {\n\tSetting1 = \"Hi\";\n\tRandomList = {\n\t\ttest = \"hi\";\n\t};\n}\n\nerrorOnNilIndex(myTable2, true)\n\nprint(myTable.RandomList.test2) -- throws an error\n```\n","readmeTruncated":false}