-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sodium is now a peerDependency making it easier to use it in a browse…
…r env without the need of installing also sodium
- Loading branch information
Showing
5 changed files
with
19 additions
and
6 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let toExport; | ||
// tslint:disable no-var-requires | ||
try { | ||
toExport = require('sodium'); | ||
if (typeof(toExport) === 'undefined' || typeof(toExport.api) === 'undefined') { | ||
throw new Error('switch to JS implementation'); | ||
} | ||
} catch (err) { | ||
// Sodium does not exist. | ||
toExport = require('../browser/sodium'); | ||
} | ||
export const api = toExport.api; |
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
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