Skip to content

Commit bcf4870

Browse files
Merge branch 'master' into remove-lodash-typeof-checks
2 parents 3a67e64 + 0901a76 commit bcf4870

31 files changed

+178
-253
lines changed

package-lock.json

Lines changed: 82 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,38 +55,38 @@
5555
"@types/express": "4.17.13",
5656
"@types/fs-extra": "9.0.13",
5757
"@types/livereload": "0.9.1",
58-
"@types/lodash": "4.14.175",
58+
"@types/lodash": "4.14.176",
5959
"@types/morgan": "1.9.3",
6060
"@types/multer": "1.4.7",
61-
"@types/node": "16.10.3",
61+
"@types/node": "16.11.3",
6262
"@types/parse-author": "2.0.1",
6363
"@types/read": "0.0.29",
6464
"@types/response-time": "2.3.5",
65-
"@types/semver": "7.3.8",
65+
"@types/semver": "7.3.9",
6666
"@types/targz": "1.0.1",
67-
"@types/yargs": "17.0.3",
68-
"@typescript-eslint/eslint-plugin": "5.0.0",
69-
"@typescript-eslint/parser": "5.0.0",
67+
"@types/yargs": "17.0.4",
68+
"@typescript-eslint/eslint-plugin": "5.1.0",
69+
"@typescript-eslint/parser": "5.1.0",
7070
"chai": "4.3.4",
7171
"chalk": "4.1.2",
72-
"eslint": "8.0.0",
72+
"eslint": "8.0.1",
7373
"eslint-config-prettier": "8.3.0",
7474
"eslint-plugin-prettier": "4.0.0",
7575
"glob": "7.2.0",
76-
"husky": "7.0.2",
76+
"husky": "7.0.4",
7777
"injectr": "0.5.1",
7878
"lint-staged": "11.2.3",
7979
"minimist": "1.2.5",
80-
"mocha": "9.1.2",
80+
"mocha": "9.1.3",
8181
"node-emoji": "1.11.0",
8282
"prettier": "2.4.1",
83-
"rimraf": "^3.0.2",
83+
"rimraf": "3.0.2",
8484
"semver-sort": "0.0.4",
85-
"simple-git": "2.46.0",
85+
"simple-git": "2.47.0",
8686
"sinon": "11.1.2",
87-
"ts-node": "10.3.0",
88-
"type-fest": "^2.5.0",
89-
"typescript": "4.4.3"
87+
"ts-node": "10.3.1",
88+
"type-fest": "2.5.1",
89+
"typescript": "4.4.4"
9090
},
9191
"dependencies": {
9292
"accept-language-parser": "1.5.0",
@@ -108,7 +108,7 @@
108108
"morgan": "1.10.0",
109109
"multer": "1.4.3",
110110
"nice-cache": "0.0.5",
111-
"oc-client": "4.0.0",
111+
"oc-client": "4.0.1",
112112
"oc-client-browser": "1.5.4",
113113
"oc-empty-response-handler": "1.0.2",
114114
"oc-get-unix-utc-timestamp": "1.0.5",

src/cli/domain/get-mocked-plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const isMockValid = (
3737
};
3838

3939
const defaultRegister = (
40-
options: unknown,
41-
dependencies: unknown,
40+
_options: unknown,
41+
_dependencies: unknown,
4242
next: () => void
4343
) => {
4444
next();

src/cli/domain/mock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function mock() {
88
params: { targetType: string; targetValue: string; targetName: string },
99
callback: (err: Error) => void
1010
): void {
11-
fs.readJson(settings.configFile.src, (err, localConfig) => {
11+
fs.readJson(settings.configFile.src, (_err, localConfig) => {
1212
localConfig = localConfig || {};
1313

1414
const mockType = params.targetType + 's';

src/cli/facade/publish.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ const publish =
4949

5050
logger.warn(strings.messages.cli.ENTER_USERNAME);
5151

52-
read({}, (err, username) => {
52+
read({}, (_err, username) => {
5353
logger.warn(strings.messages.cli.ENTER_PASSWORD);
5454

55-
read({ silent: true }, (err, password) => {
55+
read({ silent: true }, (_err, password) => {
5656
cb(null, { username, password });
5757
});
5858
});
@@ -110,7 +110,7 @@ const publish =
110110

111111
logger.warn(strings.messages.cli.REGISTRY_CREDENTIALS_REQUIRED);
112112

113-
return getCredentials((err, credentials) => {
113+
return getCredentials((_err, credentials) => {
114114
putComponentToRegistry(_.extend(options, credentials), cb);
115115
});
116116
} else if ((err as any).code === 'cli_version_not_valid') {

src/cli/facade/registry-ls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Logger } from '../logger';
44

55
const registryLs =
66
({ registry, logger }: { logger: Logger; registry: RegistryCli }) =>
7-
(opts: unknown, callback: Callback<string[], string>): void => {
7+
(_opts: unknown, callback: Callback<string[], string>): void => {
88
registry.get((err, registries) => {
99
if (err) {
1010
logger.err(strings.errors.generic(err));

src/cli/facade/registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const registry =
22
() =>
3-
(opts: unknown, callback: Callback<'ok'>): void => {
3+
(_opts: unknown, callback: Callback<'ok'>): void => {
44
callback(null, 'ok');
55
};
66

src/registry/app-start.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default function appStart(
2828

2929
logger.log(
3030
colors.yellow(
31-
`Connecting to library: ${options.storage.options.bucket}/${options.storage.options.componentsDir}`
31+
`Connecting to library: ${options.storage.options['bucket']}/${options.storage.options.componentsDir}`
3232
)
3333
);
3434

src/registry/domain/options-sanitiser.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function optionsSanitiser(input: Input): Config {
1313
const options = _.clone(input);
1414

1515
if (!options.publishAuth) {
16-
(options as Config).beforePublish = (req, res, next) => next();
16+
(options as Config).beforePublish = (_req, _res, next) => next();
1717
} else {
1818
(options as Config).beforePublish = auth.middleware(options.publishAuth);
1919
}
@@ -68,7 +68,7 @@ export default function optionsSanitiser(input: Input): Config {
6868
options.customHeadersToSkipOnWeakVersion || []
6969
).map(s => s.toLowerCase());
7070

71-
options.port = Number(process.env.PORT || options.port);
71+
options.port = Number(process.env['PORT'] || options.port);
7272
options.timeout = options.timeout || 1000 * 60 * 2;
7373
options.keepAliveTimeout =
7474
options.keepAliveTimeout || DEFAULT_NODE_KEEPALIVE_MS;
@@ -85,22 +85,22 @@ export default function optionsSanitiser(input: Input): Config {
8585
}
8686

8787
if (options.refreshInterval && options.storage) {
88-
options.storage.options.refreshInterval = options.refreshInterval;
88+
options.storage.options['refreshInterval'] = options.refreshInterval;
8989
}
9090

9191
if (options.verbosity && options.storage) {
92-
options.storage.options.verbosity = options.verbosity;
92+
options.storage.options['verbosity'] = options.verbosity;
9393
}
9494

9595
if (
9696
options.storage &&
9797
options.storage.options &&
98-
options.storage.options.path
98+
options.storage.options['path']
9999
) {
100-
options.storage.options.path =
101-
options.storage.options.path.indexOf('http') === 0
102-
? options.storage.options.path
103-
: `https:${options.storage.options.path}`;
100+
options.storage.options['path'] =
101+
options.storage.options['path'].indexOf('http') === 0
102+
? options.storage.options['path']
103+
: `https:${options.storage.options['path']}`;
104104
}
105105

106106
if (!options.env) {

src/registry/domain/repository.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export default function repository(conf: Config): Repository {
223223
getComponentPath(componentName: string, componentVersion: string) {
224224
const prefix = conf.local
225225
? conf.baseUrl
226-
: `${options!.path}${options!.componentsDir}/`;
226+
: `${options!['path']}${options!.componentsDir}/`;
227227
return `${prefix}${componentName}/${componentVersion}/`;
228228
},
229229
getComponents(callback: Callback<string[]>) {
@@ -282,14 +282,14 @@ export default function repository(conf: Config): Repository {
282282
);
283283
},
284284
getStaticClientPath: () =>
285-
`${options!.path}${getFilePath(
285+
`${options!['path']}${getFilePath(
286286
'oc-client',
287287
packageInfo.version,
288288
'src/oc-client.min.js'
289289
)}`,
290290

291291
getStaticClientMapPath: () =>
292-
`${options!.path}${getFilePath(
292+
`${options!['path']}${getFilePath(
293293
'oc-client',
294294
packageInfo.version,
295295
'src/oc-client.min.map'
@@ -380,7 +380,7 @@ export default function repository(conf: Config): Repository {
380380

381381
repository.getComponentVersions(
382382
componentName,
383-
(err, componentVersions) => {
383+
(_err, componentVersions) => {
384384
if (
385385
!versionHandler.validateNewVersion(
386386
componentVersion,

0 commit comments

Comments
 (0)