mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-30 22:34:10 -05:00
parent
70675cd523
commit
3ca20d0c4e
2 changed files with 7 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue