@kakasoo/proto-typescript
Advanced tools
Comparing version 1.28.6 to 1.28.7
import { ArrayType, Equal, NumberType } from '../types'; | ||
import { ReadonlyOrNot } from '../types/primitive.type'; | ||
export declare const ArrayPrototype: { | ||
import { Primitive, ReadonlyOrNot } from '../types/primitive.type'; | ||
export declare namespace ArrayPrototype { | ||
/** | ||
@@ -14,3 +14,3 @@ * @param container | ||
*/ | ||
filter<Container extends ReadonlyOrNot<any[]>, Target = any>(container: Container, predicate: ArrayType.TypePredicate<Container, Target>): ArrayType.Filter<Container, Target>; | ||
function filter<Container extends ReadonlyOrNot<any[]>, Target = any>(container: Container, predicate: ArrayType.TypePredicate<Container, Target>): ArrayType.Filter<Container, Target>; | ||
/** | ||
@@ -22,6 +22,6 @@ * Filter `null` or `undefined` element of Array Container. | ||
*/ | ||
filterNullish<Container_1 extends ReadonlyOrNot<any[]>, FilterNull extends boolean, FilterUndefined extends boolean>(container: Container_1, predicate: { | ||
function filterNullish<Container extends ReadonlyOrNot<any[]>, FilterNull extends boolean, FilterUndefined extends boolean>(container: Container, predicate: { | ||
filterNull: FilterNull; | ||
filterUndefined: FilterUndefined; | ||
}): ArrayType.FilterNullish<Container_1, FilterNull, FilterUndefined>; | ||
}): ArrayType.FilterNullish<Container, FilterNull, FilterUndefined>; | ||
/** | ||
@@ -32,3 +32,3 @@ * It only returns the 0th index without subtracting the elements inside the actual container. | ||
*/ | ||
shift<Container_2 extends ReadonlyOrNot<any[]>>(conatiner: Container_2): ArrayType.At<Container_2, 0>; | ||
function shift<Container extends ReadonlyOrNot<any[]>>(conatiner: Container): ArrayType.At<Container, 0>; | ||
/** | ||
@@ -39,3 +39,3 @@ * Only return the last index without subtracting the elements inside the actual container. | ||
*/ | ||
pop<Container_3 extends ReadonlyOrNot<any[]>>(conatiner: Container_3): ArrayType.At<Container_3, NumberType.Sub<ArrayType.Length<Container_3>, 1>>; | ||
function pop<Container extends ReadonlyOrNot<any[]>>(conatiner: Container): ArrayType.At<Container, NumberType.Sub<ArrayType.Length<Container>, 1>>; | ||
/** | ||
@@ -46,3 +46,3 @@ * @param container | ||
*/ | ||
unshift<Container_4 extends ReadonlyOrNot<any[]>, Items extends ReadonlyOrNot<any[]>>(container: Container_4, ...items: Items): [...Items, ...Container_4]; | ||
function unshift<Container extends ReadonlyOrNot<any[]>, Items extends ReadonlyOrNot<any[]>>(container: Container, ...items: Items): ArrayType.Concat<Items, Container>; | ||
/** | ||
@@ -55,3 +55,3 @@ * @todo add paramter of this method, named `thisArg`. | ||
*/ | ||
some<Container_5 extends ReadonlyOrNot<any[]>, Target_1 = any>(container: Container_5, predicate: ArrayType.TypePredicate<Container_5, Target_1>, thisArg?: any): Equal<Target_1, unknown> extends true ? boolean : Equal<Target_1, any> extends true ? boolean : ArrayType.Includes<Container_5, Target_1>; | ||
function some<Container extends ReadonlyOrNot<any[]>, Target = any>(container: Container, predicate: ArrayType.TypePredicate<Container, Target>, thisArg?: any): Equal<Target, unknown> extends true ? boolean : Equal<Target, any> extends true ? boolean : ArrayType.Includes<Container, Target>; | ||
/** | ||
@@ -62,7 +62,7 @@ * @param container | ||
*/ | ||
push<Container_6 extends ReadonlyOrNot<any[]>, Items_1 extends ReadonlyOrNot<any[]>>(container: Container_6, ...items: Items_1): [...Container_6, ...Items_1]; | ||
function push<Container extends ReadonlyOrNot<any[]>, Items extends ReadonlyOrNot<any[]>>(container: Container, ...items: Items): ArrayType.Concat<Container, Items>; | ||
/** | ||
* @param container | ||
*/ | ||
at<Container_7 extends ReadonlyOrNot<any[]>, Index extends number>(container: Container_7, index: Index): ArrayType.At<Container_7, Index>; | ||
function at<Container extends ReadonlyOrNot<any[]>, Index extends number>(container: Container, index: Index): ArrayType.At<Container, Index>; | ||
/** | ||
@@ -78,4 +78,4 @@ * type-safe join. | ||
*/ | ||
join<Container_8 extends ReadonlyOrNot<(string | number | bigint | boolean | null | undefined)[]>, Separator extends string = ",">(container: Container_8, separator?: Separator): ArrayType.Join<Container_8, Separator>; | ||
}; | ||
function join<Container extends ReadonlyOrNot<Exclude<Primitive, symbol>[]>, Separator extends string = ','>(container: Container, separator?: Separator): ArrayType.Join<Container, Separator>; | ||
} | ||
//# sourceMappingURL=array.prototype.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ArrayPrototype = void 0; | ||
exports.ArrayPrototype = { | ||
var ArrayPrototype; | ||
(function (ArrayPrototype) { | ||
/** | ||
@@ -15,5 +16,6 @@ * @param container | ||
*/ | ||
filter(container, predicate) { | ||
function filter(container, predicate) { | ||
return container.filter(predicate); | ||
}, | ||
} | ||
ArrayPrototype.filter = filter; | ||
/** | ||
@@ -25,3 +27,3 @@ * Filter `null` or `undefined` element of Array Container. | ||
*/ | ||
filterNullish(container, predicate) { | ||
function filterNullish(container, predicate) { | ||
return container.filter((element) => { | ||
@@ -36,3 +38,4 @@ if (predicate.filterNull === true) { | ||
}); | ||
}, | ||
} | ||
ArrayPrototype.filterNullish = filterNullish; | ||
/** | ||
@@ -43,5 +46,6 @@ * It only returns the 0th index without subtracting the elements inside the actual container. | ||
*/ | ||
shift(conatiner) { | ||
function shift(conatiner) { | ||
return conatiner.at(0); | ||
}, | ||
} | ||
ArrayPrototype.shift = shift; | ||
/** | ||
@@ -52,5 +56,6 @@ * Only return the last index without subtracting the elements inside the actual container. | ||
*/ | ||
pop(conatiner) { | ||
function pop(conatiner) { | ||
return conatiner.at(conatiner.length - 1); | ||
}, | ||
} | ||
ArrayPrototype.pop = pop; | ||
/** | ||
@@ -61,5 +66,6 @@ * @param container | ||
*/ | ||
unshift(container, ...items) { | ||
function unshift(container, ...items) { | ||
return [...items, ...container]; | ||
}, | ||
} | ||
ArrayPrototype.unshift = unshift; | ||
/** | ||
@@ -72,5 +78,6 @@ * @todo add paramter of this method, named `thisArg`. | ||
*/ | ||
some(container, predicate, thisArg) { | ||
function some(container, predicate, thisArg) { | ||
return container.some(predicate); | ||
}, | ||
} | ||
ArrayPrototype.some = some; | ||
/** | ||
@@ -81,11 +88,13 @@ * @param container | ||
*/ | ||
push(container, ...items) { | ||
function push(container, ...items) { | ||
return [...container, ...items]; | ||
}, | ||
} | ||
ArrayPrototype.push = push; | ||
/** | ||
* @param container | ||
*/ | ||
at(container, index) { | ||
function at(container, index) { | ||
return container.at(index); | ||
}, | ||
} | ||
ArrayPrototype.at = at; | ||
/** | ||
@@ -101,6 +110,7 @@ * type-safe join. | ||
*/ | ||
join(container, separator = ',') { | ||
function join(container, separator = ',') { | ||
return container.join(separator); | ||
}, | ||
}; | ||
} | ||
ArrayPrototype.join = join; | ||
})(ArrayPrototype || (exports.ArrayPrototype = ArrayPrototype = {})); | ||
//# sourceMappingURL=array.prototype.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const NumberPrototype: {}; | ||
export declare namespace NumberPrototype { } | ||
//# sourceMappingURL=number.prototype.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.NumberPrototype = void 0; | ||
exports.NumberPrototype = {}; | ||
//# sourceMappingURL=number.prototype.js.map |
@@ -18,3 +18,3 @@ import { NeverType } from './never.type'; | ||
*/ | ||
export type FilterNullish<T extends ReadonlyOrNot<any[]>, AllowNull extends boolean, AllowUndefined extends boolean> = T extends [infer First, ...infer Rest] ? NeverType.IsNever<_FilterNull<AllowNull, First>> extends true ? FilterNullish<Rest, AllowNull, AllowUndefined> : NeverType.IsNever<_FilterUndefined<AllowUndefined, First>> extends true ? FilterNullish<Rest, AllowNull, AllowUndefined> : [First, ...FilterNullish<Rest, AllowNull, AllowUndefined>] : []; | ||
export type FilterNullish<T extends ReadonlyOrNot<any[]>, AllowNull extends boolean, AllowUndefined extends boolean> = IsTuple<T> extends false ? Exclude<ElementOf<T>, (AllowNull extends true ? null : never) | (AllowUndefined extends true ? undefined : never)>[] : T extends [infer First, ...infer Rest] ? NeverType.IsNever<_FilterNull<AllowNull, First>> extends true ? FilterNullish<Rest, AllowNull, AllowUndefined> : NeverType.IsNever<_FilterUndefined<AllowUndefined, First>> extends true ? FilterNullish<Rest, AllowNull, AllowUndefined> : [First, ...FilterNullish<Rest, AllowNull, AllowUndefined>] : []; | ||
/** | ||
@@ -21,0 +21,0 @@ * Get length of tuple or string literal type. |
{ | ||
"name": "@kakasoo/proto-typescript", | ||
"version": "1.28.6", | ||
"version": "1.28.7", | ||
"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
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
166962
1858