0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2024-12-30 22:34:10 -05:00

fix: missing properties for default matcher #981 (#982)

This commit is contained in:
Juan Picado @jotadeveloper 2018-09-05 22:10:27 +02:00 committed by GitHub
parent 70675cd523
commit 3ca20d0c4e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -107,7 +107,7 @@ export function normalisePackageAccess(packages: PackageList): PackageList {
const normalizedPkgs: PackageList = {...packages};
// add a default rule for all packages to make writing plugins easier
if (_.isNil(normalizedPkgs['**'])) {
normalizedPkgs['**'] = {};
normalizedPkgs['**'] = {access: [], publish: []};
}
for (let pkg in packages) {

View file

@ -1,6 +1,7 @@
// @flow
import path from 'path';
import _ from 'lodash';
import {spliceURL} from '../../../src/utils/string';
import {parseConfigFile} from '../../../src/lib/utils';
import {
@ -125,12 +126,14 @@ describe('Config Utilities', () => {
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
expect(scoped).toBeUndefined();
// ** should be added by default
// ** should be added by default **
const all = access[`${PACKAGE_ACCESS.ALL}`];
expect(all).toBeDefined();
expect(all.access).toBeUndefined();
expect(all.publish).toBeUndefined();
expect(all.access).toBeDefined();
expect(_.isArray(all.access)).toBeTruthy();
expect(all.publish).toBeDefined();
expect(_.isArray(all.publish)).toBeTruthy();
});
});