(id)
| 40 | } |
| 41 | |
| 42 | export function decodeVectorId(id) { |
| 43 | if (!id || typeof id !== 'string') return null; |
| 44 | const parts = id.split('::'); |
| 45 | if (parts[0] !== ID_VERSION) return null; |
| 46 | |
| 47 | return { |
| 48 | version: parts[0], |
| 49 | namespace: decodePart(parts[1]), |
| 50 | type: decodePart(parts[2]), |
| 51 | entityId: decodePart(parts[3]), |
| 52 | chunkId: decodePart(parts[4]), |
| 53 | field: decodePart(parts[5]), |
| 54 | variant: decodePart(parts[6]) |
| 55 | }; |
| 56 | } |
| 57 | |
| 58 | export const VECTOR_ID_VERSION = ID_VERSION; |
no test coverage detected