Skip to content

Commit d418ef3

Browse files
committed
Fix nullability warning
1 parent 0a6fb00 commit d418ef3

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

generator/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ function isNullableFromDescription(
901901
parent: string,
902902
): boolean {
903903
const nullableRegex =
904-
/(specify|passing|returns?|or|be|possibly|otherwise|else|writing|set(ting)?(( this)?|( the name)?)( to)?) [`']?nil[`']?|`?nil`? (if|when|otherwise|erases|is returned)/i
904+
/(specify|passing|returns?|or|be|possibly|otherwise|else|writing|set(ting)?(( this)?|( the name)?)( to)?|read as) [`']?nil[`']?|`?nil`? (if|when|otherwise|erases|is returned)/i
905905
const nullable = member.description.match(nullableRegex)
906906
if (nullable) {
907907
if (!member.description.match(/[`' ]nil/i)) {

runtime/generated/classes.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23263,7 +23263,7 @@ declare module "factorio:runtime" {
2326323263
* @param index The index of the mapper to read.
2326423264
* @see {@link https://lua-api.factorio.com/2.0.54/classes/LuaRecord.html#get_mapper Online documentation}
2326523265
*/
23266-
get_mapper(index: uint, type: "from" | "to"): UpgradeMapperSource | UpgradeMapperDestination
23266+
get_mapper(index: uint, type: "from" | "to"): UpgradeMapperSource | UpgradeMapperDestination | nil
2326723267
/**
2326823268
* Sets the module filter at the given index for this upgrade item.
2326923269
*
@@ -23887,7 +23887,7 @@ declare module "factorio:runtime" {
2388723887
* @param index The index of the mapper to read.
2388823888
* @see {@link https://lua-api.factorio.com/2.0.54/classes/LuaRecord.html#get_mapper Online documentation}
2388923889
*/
23890-
get_mapper(index: uint, type: "from" | "to"): UpgradeMapperSource | UpgradeMapperDestination
23890+
get_mapper(index: uint, type: "from" | "to"): UpgradeMapperSource | UpgradeMapperDestination | nil
2389123891
/**
2389223892
* Sets the module filter at the given index for this upgrade item.
2389323893
*

0 commit comments

Comments
 (0)