Skip to content

Commit

Permalink
Merge pull request #197 from sasjs/isLinux
Browse files Browse the repository at this point in the history
isLinux function
  • Loading branch information
allanbowe authored Jul 26, 2022
2 parents 24a4b58 + c18da38 commit 64f58ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { uuidv4, asyncForEach, uniqArray, isWindows } from './utils'
export { uuidv4, asyncForEach, uniqArray, isWindows, isLinux } from './utils'
export * from './fileTree'

export { urlOrigin } from './url'
Expand Down
8 changes: 7 additions & 1 deletion src/utils/utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { asyncForEach, uuidv4, isWindows } from './utils'
import { asyncForEach, uuidv4, isWindows, isLinux } from './utils'

describe('uuidv4', () => {
it('should generate 10000 uniq UUID', () => {
Expand Down Expand Up @@ -33,3 +33,9 @@ describe('isWindows', () => {
expect(isWindows()).toEqual(process.platform === 'win32')
})
})

describe('isLinux', () => {
it('should return if current operation system is linux', () => {
expect(isLinux()).toEqual(process.platform === 'linux')
})
})
2 changes: 2 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ export const uuidv4 = () =>
export const uniqArray = (data: any[]) => Array.from(new Set(data))

export const isWindows = () => process.platform === 'win32'

export const isLinux = () => process.platform === 'linux'

0 comments on commit 64f58ac

Please sign in to comment.