From a015d4f46a3b5cc9ab0fdec78901932b2502cc4e Mon Sep 17 00:00:00 2001 From: cupcakearmy Date: Sun, 31 Mar 2019 16:00:24 +0200 Subject: [PATCH] add different import options --- package.json | 2 +- src/index.ts | 5 +++++ test/main.js | 18 +++++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9eab6f4..4e7d6c2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index c220f82..3b3fc35 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,4 +4,9 @@ import RSA from './RSA' export default { RSA, AES, +} + +export { + AES, + RSA, } \ No newline at end of file diff --git a/test/main.js b/test/main.js index 23065ea..da3fbd1 100644 --- a/test/main.js +++ b/test/main.js @@ -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', () => {