( id: string, limit: number = FLATTEN_ID_MAX_FILE_LENGTH, )
| 89 | const FLATTEN_ID_MAX_FILE_LENGTH = 170 |
| 90 | |
| 91 | const limitFlattenIdLength = ( |
| 92 | id: string, |
| 93 | limit: number = FLATTEN_ID_MAX_FILE_LENGTH, |
| 94 | ): string => { |
| 95 | if (id.length <= limit) { |
| 96 | return id |
| 97 | } |
| 98 | return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + '_' + getHash(id) |
| 99 | } |
| 100 | |
| 101 | export const normalizeId = (id: string): string => |
| 102 | id.replace(replaceNestedIdRE, ' > ') |