(name, namespace, taken)
| 776 | // already scopes it. Its wire key is untouched. Keeps the namespace (`mozPermanent`) only if |
| 777 | // dropping it would collide with a shared field on the same record. |
| 778 | function vendorFieldName(name, namespace, taken) { |
| 779 | const stripped = name.replace(`${namespace}:`, '') |
| 780 | return taken.has(stripped) ? `${namespace}${pascalCase(stripped)}` : stripped |
| 781 | } |
| 782 | |
| 783 | function pascalCase(word) { |
| 784 | return word.charAt(0).toUpperCase() + word.slice(1) |
no test coverage detected