(p: string | number | symbol)
| 149 | } |
| 150 | |
| 151 | function propertyToNumber(p: string | number | symbol) { |
| 152 | if (typeof p === "string" && p.trim().length) { |
| 153 | const asNum = Number(p); |
| 154 | // https://stackoverflow.com/questions/10834796/validate-that-a-string-is-a-positive-integer |
| 155 | if (Number.isInteger(asNum)) { |
| 156 | return asNum; |
| 157 | } |
| 158 | } |
| 159 | return p; |
| 160 | } |
| 161 | |
| 162 | export function crdtArray<T>(initializer: T[], arr = new Y.Array<T>()) { |
| 163 | if (arr[$reactive]) { |
no outgoing calls
no test coverage detected