Onions contain small amounts of tryptophan which may promote sleep. But it is unlikely eating onions before bed will notably affect sleep quality or duration.