mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-27 22:59:51 -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};
|
const normalizedPkgs: PackageList = {...packages};
|
||||||
// add a default rule for all packages to make writing plugins easier
|
// add a default rule for all packages to make writing plugins easier
|
||||||
if (_.isNil(normalizedPkgs['**'])) {
|
if (_.isNil(normalizedPkgs['**'])) {
|
||||||
normalizedPkgs['**'] = {};
|
normalizedPkgs['**'] = {access: [], publish: []};
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let pkg in packages) {
|
for (let pkg in packages) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import _ from 'lodash';
|
||||||
import {spliceURL} from '../../../src/utils/string';
|
import {spliceURL} from '../../../src/utils/string';
|
||||||
import {parseConfigFile} from '../../../src/lib/utils';
|
import {parseConfigFile} from '../../../src/lib/utils';
|
||||||
import {
|
import {
|
||||||
|
@ -125,12 +126,14 @@ describe('Config Utilities', () => {
|
||||||
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
|
const scoped = access[`${PACKAGE_ACCESS.SCOPE}`];
|
||||||
expect(scoped).toBeUndefined();
|
expect(scoped).toBeUndefined();
|
||||||
|
|
||||||
// ** should be added by default
|
// ** should be added by default **
|
||||||
const all = access[`${PACKAGE_ACCESS.ALL}`];
|
const all = access[`${PACKAGE_ACCESS.ALL}`];
|
||||||
expect(all).toBeDefined();
|
expect(all).toBeDefined();
|
||||||
|
|
||||||
expect(all.access).toBeUndefined();
|
expect(all.access).toBeDefined();
|
||||||
expect(all.publish).toBeUndefined();
|
expect(_.isArray(all.access)).toBeTruthy();
|
||||||
|
expect(all.publish).toBeDefined();
|
||||||
|
expect(_.isArray(all.publish)).toBeTruthy();
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue