Skip to content
Open
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
registry=https://msazure.pkgs.visualstudio.com/_packaging/power-platform-ux/npm/registry/
always-auth=true
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,9 @@
"yargs": "^16.2.0"
},
"dependencies": {
"@maker-studio/powerportals-preview-engine": "^3.7.24",
"@microsoft/generator-powerpages": "1.21.19",
"@types/js-yaml": "^4.0.5",
"@types/jwt-decode": "2.2.0",
"@types/node-fetch": "^2.6.2",
"@vscode/extension-telemetry": "^0.6.2",
Expand Down
20 changes: 20 additions & 0 deletions src/client/power-pages/commonUtility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,23 @@ export function getRegExPattern(fileNameArray: string[]): RegExp[] {

return patterns;
}

export const findObjectIndexByProperty = (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
array: any,
key: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
value: any
): number => {
for (let i = 0; i < array.length; i++) {
if (array[i][key] === value) {
return i;
}
}
return -1;
}

export const removeExtension = (fileName: string, extn: string): string => {
// Using slice to remove the extension from the end
return fileName.slice(0, -extn.length);
}
Loading