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

@lens-protocol/shared-kernel

Package Overview
Dependencies
Maintainers
9
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lens-protocol/shared-kernel - npm Package Compare versions

Comparing version 0.11.0-alpha.9 to 0.11.0-alpha.10

18

dist/declarations/src/index.d.ts

@@ -0,4 +1,9 @@

import isObject from 'lodash/isObject';
export { isObject };
export * from "./CausedError.js";
export * from "./DateUtils.js";
export * from "./Deferred.js";
export * from "./Result.js";
export * from "./arithmetic/BigDecimal.js";
export * from "./array.js";
export * from "./arithmetic/BigDecimal.js";
export * from "./CausedError.js";
export * from "./crypto/Amount.js";

@@ -8,15 +13,12 @@ export * from "./crypto/Asset.js";

export * from "./crypto/types.js";
export * from "./DateUtils.js";
export * from "./get.js";
export * from "./logger/ILogger.js";
export * from "./Result.js";
export * from "./Deferred.js";
export * from "./maybe.js";
export * from "./omitDeep.js";
export * from "./ts-helpers/assertError.js";
export * from "./ts-helpers/assertNever.js";
export * from "./ts-helpers/invariant.js";
export * from "./ts-helpers/isInEnum.js";
export * from "./ts-helpers/never.js";
export * from "./ts-helpers/nonNullable.js";
export * from "./ts-helpers/types.js";
export * from "./ts-helpers/isInEnum.js";
export * from "./omitDeep.js";
export * from "./maybe.js";

@@ -5,7 +5,7 @@ 'use strict';

var isObject = require('lodash/isObject');
var Amount = require('./Amount-781b917e.cjs.dev.js');
var defaultTo = require('lodash/defaultTo.js');
var isObject = require('lodash/isObject.js');
var isObject$1 = require('lodash/isObject.js');
var lodashGet = require('lodash/get.js');
var isObject$1 = require('lodash/isObject');
var isObjectLike = require('lodash/isObjectLike.js');

@@ -16,27 +16,8 @@ require('decimal.js');

var isObject__default = /*#__PURE__*/_interopDefault(isObject);
var defaultTo__default = /*#__PURE__*/_interopDefault(defaultTo);
var isObject__default = /*#__PURE__*/_interopDefault(isObject);
var isObject__default$1 = /*#__PURE__*/_interopDefault(isObject$1);
var lodashGet__default = /*#__PURE__*/_interopDefault(lodashGet);
var isObject__default$1 = /*#__PURE__*/_interopDefault(isObject$1);
var isObjectLike__default = /*#__PURE__*/_interopDefault(isObjectLike);
function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
Amount.invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**

@@ -59,3 +40,3 @@ * This subclass of Error supports chaining.

