Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kakasoo/proto-typescript

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kakasoo/proto-typescript - npm Package Compare versions

Comparing version 1.28.0 to 1.28.1

15

dist/types/string.type.d.ts

@@ -53,4 +53,17 @@ import { Conditional } from './arithmetic.type';

export type Split<Conatiner extends string, Splitter extends string = '', Limit extends number = ArrayType.Length<_Split<Conatiner, Splitter>>> = Conditional<Limit extends 0 ? true : false, [], ArrayType.Take<_Split<Conatiner, Splitter>, Limit>>;
export type SplitIfIncludes<Container extends string, Splitter extends readonly string[] = []> = Container extends '' ? [] : Container extends `${infer FirstWord}${infer SecondWord extends ArrayType.Values<Splitter>}${infer Rest}` ? [FirstWord, ...SplitIfIncludes<Rest, Splitter>] : [Container];
/**
* type answer = SplitMap<['aaa', 'bab'], 'a'>; // ["", "", "", "b", "b"]
*/
export type SplitMap<Containers extends string[], Splitter extends string = ''> = Containers extends [] ? [] : Containers extends [infer First extends string, ...infer Rest extends string[]] ? [..._Split<First, Splitter>, ...SplitMap<Rest, Splitter>] : [];
/**
* type answer1 = SplitByManySplitter<['Hello-bbb_ccc'], [' ', '-', '_']>;
* type answer2 = StringType.SplitByManySplitter<['Hello world'], ['_', ' ', '.', '-', '/']>;
* type answer3 = StringType.SplitByManySplitter<['Hello world-kakasoo'], ['_', ' ', '.', '-', '/']>;
* type answer4 = StringType.SplitByManySplitter<['Hello world, my name-is_kakasoo', 'ha ha ha'], ['_', ' ', ',', '.', '-', '/']>;
*/
export type SplitByManySplitter<Containers extends string[], Splitters extends readonly string[] = []> = Splitters extends [] ? Containers : Splitters extends [infer FirstSplitter extends string, ...infer RestSplitters extends string[]] ? SplitMap<Containers, FirstSplitter> extends [infer FirstToken extends string] ? SplitByManySplitter<[FirstToken], RestSplitters> : SplitMap<Containers, FirstSplitter> extends [
infer FirstToken extends string,
...infer RestTokens extends string[]
] ? [...SplitByManySplitter<[FirstToken], RestSplitters>, ...SplitByManySplitter<RestTokens, RestSplitters>] : [] : [];
/**
* Type of getting one character from that location with index as the key value in the string

@@ -57,0 +70,0 @@ *

2

package.json
{
"name": "@kakasoo/proto-typescript",
"version": "1.28.0",
"version": "1.28.1",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc