Skip to content

Commit

Permalink
feat(package-types): add package types enum
Browse files Browse the repository at this point in the history
  • Loading branch information
jaebradley committed Apr 23, 2018
1 parent 7c54e70 commit b66a750
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios from 'axios';
import qs from 'qs';

import buildSearchQuery from './buildSearchQuery';
import PACKAGE_TYPES from './packageTypes';

const NPMS_API_BASE_URL = 'https://api.npms.io/v2';

Expand All @@ -11,7 +12,7 @@ const search = ({
author = null,
maintainer = null,
exclude = {
packageTypes: [],
packageTypes: [PACKAGE_TYPES.DEPRECATED, PACKAGE_TYPES.INSECURE, PACKAGE_TYPES.UNSTABLE],
keywords: [],
},
include = {
Expand Down Expand Up @@ -66,4 +67,5 @@ const getSuggestions = ({
export {
search,
getSuggestions,
PACKAGE_TYPES,
};
7 changes: 7 additions & 0 deletions src/packageTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const PACKAGE_TYPES = Object.freeze({
DEPRECATED: 'deprecated',
UNSTABLE: 'unstable',
INSECURE: 'insecure',
});

export default PACKAGE_TYPES;

0 comments on commit b66a750

Please sign in to comment.