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

@tbd54566975/common

Package Overview
Dependencies
Maintainers
10
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tbd54566975/common - npm Package Compare versions

Comparing version 0.1.1 to 0.8.0-alpha-20230728-70f8cf0

src/convert.ts

49

package.json
{
"name": "@tbd54566975/common",
"version": "0.1.1",
"version": "0.8.0-alpha-20230728-70f8cf0",
"type": "module",
"main": "./dist/cjs/main.cjs",
"module": "./dist/esm/main.mjs",
"main": "./dist/cjs/main.js",
"module": "./dist/esm/main.js",
"types": "./dist/types/main.d.ts",
"scripts": {
"build": "rimraf dist && node build/bundles.js && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json && tsc",
"clean": "rimraf dist coverage tests/compiled",
"build:esm": "rimraf dist/esm dist/types && npx tsc -p tsconfig.json",
"build:cjs": "rimraf dist/cjs && tsc -p tsconfig.cjs.json && echo '{\"type\": \"commonjs\"}' > ./dist/cjs/package.json",
"build:browser": "rimraf dist/browser.mjs dist/browser.js && node build/bundles.js",
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:browser",
"lint": "eslint . --ext .ts --max-warnings 0",
"lint:fix": "eslint . --ext .ts --fix",
"test:node": "rimraf __tests__ && tsc -p tsconfig.test.json && c8 mocha",
"test:node": "rimraf tests/compiled && tsc -p tests/tsconfig.json && c8 mocha",
"test:browser": "karma start karma.conf.cjs"

@@ -43,27 +47,8 @@ },

".": {
"import": "./dist/esm/main.mjs",
"require": "./dist/cjs/main.cjs",
"import": "./dist/esm/main.js",
"require": "./dist/cjs/main.js",
"types": "./dist/types/main.d.ts"
},
"./browser": {
"import": "./dist/browser.mjs",
"require": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"./electron": {
"import": "./dist/esm/main.mjs",
"require": "./dist/electron/main.cjs",
"types": "./dist/types/main.d.ts"
}
},
"browser": {
"./dist/esm/main.mjs": "./dist/browser.mjs",
"./dist/cjs/main.cjs": "./dist/browser.js",
"types": "./dist/types/main.d.ts"
},
"react-native": {
"./dist/esm/main.mjs": "./dist/esm/main.mjs",
"./dist/cjs/main.cjs": "./dist/esm/main.mjs",
"types": "./dist/types/main.d.ts"
},
"react-native": "./dist/esm/main.js",
"keywords": [

@@ -84,3 +69,5 @@ "decentralized",

},
"dependencies": {},
"dependencies": {
"multiformats": "11.0.2"
},
"devDependencies": {

@@ -106,10 +93,6 @@ "@types/chai": "4.3.0",

"mocha": "10.2.0",
"node-stdlib-browser": "1.2.0",
"playwright": "1.31.2",
"rimraf": "4.4.0",
"typescript": "5.0.4"
},
"overrides": {
"socket.io-parser@>4.0.4 <4.2.3": "4.2.3"
"typescript": "5.1.6"
}
}

@@ -1,1 +0,6 @@

export * from './types.js';
export type * from './types.js';
export * from './convert.js';
export * from './multicodec.js';
export * from './stores.js';
export * from './type-utils.js';
/**
* simple interface for a Key/Value store. Can be implemented to override default implementations wherever
* they're used
* TODO: add references to concrete implementations in other packages
* Interface for a generic key-value store.
*/
export interface KeyValueStore<K, V> {
get(key: K): Promise<V>;
set(key: K, value: V): Promise<void>;
delete(key: K): Promise<void>;
/**
* Clears the store, removing all key-value pairs.
*
* @returns A promise that resolves when the store has been cleared.
*/
clear(): Promise<void>;
/**
* Closes the store, freeing up any resources used. After calling this method, no other operations can be performed on the store.
*
* @returns A promise that resolves when the store has been closed.
*/
close(): Promise<void>;
}
/**
* Deletes a key-value pair from the store.
*
* @param key - The key of the value to delete.
* @returns A promise that resolves to true if the element existed and has been removed, or false if the element does not exist.
*/
delete(key: K): Promise<boolean | void>;
/**
* Fetches a value from the store given its key.
*
* @param key - The key of the value to retrieve.
* @returns A promise that resolves with the value associated with the key, or `undefined` if no value exists for that key.
*/
get(key: K): Promise<V | undefined>;
/**
* Sets the value for a key in the store.
*
* @param key - The key under which to store the value.
* @param value - The value to be stored.
* @returns A promise that resolves when the value has been set.
*/
set(key: K, value: V): Promise<void>;
}
/**
* Represents an object type where a subset of keys are required and everything else is optional.
*/
export type RequireOnly<T, K extends keyof T, O extends keyof T = never> = Required<Pick<T, K>> & Omit<Partial<T>, O>;
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