_this = _super.call(this, message, options);
if (isObject__default["default"](options) && options.cause && !('cause' in Amount._assertThisInitialized(_this))) {
if (isObject__default$1["default"](options) && options.cause && !('cause' in Amount._assertThisInitialized(_this))) {
var cause = options.cause;

@@ -129,8 +110,12 @@ _this.cause = cause;

/**
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
*/
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet__default["default"](data, lodashPath, defaultValue);
}
var Deferred = /*#__PURE__*/Amount._createClass(function Deferred() {
var _this = this;
Amount._classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});

@@ -335,18 +320,66 @@ /**

function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
Amount.invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
*/
var Deferred = /*#__PURE__*/Amount._createClass(function Deferred() {
var _this = this;
Amount._classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet__default["default"](data, lodashPath, defaultValue);
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike__default["default"](value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function assertError(error) {
// why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099
// eslint-disable-next-line no-prototype-builtins
if (!isObject__default$1["default"](error) || !Error.prototype.isPrototypeOf(error)) {
if (!isObject__default["default"](error) || !Error.prototype.isPrototypeOf(error)) {
throw error;

@@ -377,2 +410,6 @@ }

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
function never() {

@@ -397,39 +434,6 @@ var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected call to never()';

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike__default["default"](value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
Object.defineProperty(exports, 'isObject', {
enumerable: true,
get: function () { return isObject__default["default"]; }
});
exports.Amount = Amount.Amount;

@@ -436,0 +440,0 @@ exports.BigDecimal = Amount.BigDecimal;

@@ -5,7 +5,7 @@ 'use strict';

var isObject = require('lodash/isObject');
var Amount = require('./Amount-58bcc8fb.cjs.prod.js');
var defaultTo = require('lodash/defaultTo.js');
var isObject = require('lodash/isObject.js');
var isObject$1 = require('lodash/isObject.js');
var lodashGet = require('lodash/get.js');
var isObject$1 = require('lodash/isObject');
var isObjectLike = require('lodash/isObjectLike.js');

@@ -16,27 +16,8 @@ require('decimal.js');

var isObject__default = /*#__PURE__*/_interopDefault(isObject);
var defaultTo__default = /*#__PURE__*/_interopDefault(defaultTo);
var isObject__default = /*#__PURE__*/_interopDefault(isObject);
var isObject__default$1 = /*#__PURE__*/_interopDefault(isObject$1);
var lodashGet__default = /*#__PURE__*/_interopDefault(lodashGet);
var isObject__default$1 = /*#__PURE__*/_interopDefault(isObject$1);
var isObjectLike__default = /*#__PURE__*/_interopDefault(isObjectLike);
function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
Amount.invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**

@@ -59,3 +40,3 @@ * This subclass of Error supports chaining.

_this = _super.call(this, message, options);
if (isObject__default["default"](options) && options.cause && !('cause' in Amount._assertThisInitialized(_this))) {
if (isObject__default$1["default"](options) && options.cause && !('cause' in Amount._assertThisInitialized(_this))) {
var cause = options.cause;

@@ -129,8 +110,12 @@ _this.cause = cause;

/**
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
*/
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet__default["default"](data, lodashPath, defaultValue);
}
var Deferred = /*#__PURE__*/Amount._createClass(function Deferred() {
var _this = this;
Amount._classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});

@@ -335,18 +320,66 @@ /**

function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
Amount.invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
Amount.invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
*/
var Deferred = /*#__PURE__*/Amount._createClass(function Deferred() {
var _this = this;
Amount._classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet__default["default"](data, lodashPath, defaultValue);
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike__default["default"](value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function assertError(error) {
// why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099
// eslint-disable-next-line no-prototype-builtins
if (!isObject__default$1["default"](error) || !Error.prototype.isPrototypeOf(error)) {
if (!isObject__default["default"](error) || !Error.prototype.isPrototypeOf(error)) {
throw error;

@@ -377,2 +410,6 @@ }

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
function never() {

@@ -397,39 +434,6 @@ var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected call to never()';

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike__default["default"](value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
Object.defineProperty(exports, 'isObject', {
enumerable: true,
get: function () { return isObject__default["default"]; }
});
exports.Amount = Amount.Amount;

@@ -436,0 +440,0 @@ exports.BigDecimal = Amount.BigDecimal;

@@ -1,2 +0,4 @@

import { i as invariant, _ as _inherits, a as _createSuper, b as _classCallCheck, c as _assertThisInitialized, d as _createClass, e as _wrapNativeSuper, I as InvariantError } from './Amount-5b0c3806.esm.js';
import isObject$1 from 'lodash/isObject';
export { default as isObject } from 'lodash/isObject';
import { _ as _inherits, a as _createSuper, b as _classCallCheck, c as _assertThisInitialized, d as _createClass, e as _wrapNativeSuper, i as invariant, I as InvariantError } from './Amount-5b0c3806.esm.js';
export { A as Amount, B as BigDecimal, C as ChainType, D as Denomination, I as InvariantError, K as Kind, N as NativeType, W as WellKnownSymbols, f as erc20, g as ether, i as invariant, m as matic, u as usd } from './Amount-5b0c3806.esm.js';

@@ -6,25 +8,5 @@ import defaultTo from 'lodash/defaultTo.js';

import lodashGet from 'lodash/get.js';
import isObject$1 from 'lodash/isObject';
import isObjectLike from 'lodash/isObjectLike.js';
import 'decimal.js';
function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**

@@ -116,8 +98,12 @@ * This subclass of Error supports chaining.

/**
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
*/
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet(data, lodashPath, defaultValue);
}
var Deferred = /*#__PURE__*/_createClass(function Deferred() {
var _this = this;
_classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});

@@ -322,14 +308,62 @@ /**

function hasAtLeastOne(items) {
return items.length > 0;
}
function assertNonEmptyArray(items) {
invariant(hasAtLeastOne(items), "Expected array of to have at least one item, but received 0 items");
}
function hasJustOne(items) {
return items.length === 1;
}
function assertJustOne(items) {
invariant(hasJustOne(items), 'Expected array of to have exactly one item.');
}
function removeAtIndex(items, index) {
return items.slice(0, index).concat(items.slice(index + 1));
}
function hasTwoOrMore(items) {
return items.length >= 2;
}
/**
* Unwraps the promise to allow resolving/rejecting outside the Promise constructor
* Inspired by https://dev.to/tipsy_dev/advanced-typescript-reinventing-lodash-get-4fhe
*/
var Deferred = /*#__PURE__*/_createClass(function Deferred() {
var _this = this;
_classCallCheck(this, Deferred);
this.promise = new Promise(function (resolve, reject) {
_this.resolve = resolve;
_this.reject = reject;
});
});
function get(data, path, defaultValue) {
var lodashPath = path.split('.');
return lodashGet(data, lodashPath, defaultValue);
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike(value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function assertError(error) {

@@ -364,2 +398,6 @@ // why not `error instanceof Error`? see https://github.com/microsoft/TypeScript-DOM-lib-generator/issues/1099

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
function never() {

@@ -384,39 +422,2 @@ var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected call to never()';

var isInEnum = function isInEnum(enumVariables, value) {
return Object.values(enumVariables).includes(value);
};
/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any */
function isPrimitive(value) {
return !isObjectLike(value);
}
function omitDeep(target, omitKey) {
if (isPrimitive(target)) {
return target;
}
if (Array.isArray(target)) {
return target.map(function (item) {
return omitDeep(item, omitKey);
});
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
return Object.keys(target).reduce(function (acc, key) {
if (key === omitKey) {
return acc;
}
var value = omitDeep(target[key], omitKey);
acc[key] = value;
return acc;
}, {});
}
function maybe(thunk) {
try {
return thunk();
} catch (_unused) {
/* empty on purpose */
return undefined;
}
}
export { CausedError, DateUtils, Deferred, assertError, assertErrorWithCode, assertErrorWithReason, assertFailure, assertJustOne, assertNever, assertNonEmptyArray, assertSuccess, failure, get, hasAtLeastOne, hasJustOne, hasTwoOrMore, isInEnum, isNonNullable, maybe, never, nonNullable, omitDeep, removeAtIndex, success };
{
"name": "@lens-protocol/shared-kernel",
"version": "0.11.0-alpha.9",
"version": "0.11.0-alpha.10",
"description": "Shared kernel",

@@ -47,5 +47,5 @@ "repository": {

"typescript": "5.2.2",
"@lens-protocol/tsconfig": "0.2.0",
"@lens-protocol/eslint-config": "0.5.0",
"@lens-protocol/prettier-config": "0.5.0",
"@lens-protocol/tsconfig": "0.2.0"
"@lens-protocol/prettier-config": "0.5.0"
},

@@ -52,0 +52,0 @@ "prettier": "@lens-protocol/prettier-config",

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