FirebaseExtended / bolt

Bolt Compiler (Firebase Security and Modeling)
Apache License 2.0
896 stars 108 forks source link

Simplify InitialTimestamp() documentation #240

Open lukepighetti opened 5 years ago

lukepighetti commented 5 years ago
type InitialTimestamp extends Number {
  validate() { initial(this, now) }
}

// Returns true if the value is intialized to init, or retains it's prior
// value, otherwise.
initial(value, init) { value == (prior(value) == null ? init : prior(value)) }

can be

type InitialTimestamp extends Number {
  validate() { prior(value) == null ? this == now : this == prior(this) }
}