@kakasoo/proto-typescript
Advanced tools
Comparing version 1.5.0 to 1.5.1
@@ -5,3 +5,3 @@ import { toPrimitive } from './interfaces/to-primitive.interface'; | ||
import { TypedNumber } from './typed-number.class'; | ||
export declare class TypedString<T extends string | number | boolean> implements toPrimitive<`${T}`> { | ||
export declare class TypedString<T extends string | number | boolean = ''> implements toPrimitive<`${T}`> { | ||
private readonly data; | ||
@@ -8,0 +8,0 @@ constructor(data?: T); |
@@ -5,2 +5,3 @@ import { Add, Divide, Multiply, NToNumber, Remainder, Sub } from './number.type'; | ||
export type Length<T extends any[]> = T['length']; | ||
export type ArrayValues<T extends any[]> = T[number]; | ||
/** | ||
@@ -29,3 +30,3 @@ * νμ¬ νν ννμ μλ‘μ΄ νμ νλλ₯Ό μΆκ°νλ νμ | ||
] ? CONDITION extends true ? X extends B ? [X, ...Slice<Rest, A, B, false>] : [X, ...Slice<Rest, A, B, true>] : X extends A ? X extends B ? [X, ...Slice<Rest, A, B, false>] : [X, ...Slice<Rest, A, B, true>] : Slice<Rest, A, B, false> : CONDITION extends true ? never : []; | ||
export type Take<T extends any[], P extends number, R extends any[] = []> = Length<R> extends P ? R : T extends [infer F, ...infer Rest] ? Take<Rest, P, Push<R, F>> : never; | ||
export type Take<T extends any[], P extends number, R extends any[] = []> = Length<R> extends P ? R : T extends [infer F, ...infer Rest] ? Take<Rest, P, Push<R, F>> : R; | ||
export type TupleIncludes<T extends readonly any[], U> = T extends [infer P, ...infer R] ? Equal<U, P> extends true ? true : TupleIncludes<R, U> : false; | ||
@@ -32,0 +33,0 @@ export type TupleToUnion<T extends NTuple<number>> = T[number]; |
@@ -1,2 +0,2 @@ | ||
import { ArrayToUnion, Length, NNTuple, NTuple, Push, TupleIncludes } from './array.type'; | ||
import { ArrayToUnion, ArrayValues, Length, NNTuple, NTuple, Push, TupleIncludes } from './array.type'; | ||
export type NToNumber<N> = N extends number ? N : never; | ||
@@ -12,2 +12,3 @@ export type NToNumberTuple<N> = N extends number[] ? N : never; | ||
export type LessThan<N extends number, T extends any[] = []> = T['length'] extends N ? T : LessThan<N, Push<T, T['length']>>; | ||
export type AIsLessThanOrEqualB<A extends number, B extends number> = ArrayValues<LessThan<A>> extends ArrayValues<LessThan<B>> ? true : false; | ||
export type LessThanEqual<N extends number, T extends any[] = []> = LessThan<NToNumber<Add<N, 1>>>; | ||
@@ -14,0 +15,0 @@ export type GaussSum<N1 extends number, K = ArrayToUnion<LessThanEqual<N1>>> = K extends number ? NTuple<K> : never; |
import { Conditional } from './arithmetic.type'; | ||
import { Take } from './array.type'; | ||
import { Sub } from './number.type'; | ||
import { Equal } from './object.type'; | ||
export type ToStringTuple<T> = T extends string[] ? T : never; | ||
@@ -27,3 +28,3 @@ export type ToString<T> = T extends string ? T : T extends number ? `${T}` : never; | ||
export type EndsWith<T extends string, U extends string> = T extends `${string}${U}` ? true : false; | ||
type _Split<Conatiner extends string, Splitter extends string = ''> = Conatiner extends `${infer FirstWord}${Splitter}${infer Rest}` ? [FirstWord, ...Split<Rest, Splitter>] : Conatiner extends '' ? [] : [Conatiner]; | ||
type _Split<Conatiner extends string, Splitter extends string = ''> = Conatiner extends '' ? [] : Equal<Splitter, string> extends true ? string[] : Conatiner extends `${infer FirstWord}${Splitter}${infer Rest}` ? [FirstWord, ...Split<Rest, Splitter>] : [Conatiner]; | ||
/** | ||
@@ -30,0 +31,0 @@ * Split<"abcdefg"> // ["a", "b", "c", "d", "e", "f", "g"] |
{ | ||
"name": "@kakasoo/proto-typescript", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"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
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
54730
545