140
// check for unknown arguments (strict-mode).
141
self.unknownArguments = function unknownArguments(
143
>
aliases,
144
>
positionalMap,
145
>
isDefaultCommand,
146
>
checkPositionals = true
147
>
) {
148
>
const commandKeys = yargs
149
>
.getInternalMethods()
150
>
.getCommandInstance()
151
>
.getCommands();
152
>
const unknown: string[] = [];
153
>
const currentContext = yargs.getInternalMethods().getContext();
154
>
155
>
Object.keys(argv).forEach(key => {
156
>
if (
157
>
!specialKeys.includes(key) &&
158
>
!Object.prototype.hasOwnProperty.call(positionalMap, key) &&
159
!Object.prototype.hasOwnProperty.call(
160
yargs.getInternalMethods().getParseContext(),
161
key
163
!self.isValidAndSomeAliasIsNotNew(key, aliases)
165
unknown.push(key);
166
}
168
>
169
>
if (
170
>
checkPositionals &&
171
(currentContext.commands.length > 0 ||
172
commandKeys.length > 0 ||
173
isDefaultCommand)
175
argv._.slice(currentContext.commands.length).forEach(key => {
176
if (!commandKeys.includes('' + key)) {