Skip to content

Commit

Permalink
fix: Correct typos and use ESM throughout
Browse files Browse the repository at this point in the history
  • Loading branch information
iainjreid committed Apr 20, 2020
1 parent 43434eb commit 1b665b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const keyOptions = [
*
* @returns {Promise<CryptoKey>}
*/
exports.generateKey = () => {
export function generateKey() {
return crypto.subtle.generateKey(...keyOptions)
}

Expand All @@ -41,7 +41,7 @@ exports.generateKey = () => {
*
* @returns {Promise<CryptoKey>}
*/
exports.importKey = (key) => {
export function importKey(key) {
return crypto.subtle.importKey('raw', key, ...keyOptions)
}

Expand All @@ -52,14 +52,14 @@ exports.importKey = (key) => {
*
* @returns {Promise<ArrayBuffer>}
*/
exports.exports.ey = (key) => {
return crypto.subtle.exports.ey('raw', key)
export function exportKey = (key) => {
return crypto.subtle.exportKey('raw', key)
}

/**
* Class holding the core functionality of the Pat SDK
*/
exports.PatSDK = class PatSDK {
export class PatSDK {
/**
* Create an instance of the Pat SDK.
*
Expand Down Expand Up @@ -163,7 +163,7 @@ exports.PatSDK = class PatSDK {
*
* @abstract
*/
exports.DataStore = class DataStore {
export class DataStore {
constructor() {
if (new.target === DataStore) {
throw new TypeError('DataStore is abstract and must be extended')
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.0.0",
"description": "Web SDK for the Pat Project",
"main": "lib/sdk.js",
"type": "module",
"directories": {
"lib": "lib"
},
Expand All @@ -19,5 +20,9 @@
"bugs": {
"url": "https://github.com/pat-project/web-sdk/issues"
},
"homepage": "https://github.com/pat-project/web-sdk#readme"
"homepage": "https://github.com/pat-project/web-sdk#readme",
"devDependencies": {
"jest": "^25.4.0",
"jest-puppeteer": "^4.4.0"
}
}

0 comments on commit 1b665b5

Please sign in to comment.