@liskhq/lisk-utils
Advanced tools
Comparing version 0.1.0 to 0.2.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BufferMap = void 0; | ||
const buffer_string_1 = require("./buffer_string"); | ||
@@ -4,0 +5,0 @@ const cloneDeep = require("lodash.clonedeep"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.BufferSet = void 0; | ||
const buffer_string_1 = require("./buffer_string"); | ||
@@ -4,0 +5,0 @@ const cloneDeep = require("lodash.clonedeep"); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.keyString = (key) => key.toString('binary'); | ||
exports.keyReadableString = (key) => key.toString('hex'); | ||
exports.keyReadableString = exports.keyString = void 0; | ||
const keyString = (key) => key.toString('binary'); | ||
exports.keyString = keyString; | ||
const keyReadableString = (key) => key.toString('hex'); | ||
exports.keyReadableString = keyReadableString; | ||
//# sourceMappingURL=buffer_string.js.map |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./buffer_map")); | ||
__export(require("./buffer_set")); | ||
__export(require("./max_heap")); | ||
__export(require("./min_heap")); | ||
__exportStar(require("./buffer_map"), exports); | ||
__exportStar(require("./buffer_set"), exports); | ||
__exportStar(require("./max_heap"), exports); | ||
__exportStar(require("./min_heap"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MaxHeap = void 0; | ||
const min_heap_1 = require("./min_heap"); | ||
@@ -4,0 +5,0 @@ class MaxHeap extends min_heap_1.MinHeap { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MinHeap = void 0; | ||
const node_1 = require("./node"); | ||
@@ -4,0 +5,0 @@ class MinHeap { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Node = void 0; | ||
class Node { | ||
@@ -4,0 +5,0 @@ constructor(key, value) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.objects = exports.jobHandlers = exports.dataStructures = void 0; | ||
exports.dataStructures = require("./data_structures"); | ||
@@ -4,0 +5,0 @@ exports.jobHandlers = require("./job_handlers"); |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__export(require("./mutex")); | ||
__export(require("./scheduler")); | ||
__exportStar(require("./mutex"), exports); | ||
__exportStar(require("./scheduler"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Mutex = void 0; | ||
class Mutex { | ||
@@ -4,0 +5,0 @@ constructor() { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Scheduler = void 0; | ||
class Scheduler { | ||
@@ -4,0 +5,0 @@ constructor(job, interval) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.bufferArrayUniqueItems = exports.bufferArrayOrderByLex = exports.bufferArraySubtract = exports.bufferArrayEqual = exports.bufferArrayContainsSome = exports.bufferArrayContains = exports.bufferArrayIncludes = void 0; | ||
const buffer_set_1 = require("../data_structures/buffer_set"); | ||
exports.bufferArrayIncludes = (arr, val) => arr.find(a => a.equals(val)) !== undefined; | ||
exports.bufferArrayContains = (arr1, arr2) => arr2.every(val => exports.bufferArrayIncludes(arr1, val)); | ||
exports.bufferArrayContainsSome = (arr1, arr2) => arr2.some(val => exports.bufferArrayIncludes(arr1, val)); | ||
exports.bufferArrayEqual = (arr1, arr2) => arr1.length === arr2.length && arr1.every((val, index) => val.equals(arr2[index])); | ||
exports.bufferArraySubtract = (arr1, arr2) => arr1.filter(a => !exports.bufferArrayIncludes(arr2, a)); | ||
exports.bufferArrayOrderByLex = (arr1) => { | ||
const bufferArrayIncludes = (arr, val) => arr.find(a => a.equals(val)) !== undefined; | ||
exports.bufferArrayIncludes = bufferArrayIncludes; | ||
const bufferArrayContains = (arr1, arr2) => arr2.every(val => exports.bufferArrayIncludes(arr1, val)); | ||
exports.bufferArrayContains = bufferArrayContains; | ||
const bufferArrayContainsSome = (arr1, arr2) => arr2.some(val => exports.bufferArrayIncludes(arr1, val)); | ||
exports.bufferArrayContainsSome = bufferArrayContainsSome; | ||
const bufferArrayEqual = (arr1, arr2) => arr1.length === arr2.length && arr1.every((val, index) => val.equals(arr2[index])); | ||
exports.bufferArrayEqual = bufferArrayEqual; | ||
const bufferArraySubtract = (arr1, arr2) => arr1.filter(a => !exports.bufferArrayIncludes(arr2, a)); | ||
exports.bufferArraySubtract = bufferArraySubtract; | ||
const bufferArrayOrderByLex = (arr1) => { | ||
const sortedArray = [...arr1]; | ||
@@ -14,3 +20,5 @@ sortedArray.sort((a, b) => a.compare(b)); | ||
}; | ||
exports.bufferArrayUniqueItems = (arr1) => arr1.length === new buffer_set_1.BufferSet([...arr1]).size; | ||
exports.bufferArrayOrderByLex = bufferArrayOrderByLex; | ||
const bufferArrayUniqueItems = (arr1) => arr1.length === new buffer_set_1.BufferSet([...arr1]).size; | ||
exports.bufferArrayUniqueItems = bufferArrayUniqueItems; | ||
//# sourceMappingURL=buffer_array.js.map |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.cloneDeep = void 0; | ||
const cloneDeep = require("lodash.clonedeep"); | ||
exports.cloneDeep = cloneDeep; | ||
__export(require("./buffer_array")); | ||
__export(require("./merge_deep")); | ||
__exportStar(require("./buffer_array"), exports); | ||
__exportStar(require("./merge_deep"), exports); | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.mergeDeep = void 0; | ||
const isIterable = (item) => typeof item === 'object' && item !== null && !Array.isArray(item) && !Buffer.isBuffer(item); | ||
exports.mergeDeep = (dest, ...srcs) => { | ||
const mergeDeep = (dest, ...srcs) => { | ||
const result = dest; | ||
@@ -24,2 +25,3 @@ if (!isIterable(result)) { | ||
}; | ||
exports.mergeDeep = mergeDeep; | ||
//# sourceMappingURL=merge_deep.js.map |
{ | ||
"name": "@liskhq/lisk-utils", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Library containing generic utility functions for use with Lisk-related software", | ||
@@ -42,23 +42,22 @@ "author": "Lisk Foundation <admin@lisk.io>, lightcurve GmbH <admin@lightcurve.io>", | ||
"devDependencies": { | ||
"@types/jest": "26.0.13", | ||
"@types/jest-when": "2.7.1", | ||
"@types/jest": "26.0.21", | ||
"@types/jest-when": "2.7.2", | ||
"@types/lodash.clonedeep": "4.5.6", | ||
"@types/node": "12.12.11", | ||
"@typescript-eslint/eslint-plugin": "3.10.1", | ||
"@typescript-eslint/parser": "3.10.1", | ||
"eslint": "7.8.1", | ||
"eslint-config-lisk-base": "1.2.2", | ||
"eslint-config-prettier": "6.11.0", | ||
"eslint-plugin-import": "2.22.0", | ||
"eslint-plugin-jest": "24.0.0", | ||
"jest": "26.4.2", | ||
"@types/node": "12.20.6", | ||
"@typescript-eslint/eslint-plugin": "4.19.0", | ||
"@typescript-eslint/parser": "4.19.0", | ||
"eslint": "7.22.0", | ||
"eslint-config-lisk-base": "2.0.0", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-jest": "24.3.2", | ||
"jest": "26.6.3", | ||
"jest-extended": "0.11.5", | ||
"jest-when": "2.7.2", | ||
"prettier": "2.0.5", | ||
"jest-when": "3.2.1", | ||
"prettier": "2.2.1", | ||
"source-map-support": "0.5.19", | ||
"ts-jest": "26.3.0", | ||
"ts-node": "8.6.2", | ||
"ts-jest": "26.5.4", | ||
"ts-node": "9.1.1", | ||
"tsconfig-paths": "3.9.0", | ||
"typescript": "3.8.3" | ||
"typescript": "4.2.3" | ||
} | ||
} |
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34647
19
552
1