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.24.0 to 1.25.0

16

dist/classes/typed-boolean.class.d.ts
import { ToPrimitive } from '../interfaces';
import { ReadonlyOrNot } from '../types';
import { Equal, ReadonlyOrNot } from '../types';
import { TypedObject } from './typed-object.class';

@@ -7,2 +7,16 @@ export declare class TypedBoolean<T extends boolean = false> extends TypedObject<T> implements ToPrimitive<T> {

constructor(data?: T);
/**
* @example
* ```ts
* const yn = TypedBoolean.refine({ true: 'Y', false: 'N' });
* const t = yn('Y'); // true
* const f = yn('N'); // false
* ```
* @param map
* @returns
*/
static refine<T extends string, F extends string>(map: {
true: T;
false: F;
}): <Choice extends T | F>(data: Choice) => Equal<Choice, T> extends true ? T : F;
toPrimitive(): T;

@@ -9,0 +23,0 @@ }

@@ -11,2 +11,20 @@ "use strict";

}
/**
* @example
* ```ts
* const yn = TypedBoolean.refine({ true: 'Y', false: 'N' });
* const t = yn('Y'); // true
* const f = yn('N'); // false
* ```
* @param map
* @returns
*/
static refine(map) {
return function (data) {
if (data === map.true) {
return true;
}
return false;
};
}
toPrimitive() {

@@ -13,0 +31,0 @@ return this.boolean;

3

dist/classes/typed-string.class.d.ts

@@ -9,5 +9,2 @@ import { ToPrimitive } from '../interfaces/to-primitive.interface';

import { TypedObject } from './typed-object.class';
/**
* @todo support iterator.
*/
export declare class TypedString<T extends string | number | boolean = ''> extends TypedObject<T> implements Pick<FunctionType.MethodsFrom<String>, 'split' | 'at' | 'concat' | 'trimStart' | 'trimEnd' | 'trim' | 'padEnd' | 'padStart' | 'toLowerCase' | 'toUpperCase' | 'includes' | 'substring' | 'startsWith' | 'endsWith' | 'repeat' | 'indexOf'>, ToPrimitive<T | `${T}`>, Iterable<ArrayType.ElementOf<StringType.Split<`${T}`>>> {

@@ -14,0 +11,0 @@ [n: number]: ArrayType.At<StringType.Split<`${T}`>, number>;

@@ -9,5 +9,2 @@ "use strict";

const typed_object_class_1 = require("./typed-object.class");
/**
* @todo support iterator.
*/
class TypedString extends typed_object_class_1.TypedObject {

@@ -14,0 +11,0 @@ string;

{
"name": "@kakasoo/proto-typescript",
"version": "1.24.0",
"version": "1.25.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

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