From 95da47f6da9e6d471e1769971df09c197438f7b7 Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Fri, 10 May 2024 00:39:16 -0400 Subject: [PATCH] resolve esm for react native --- package.json | 1 + src/mechs/aes/aes_cmac.ts | 2 +- src/mechs/rsa/rsa_es.ts | 2 +- src/subtle.ts | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5107e80..460844b 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ ], "main": "build/webcrypto.js", "module": "build/webcrypto.es.js", + "react-native": "build/webcrypto.es.js", "types": "index.d.ts", "scripts": { "test": "mocha", diff --git a/src/mechs/aes/aes_cmac.ts b/src/mechs/aes/aes_cmac.ts index 8cfcf0d..71ccc12 100644 --- a/src/mechs/aes/aes_cmac.ts +++ b/src/mechs/aes/aes_cmac.ts @@ -1,5 +1,5 @@ import { Buffer } from "buffer"; -import * as crypto from "crypto"; +import crypto from "crypto"; import * as core from "webcrypto-core"; import { AesCrypto } from "./crypto"; import { AesCryptoKey } from "./key"; diff --git a/src/mechs/rsa/rsa_es.ts b/src/mechs/rsa/rsa_es.ts index 23b1e98..09df67c 100644 --- a/src/mechs/rsa/rsa_es.ts +++ b/src/mechs/rsa/rsa_es.ts @@ -1,4 +1,4 @@ -import * as crypto from "crypto"; +import crypto from "crypto"; import { Convert } from "pvtsutils"; import * as core from "webcrypto-core"; import { RsaCrypto } from "./crypto"; diff --git a/src/subtle.ts b/src/subtle.ts index 898a6e4..c888258 100644 --- a/src/subtle.ts +++ b/src/subtle.ts @@ -1,4 +1,4 @@ -import * as crypto from "crypto"; +import crypto from "crypto"; import * as process from "process"; import * as core from "webcrypto-core"; import {