Skip to content

Commit

Permalink
fix: update polyfills path
Browse files Browse the repository at this point in the history
  • Loading branch information
getlarge committed Mar 9, 2021
1 parent e76c622 commit 57a3e89
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/Ed25519Keypair.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Code is Apache-2.0 and docs are CC-BY-4.0

import base58 from 'bs58'
import nacl from 'tweetnacl'
import { sign } from 'tweetnacl'

/**
* @public
Expand All @@ -14,7 +14,7 @@ import nacl from 'tweetnacl'
* @property {string} privateKey
*/
export default function Ed25519Keypair(seed) {
const keyPair = seed ? nacl.sign.keyPair.fromSeed(seed) : nacl.sign.keyPair()
const keyPair = seed ? sign.keyPair.fromSeed(seed) : sign.keyPair()
this.publicKey = base58.encode(Buffer.from(keyPair.publicKey))
// tweetnacl's generated secret key is the secret key + public key (resulting in a 64-byte buffer)
this.privateKey = base58.encode(Buffer.from(keyPair.secretKey.slice(0, 32)))
Expand Down
10 changes: 5 additions & 5 deletions src/sanitize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
// Code is Apache-2.0 and docs are CC-BY-4.0

import coreIncludes from 'core-js/library/fn/array/includes'
import coreObjectEntries from 'core-js/library/fn/object/entries'
import 'core-js/features/array/includes';
import 'core-js/features/object/entries';


/**
Expand All @@ -14,8 +14,8 @@ import coreObjectEntries from 'core-js/library/fn/object/entries'
*/
function filterFromObject(obj, filter, { isInclusion = true } = {}) {
if (filter && Array.isArray(filter)) {
return applyFilterOnObject(obj, isInclusion ? (val => coreIncludes(filter, val))
: (val => !coreIncludes(filter, val)))
return applyFilterOnObject(obj, isInclusion ? (val => filter.includes(val))
: (val => !filter.includes(val)))
} else if (filter && typeof filter === 'function') {
// Flip the filter fn's return if it's for inclusion
return applyFilterOnObject(obj, isInclusion ? filter
Expand All @@ -36,7 +36,7 @@ function applyFilterOnObject(obj, filterFn) {
}

const filteredObj = {}
coreObjectEntries(obj).forEach(([key, val]) => {
Object.entries(obj).forEach(([key, val]) => {
if (filterFn(val, key)) {
filteredObj[key] = val
}
Expand Down
4 changes: 2 additions & 2 deletions src/stringify_as_query_param.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
// Code is Apache-2.0 and docs are CC-BY-4.0

import coreObjectEntries from 'core-js/library/fn/object/entries'
import 'core-js/features/object/entries'
import decamelize from 'decamelize'
import queryString from 'query-string'

Expand Down Expand Up @@ -38,7 +38,7 @@ export default function stringifyAsQueryParam(obj, transform = decamelize) {
return ''
}

const transformedKeysObj = coreObjectEntries(obj).reduce((paramsObj, [key, value]) => {
const transformedKeysObj = Object.entries(obj).reduce((paramsObj, [key, value]) => {
paramsObj[transform(key)] = value
return paramsObj
}, {})
Expand Down

0 comments on commit 57a3e89

Please sign in to comment.