Sync/async object validator written with JavaScript