Skip to content

Commit 42e1979

Browse files
committed
feat(types): Engine
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
1 parent 46a3251 commit 42e1979

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @file Unit Tests - Engine
3+
* @module pkg-types/types/tests/Engine
4+
*/
5+
6+
import type TestSubject from '../engine'
7+
8+
describe('unit:types/Engine', () => {
9+
it('should allow "node"', () => {
10+
assertType<TestSubject>('node')
11+
})
12+
13+
it('should allow "npm"', () => {
14+
assertType<TestSubject>('npm')
15+
})
16+
17+
it('should allow "yarn"', () => {
18+
assertType<TestSubject>('yarn')
19+
})
20+
})

src/types/engine.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @file Type Definitions - Engine
3+
* @module pkg-types/types/Engine
4+
*/
5+
6+
import type { LiteralUnion } from '@flex-development/tutils'
7+
8+
/**
9+
* Engines a package runs on.
10+
*
11+
* @see https://docs.npmjs.com/cli/configuring-npm/package-json#engines
12+
*/
13+
type Engine = LiteralUnion<'node' | 'npm' | 'yarn', string>
14+
15+
export type { Engine as default }

src/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
export type { default as Access } from './access'
77
export type { default as CPU } from './cpu'
8+
export type { default as Engine } from './engine'
89
export type { default as HoistingLimits } from './hoisiting-limits'
910
export type { default as Type } from './type'
1011
export type { default as TypesVersions } from './types-versions'

0 commit comments

Comments
 (0)