diff options
author | bobzel <zzzman@gmail.com> | 2024-10-18 00:28:55 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2024-10-18 00:28:55 -0400 |
commit | 0728e918e6d075c0eda738b7d2fdbf6095c714ae (patch) | |
tree | 24a3e316852922eb3a0a94c2c6e1a0d078d57825 /src/extensions/Extensions_Array.ts | |
parent | 7b29d9c14cb1ea786e64655b33b245ed14bd2d9e (diff) |
fixed following links/show document of items in tabs/carousel/card view to set options.didMove correctly so that toggleTarget works.
Diffstat (limited to 'src/extensions/Extensions_Array.ts')
-rw-r--r-- | src/extensions/Extensions_Array.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/extensions/Extensions_Array.ts b/src/extensions/Extensions_Array.ts index a50fb330f..d61585e28 100644 --- a/src/extensions/Extensions_Array.ts +++ b/src/extensions/Extensions_Array.ts @@ -1,14 +1,13 @@ export default class ArrayExtension { private readonly property: string; - private readonly body: <T>(this: Array<T>) => any; + private readonly body: <T>(this: Array<T>, args: unknown) => unknown; - constructor(property: string, body: <T>(this: Array<T>) => any) { + constructor(property: string, body: <T>(this: Array<T>, args: unknown) => unknown) { this.property = property; this.body = body; } assign() { - // eslint-disable-next-line no-extend-native Object.defineProperty(Array.prototype, this.property, { value: this.body, enumerable: false, @@ -28,6 +27,11 @@ const extensions = [ } return this[this.length - 1]; }), + // eslint-disable-next-line @typescript-eslint/no-explicit-any + new ArrayExtension('getIndex', function (val: any) { + const index = this.indexOf(val); + return index === -1 ? undefined : index; + }), ]; function Assign() { |