Skip to content

Commit

Permalink
Re-use normal enum and stop using "import *"
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed Aug 11, 2019
1 parent 5519edb commit 5c1c8db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { object } from 'convenient-typescript-utilities'
import * as types from '../../../types'
import { Type, TarballUrl, GitUrl, LocalUrl } from '../../../types'
const { values } = object

export const TYPE = values(types.Type)
export const TYPE = values(Type)

export namespace TARBALL_URL {
export const PROTOCOL = values(types.TarballUrl.Protocol)
export const EXTENSION = values(types.TarballUrl.Extension)
export const PROTOCOL = values(TarballUrl.Protocol)
export const EXTENSION = values(TarballUrl.Extension)
}

export namespace GIT_URL {
export const PROTOCOL = values(types.GitUrl.Protocol)
export const PROTOCOL = values(GitUrl.Protocol)
}

export namespace LOCAL_URL {
export const PROTOCOL = values(types.LocalUrl.Protocol)
export const PROTOCOL = values(LocalUrl.Protocol)
}
10 changes: 5 additions & 5 deletions packages/typescript/parse-dependency-range/lib/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export namespace Struct {
}
}

export const enum Type {
export enum Type {
Semver = 'semver',
Tarball = 'tarball',
Git = 'git',
Expand All @@ -71,14 +71,14 @@ export interface TarballUrl extends Url {
}

export namespace TarballUrl {
export const enum Protocol {
export enum Protocol {
FTP = 'ftp:',
FTPS = 'ftps:',
HTTP = 'http:',
HTTPS = 'https:'
}

export const enum Extension {
export enum Extension {
Tgz = '.tgz',
TarGz = '.tar.gz',
TarGzip = '.tar.gzip'
Expand All @@ -90,7 +90,7 @@ export interface GitUrl extends Url {
}

export namespace GitUrl {
export const enum Protocol {
export enum Protocol {
Git = 'git:',
SSH = 'git+ssh:',
HTTP = 'git+http:',
Expand All @@ -100,7 +100,7 @@ export namespace GitUrl {
}

export namespace LocalUrl {
export const enum Protocol {
export enum Protocol {
File = 'file:',
Link = 'link:'
}
Expand Down

0 comments on commit 5c1c8db

Please sign in to comment.