This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { privateDecrypt } = require('crypto'); | |
const eccrypto = require('eccrypto'); | |
const oldPrivateKey = '-----BEGIN PRIVATE KEY-----\n' + | |
///PRIVATE KEY CODE | |
'-----END PRIVATE KEY-----'; | |
const data = 'some base64'; | |
const decryptpedDoc = privateDecrypt(oldPrivateKey, Buffer.from(data, 'base64')); | |
const decryptpedDocString = decryptpedDoc.toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compileOnSave": true, | |
"compilerOptions": { | |
"noEmit": true, | |
"module": "commonjs", | |
"inlineSourceMap": true, | |
"inlineSources": true, | |
"target": "es2016", | |
"pretty": true, | |
"experimentalDecorators": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-config-airbnb" | |
], | |
"rules": { | |
"no-trailing-whitespace": [true, "ignore-template-strings"], | |
"variable-name": [true, "allow-pascal-case"], | |
"no-implicit-dependencies": [true, "dev"], | |
"interface-name": [true, "always-prefix"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Takes a deeply nested object, `source`, and returns an object with | |
* dot-separated paths pointing to all primitive values from `source`. | |
* | |
* Examples: | |
* | |
* flatten({ foo: { bar: 1 } }) | |
* //=> { 'foo.bar': 1 } | |
* | |
* flatten({ foo: [{ bar: 1 }, { bar: 2 }] }) |