function populateDeps( pkgJSON, deps, devDeps, mainJSON, useGitHub ) {
	var mainVersion;
	var out;
	var dep;
	var i;

	out = copy( pkgJSON );
	for ( i = 0; i < deps.length; i++ ) {
		dep = deps[ i ];
		if ( startsWith( dep, '@stdlib' ) ) {
			if (
				!contains( dep, '_tools' ) &&
				( !contains( dep, 'plot' ) || dep === '@stdlib/plot' )
			) {
				if ( useGitHub ) {
					out.dependencies[ dep ] = 'github:stdlib-js/' + replace( dep, '@stdlib/', '' ) + '#main';
				} else {
					out.dependencies[ dep ] = memoizedNPMversionForDeps( dep );
				}
			}
		} else {
			out.dependencies[ dep ] = mainJSON.dependencies[ dep ];
		}
	}
	for ( i = 0; i < devDeps.length; i++ ) {
		dep = devDeps[ i ];
		if (
			!contains( deps, dep )
		) {
			if (
				startsWith( dep, '@stdlib' )
			) {
				if (
					!contains( dep, '_tools' ) &&
					( !contains( dep, 'plot' ) || dep === '@stdlib/plot' )
				) {
					if ( useGitHub ) {
						out.devDependencies[ dep ] = 'github:stdlib-js/' + replace( dep, '@stdlib/', '' ) + '#main';
					} else {
						out.devDependencies[ dep ] = memoizedNPMversionForDevDeps( dep );
					}
				}
			} else {
				mainVersion = mainJSON.devDependencies[ dep ];
				out.devDependencies[ dep ] = mainVersion;
			}
		}
	}
	return out;
}
Populates the dependencies and devDependencies fields of a package.json object.

@private
@param {Object} pkgJSON - package.json object
@param {Array} deps - dependencies
@param {Array} devDeps - devDependencies
@param {Object} mainJSON - main repo package.json object
@param {boolean} useGitHub - boolean indicating whether to use GitHub URLs for dependencies
@returns {Object} package.json object