Skip to content

Commit

Permalink
feat(types): Engine
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
  • Loading branch information
unicornware committed Nov 30, 2022
1 parent 46a3251 commit 42e1979
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/types/__tests__/engine.spec-d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* @file Unit Tests - Engine
* @module pkg-types/types/tests/Engine
*/

import type TestSubject from '../engine'

describe('unit:types/Engine', () => {
it('should allow "node"', () => {
assertType<TestSubject>('node')
})

it('should allow "npm"', () => {
assertType<TestSubject>('npm')
})

it('should allow "yarn"', () => {
assertType<TestSubject>('yarn')
})
})
15 changes: 15 additions & 0 deletions src/types/engine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* @file Type Definitions - Engine
* @module pkg-types/types/Engine
*/

import type { LiteralUnion } from '@flex-development/tutils'

/**
* Engines a package runs on.
*
* @see https://docs.npmjs.com/cli/configuring-npm/package-json#engines
*/
type Engine = LiteralUnion<'node' | 'npm' | 'yarn', string>

export type { Engine as default }
1 change: 1 addition & 0 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

export type { default as Access } from './access'
export type { default as CPU } from './cpu'
export type { default as Engine } from './engine'
export type { default as HoistingLimits } from './hoisiting-limits'
export type { default as Type } from './type'
export type { default as TypesVersions } from './types-versions'

0 comments on commit 42e1979

Please sign in to comment.