Skip to content

Commit

Permalink
fix proj file
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxymGorn committed Nov 11, 2023
1 parent 8fa8e54 commit 8907e47
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
2 changes: 2 additions & 0 deletions src/Cropper.Blazor/Client/Cropper.Blazor.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
<FilesToClean Include="./wwwroot/resizeWindowEventListener.js" />
<FilesToClean Include="./wwwroot/resizeWindowEventListener.min.js" />
<FilesToClean Include="./wwwroot/types/index.js" />
<FilesToClean Include="./wwwroot/types/IDownloadOptions.js" />
<FilesToClean Include="./wwwroot/types/JsObject.js" />
</ItemGroup>
<Delete Files="@(FilesToClean)" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/Cropper.Blazor/Client/wwwroot/helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IDownloadOptions } from "./types/IDownloadOptions"
import { IDownloadOptions } from './types/IDownloadOptions'

window.downloadFromUrl = (options: IDownloadOptions): void => {
const anchorElement = document.createElement('a')
Expand Down
2 changes: 1 addition & 1 deletion src/Cropper.Blazor/Client/wwwroot/jsObjectModule.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { JsObject } from "./types/JsObject";
import { JsObject } from './types/JsObject'

window.jsObject = new JsObject()
8 changes: 4 additions & 4 deletions src/Cropper.Blazor/Client/wwwroot/types/IDownloadOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface IDownloadOptions {
url: string
fileName?: string
interface IDownloadOptions {
url: string
fileName?: string
}

export { IDownloadOptions };
export { IDownloadOptions }
44 changes: 22 additions & 22 deletions src/Cropper.Blazor/Client/wwwroot/types/JsObject.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
class JsObject {
getPropertyList(path: string): string[] {
const res: string[] = path.replace('[', '.').replace(']', '').split('.')
class JsObject {
getPropertyList (path: string): string[] {
const res: string[] = path.replace('[', '.').replace(']', '').split('.')

if (res[0] === '') {
res.shift()
}

return res
if (res[0] === '') {
res.shift()
}

getInstanceProperty(instance: any, propertyPath: string): any {
if (propertyPath === '') {
return instance
}
return res
}

let currentProperty: any = instance
const splitProperty: string[] = this.getPropertyList(propertyPath)
getInstanceProperty (instance: any, propertyPath: string): any {
if (propertyPath === '') {
return instance
}

for (let i = 0; i < splitProperty.length; i++) {
if (splitProperty[i] in currentProperty) {
currentProperty = currentProperty[splitProperty[i]]
} else {
return null
}
}
let currentProperty: any = instance
const splitProperty: string[] = this.getPropertyList(propertyPath)

return currentProperty
for (let i = 0; i < splitProperty.length; i++) {
if (splitProperty[i] in currentProperty) {
currentProperty = currentProperty[splitProperty[i]]
} else {
return null
}
}

return currentProperty
}
}
export { JsObject }
4 changes: 2 additions & 2 deletions src/Cropper.Blazor/Client/wwwroot/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IDownloadOptions } from "./IDownloadOptions"
import { JsObject } from "./JsObject"
import { IDownloadOptions } from './IDownloadOptions'
import { JsObject } from './JsObject'

declare global {
interface Window {
Expand Down

0 comments on commit 8907e47

Please sign in to comment.