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

tsbuffer

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsbuffer - npm Package Compare versions

Comparing version 2.0.5 to 2.0.6-dev.0

36

index.d.ts
/*!
* TSBuffer v2.0.5
* TSBuffer v2.0.6-dev.0
* -----------------------------------------

@@ -13,2 +13,9 @@ * MIT LICENSE

export declare class Base64Util {
static bufferToBase64(buf: Uint8Array): string;
static base64ToBuffer(base64: string): Uint8Array;
static base64Encode(str: string): string;
static base64Decode(str: string): string;
}
/** @public */

@@ -34,2 +41,15 @@ export declare interface DecodeOptions {

/** @public */
declare type EncodeJsonOutput = {
isSucc: true;
/** Encoded JSON Object */
json: any;
errMsg?: undefined;
} | {
isSucc: false;
/** Error message */
errMsg: string;
json?: undefined;
};
/** @public */
export declare interface EncodeOptions {

@@ -71,2 +91,16 @@ /** Skip validate value *before* encode */

decode<T = unknown>(buf: Uint8Array, schemaOrId: string | TSBufferSchema, options?: DecodeOptions): DecodeOutput<T>;
/**
* 编码为 JSON Object,根据协议将 JSON 不支持的格式(如 ArrayBuffer、Date、ObjectId)转换成 JSON 可传输的格式
* @param value
* @param schemaOrId
* @param options
*/
encodeJSON(value: any, schemaOrId: string | TSBufferSchema, options?: EncodeOptions): EncodeJsonOutput;
/**
* 从 JSON Object 解码,根据协议将 ArrayBuffer、Date、ObjectId 等类型从 JSON 中还原
* @param json - JSON Object (是 JSON 对象,而非 JSON 字符串)
* @param schemaOrId
* @param options
*/
decodeJSON<T = unknown>(json: any, schemaOrId: string | TSBufferSchema, options?: DecodeOptions): DecodeOutput<T>;
validate: TSBufferValidator<Proto>['validate'];

@@ -73,0 +107,0 @@ prune: TSBufferValidator<Proto>['prune'];

12

package.json
{
"name": "tsbuffer",
"version": "2.0.5",
"version": "2.0.6-dev.0",
"description": "",

@@ -16,8 +16,8 @@ "main": "index.cjs",

"k8w-extend-native": "^1.4.6",
"tsbuffer-validator": "~2.0.5",
"tsbuffer-validator": "^2.0.7-dev.1",
"tslib": "^2.3.1"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.13.63",
"@microsoft/api-extractor": "^7.18.16",
"@microsoft/api-documenter": "^7.13.65",
"@microsoft/api-extractor": "^7.18.17",
"@types/mocha": "^8.2.3",

@@ -27,5 +27,5 @@ "@types/node": "^15.14.9",

"nyc": "^15.1.0",
"rollup": "^2.58.0",
"rollup": "^2.59.0",
"rollup-plugin-typescript2": "^0.30.0",
"ts-node": "^10.3.0",
"ts-node": "^10.4.0",
"tsbuffer-proto-generator": "~1.4.9",

@@ -32,0 +32,0 @@ "typescript": "^4.4.4"

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