Skip to content

Commit 80aa455

Browse files
authored
fix(utils): Wrap uuid.v4 to disallow passing extra arguments and prevent dependency on uuid package types (#509)
Summary: Reverts part of a prior change in the utils package for two reasons: - uuid.v4 has different behavior when passed arguments. We have no use for this behavior, thus it is better to ensure no arguments are accidentally passed. - We don't want our type definitions to be dependent on uuid's type definitions Test plan: Existing tests
1 parent 0e85707 commit 80aa455

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/utils/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
export { v4 as generateUUID } from 'uuid'
16+
import { v4 } from 'uuid';
17+
18+
export function generateUUID(): string {
19+
return v4()
20+
}
1721

1822
export type Omit<T, K> = Pick<T, Exclude<keyof T, K>>
1923

0 commit comments

Comments
 (0)