Skip to content

Commit

Permalink
chore(gatsby-core-utils): cpu-core-count to TS (#22048)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkov committed Mar 9, 2020
1 parent 5dafd4f commit 25bf063
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
* @type {import('../index').cpuCoreCount}
*/
const cpuCoreCount = ignoreEnvVar => {
import physicalCpuCount from "./physical-cpu-count"

const cpuCoreCount = (ignoreEnvVar: boolean): number => {
try {
let coreCount = require(`./physical-cpu-count`) || 1
let coreCount = physicalCpuCount() || 1

if (ignoreEnvVar) {
// Return the physical CPU count,
Expand Down Expand Up @@ -48,4 +47,4 @@ const cpuCoreCount = ignoreEnvVar => {
}
}

module.exports = cpuCoreCount
export default cpuCoreCount

0 comments on commit 25bf063

Please sign in to comment.