* Validate the binding key format. Please note that `#` is reserved. * Returns a string representation of the binding key. * * @param key - Binding key, such as `a`, `a.b`, `a:b`, or `a/b`
(key: BindingAddress<T>)
| 69 | * @param key - Binding key, such as `a`, `a.b`, `a:b`, or `a/b` |
| 70 | */ |
| 71 | static validate<T>(key: BindingAddress<T>): string { |
| 72 | if (!key) throw new Error('Binding key must be provided.'); |
| 73 | key = key.toString(); |
| 74 | if (key.includes(BindingKey.PROPERTY_SEPARATOR)) { |
| 75 | throw new Error( |
| 76 | `Binding key ${key} cannot contain` + |
| 77 | ` '${BindingKey.PROPERTY_SEPARATOR}'.`, |
| 78 | ); |
| 79 | } |
| 80 | return key; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Parse a string containing both the binding key and the path to the deeply |