@kakasoo/proto-typescript
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -1,4 +0,11 @@ | ||
import { Join } from '../types'; | ||
import { At, Join } from '../types'; | ||
export declare const ArrayPrototype: { | ||
/** | ||
* Returns the item located at the specified index. | ||
* @param container | ||
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
* @returns | ||
*/ | ||
at<Container extends any[] | readonly any[], Index extends number>(container: Container, index: Index): At<Container, Index>; | ||
/** | ||
* type-safe join. | ||
@@ -13,4 +20,4 @@ * @example ArrayPrototype.join(["a", "b"]); | ||
*/ | ||
join<Container extends readonly (string | number | boolean)[] | (string | number | boolean)[], Separator extends string = ",">(container: Container, separator?: Separator): Join<Container, Separator>; | ||
join<Container_1 extends readonly (string | number | boolean)[] | (string | number | boolean)[], Separator extends string = ",">(container: Container_1, separator?: Separator): Join<Container_1, Separator>; | ||
}; | ||
//# sourceMappingURL=array.prototype.d.ts.map |
@@ -6,2 +6,11 @@ "use strict"; | ||
/** | ||
* Returns the item located at the specified index. | ||
* @param container | ||
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
* @returns | ||
*/ | ||
at(container, index) { | ||
return container.at(index); | ||
}, | ||
/** | ||
* type-safe join. | ||
@@ -8,0 +17,0 @@ * @example ArrayPrototype.join(["a", "b"]); |
import { toPrimitive } from './interfaces/to-primitive.interface'; | ||
import { ArrayPrototype } from './prototypes'; | ||
import { TypedString } from './typed-string.class'; | ||
export declare class TypedArray<T extends any[] | readonly any[]> implements toPrimitive<[...T]> { | ||
import { MethodsFrom } from './types'; | ||
export declare class TypedArray<T extends any[] | readonly any[]> implements Pick<MethodsFrom<Array<any>>, 'join' | 'at'>, toPrimitive<[...T]> { | ||
private readonly data; | ||
constructor(data: T); | ||
/** | ||
* Returns the item located at the specified index. | ||
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
*/ | ||
at<Index extends number = 0>(index: Index): ReturnType<typeof ArrayPrototype.at<T, Index>>; | ||
/** | ||
* type-safe join. | ||
@@ -9,0 +15,0 @@ * @example new TypedArray([1, 2, 3] as const).join(','); |
@@ -7,2 +7,3 @@ "use strict"; | ||
class TypedArray { | ||
data; | ||
constructor(data) { | ||
@@ -12,2 +13,9 @@ this.data = data; | ||
/** | ||
* Returns the item located at the specified index. | ||
* @param index The zero-based index of the desired code unit. A negative index will count back from the last item. | ||
*/ | ||
at(index) { | ||
return this.at(index); | ||
} | ||
/** | ||
* type-safe join. | ||
@@ -14,0 +22,0 @@ * @example new TypedArray([1, 2, 3] as const).join(','); |
@@ -5,2 +5,3 @@ "use strict"; | ||
class TypedNumber { | ||
data; | ||
constructor(data = 0) { | ||
@@ -7,0 +8,0 @@ this.data = data; |
@@ -7,2 +7,3 @@ "use strict"; | ||
class TypedString { | ||
data; | ||
constructor(data = '') { | ||
@@ -9,0 +10,0 @@ this.data = String(data); |
@@ -100,2 +100,3 @@ import { Add, Divide, Multiply, NToNumber, Remainder, Sub } from './number.type'; | ||
} : never; | ||
export type At<Tuple extends any[] | readonly any[], Index extends number> = Tuple[Index]; | ||
//# sourceMappingURL=array.type.d.ts.map |
@@ -1,4 +0,4 @@ | ||
export type MethodNames<T> = { | ||
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; | ||
}[keyof T]; | ||
export type MethodsFrom<T> = { | ||
[K in keyof T as T[K] extends (...args: any[]) => any ? K : never]: Function; | ||
}; | ||
//# sourceMappingURL=function.type.d.ts.map |
{ | ||
"name": "@kakasoo/proto-typescript", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"publishConfig": { | ||
@@ -5,0 +5,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
56749
578