Skip to content

Commit

Permalink
fix: array.at is not allowed while have node14
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Aug 18, 2022
1 parent b15029d commit d976c6f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const labelValidation = async (label: string): Promise<string> => {
export const isObjectsFolder = async (path: string): Promise<string> => {
const pathParts = resolve(path.trim()).split(sep);
// has /objects/ AND objects is not the last item (there must be some child)
if (pathParts.includes('objects') && pathParts.at(-1) !== 'objects') {
if (pathParts.includes('objects') && pathParts[pathParts.length - 1] !== 'objects') {
return path;
}
throw new SfError(messages.getMessage('error.objectDirectory', [path]));
Expand Down

0 comments on commit d976c6f

Please sign in to comment.