Forgot to copy-pasta a helper function from bluebird