add different import options

This commit is contained in:
cupcakearmy 2019-03-31 16:00:24 +02:00
parent c52623da0c
commit a015d4f46a
3 changed files with 23 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "occulto",
"version": "1.0.2",
"version": "1.0.3",
"description": "crypt utility",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",

View File

@ -4,4 +4,9 @@ import RSA from './RSA'
export default {
RSA,
AES,
}
export {
AES,
RSA,
}

View File

@ -1,7 +1,23 @@
const { describe, it } = require('mocha')
const a = require('assert')
const { RSA, AES } = require('../').default
describe('Check imports', () => {
it('default', () => {
const Occulto = require('../').default
a.notStrictEqual(undefined, Occulto.RSA)
a.notStrictEqual(undefined, Occulto.AES)
})
it('normal', () => {
const {RSA, AES} = require('../')
a.notStrictEqual(undefined, RSA)
a.notStrictEqual(undefined, AES)
})
})
const { RSA, AES } = require('../')
describe('Asymmetric', () => {