Socket
Socket
Sign inDemoInstall

@dxos/util

Package Overview
Dependencies
Maintainers
24
Versions
3018
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dxos/util - npm Package Compare versions

Comparing version 2.18.3 to 2.19.0

4

dist/src/types.d.ts

@@ -10,2 +10,6 @@ export declare type MaybePromise<T> = T | Promise<T>;

export declare type MaybeFunction<T> = T | (() => T);
/**
* Get value from a provider.
*/
export declare const getAsyncValue: <T extends unknown>(value: MaybeFunction<MaybePromise<T>>) => Promise<any>;
//# sourceMappingURL=types.d.ts.map

@@ -6,2 +6,15 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.getAsyncValue = void 0;
/**
* Get value from a provider.
*/
const getAsyncValue = async (value) => {
if (typeof value === 'function') {
return value();
}
else {
return value;
}
};
exports.getAsyncValue = getAsyncValue;
//# sourceMappingURL=types.js.map

8

package.json
{
"name": "@dxos/util",
"version": "2.18.3",
"version": "2.19.0",
"description": "Temporary bucket for misc functions, which should graduate into separate packages.",

@@ -27,8 +27,8 @@ "bugs": {

"dependencies": {
"@dxos/crypto": "2.18.3",
"@dxos/debug": "2.18.3",
"@dxos/crypto": "2.19.0",
"@dxos/debug": "2.19.0",
"@types/node": "^14.0.9"
},
"devDependencies": {
"@dxos/toolchain-node-library": "2.18.3",
"@dxos/toolchain-node-library": "2.19.0",
"@types/jest": "^26.0.7"

@@ -35,0 +35,0 @@ },

@@ -16,1 +16,12 @@ //

export type MaybeFunction<T> = T | (() => T)
/**
* Get value from a provider.
*/
export const getAsyncValue = async <T extends any>(value: MaybeFunction<MaybePromise<T>>) => {
if (typeof value === 'function') {
return (value as Function)();
} else {
return value;
}
};

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