@endpass/utils
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -1,5 +0,5 @@ | ||
export const uniq = arr => | ||
module.exports.uniq = arr => | ||
arr.reduce((acc, item) => (acc.includes(item) ? acc : acc.concat(item)), []); | ||
export const mapArrayByProp = (arr, prop) => | ||
module.exports.mapArrayByProp = (arr, prop) => | ||
arr.reduce((acc, item) => { | ||
@@ -16,6 +16,1 @@ const target = item[prop]; | ||
}, {}); | ||
export default { | ||
uniq, | ||
mapArrayByProp, | ||
}; |
const get = require('lodash.get'); | ||
const identity = require('lodash.identity'); | ||
export const asyncCheckProperty = ( | ||
module.exports.asyncCheckProperty = ( | ||
object, | ||
@@ -6,0 +6,0 @@ path, |
@@ -9,9 +9,4 @@ const dayjs = require('dayjs'); | ||
export const formateDate = date => dayjs(date).format('YYYY-MM-DD H:mm'); | ||
module.exports.formateDate = date => dayjs(date).format('YYYY-MM-DD H:mm'); | ||
export const fromNow = date => dayjs(date).fromNow(); | ||
export default { | ||
formateDate, | ||
fromNow, | ||
}; | ||
module.exports.fromNow = date => dayjs(date).fromNow(); |
@@ -1,3 +0,3 @@ | ||
export default function getOptionParameter(item, value) { | ||
module.exports.getOptionParameter = (item, value) => { | ||
return item instanceof Object ? item[value] : item; | ||
} |
@@ -1,5 +0,1 @@ | ||
export const stripHexPrefix = hex => hex.replace(/^0x/, ''); | ||
export default { | ||
stripHexPrefix, | ||
}; | ||
module.exports.stripHexPrefix = hex => hex.replace(/^0x/, ''); |
@@ -15,3 +15,3 @@ const keythereum = require('keythereum'); | ||
export default { | ||
module.exports = { | ||
// Encrypts a private key Buffer into a V3 keystore object | ||
@@ -18,0 +18,0 @@ // The exported keystore does NOT include an address |
@@ -1,5 +0,1 @@ | ||
export const isNumeric = n => !isNaN(parseFloat(n)) && isFinite(n); | ||
export default { | ||
isNumeric, | ||
}; | ||
module.exports.isNumeric = n => !isNaN(parseFloat(n)) && isFinite(n); |
const get = require('lodash.get'); | ||
export const merge = (...obj) => | ||
module.exports.merge = (...obj) => | ||
obj.reduce((acc, item) => Object.assign(acc, item), {}); | ||
export const getFrom = (target, ...paths) => { | ||
module.exports.getFrom = (target, ...paths) => { | ||
const existPath = paths.find(path => get(target, path)); | ||
@@ -15,6 +15,1 @@ | ||
}; | ||
export default { | ||
merge, | ||
getFrom | ||
}; |
@@ -1,9 +0,4 @@ | ||
export const getShortStringWithEllipsis = (string, symbolsCount = 4) => | ||
module.exports.getShortStringWithEllipsis = (string, symbolsCount = 4) => | ||
`${string.slice(0, symbolsCount)}...${string.slice(-symbolsCount)}`; | ||
export const matchString = (a, b) => new RegExp(b, 'i').test(a); | ||
export default { | ||
getShortStringWithEllipsis, | ||
matchString | ||
}; | ||
module.exports.matchString = (a, b) => new RegExp(b, 'i').test(a); |
@@ -111,3 +111,3 @@ const getFrom = require('./objects'); | ||
export const generateStubs = (Component) => { | ||
module.exports.generateStubs = (Component) => { | ||
return Object.values(Component.components).reduce((stubs, stubComponent) => { | ||
@@ -129,5 +129,1 @@ let elementName; | ||
} | ||
export default { | ||
generateStubs, | ||
}; |
{ | ||
"name": "@endpass/utils", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Utilis and helper functions", | ||
@@ -44,3 +44,3 @@ "author": "Endpass, Inc", | ||
}, | ||
"gitHead": "b995244018d23f65380dc532216318d97521afd2" | ||
"gitHead": "82f7f3f19065e37b294c82ad51d71fe4620020d1" | ||
} |
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
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
9271
263