Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit fab6f34

Browse files
authored
Change float/doubles -> number (#23)
1 parent 5cd860f commit fab6f34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

firebase_rules_generator/generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ bool RulesGenerator::GenerateField(const protobuf::FieldDescriptor *field,
367367
case protobuf::FieldDescriptor::TYPE_DOUBLE:
368368
case protobuf::FieldDescriptor::TYPE_FLOAT:
369369
// TODO(rockwood): Do we need anything special for "Nan" or "Infinity"?
370-
vars.insert({"type", "float"});
370+
vars.insert({"type", "number"});
371371
printer.Print(vars, "resource.$name$ is $type$");
372372
break;
373373
case protobuf::FieldDescriptor::TYPE_INT64:

testdata/test4.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ function isExampleMessage(resource) {
88
((!resource.keys().hasAny(['bar'])) || (resource.bar is map)) &&
99
((!resource.keys().hasAny(['bippity'])) || (resource.bippity is int && resource.bippity >= -2147483648 && resource.bippity <= 2147483647)) &&
1010
((!resource.keys().hasAny(['boppity'])) || (resource.boppity is bool)) &&
11-
((!resource.keys().hasAny(['boo'])) || (resource.boo is float));
11+
((!resource.keys().hasAny(['boo'])) || (resource.boo is number));
1212
}
1313
// @@END_GENERATED_FUNCTIONS@@

0 commit comments

Comments
 (0)