Skip to content

Commit

Permalink
Add a bugfix for the polyfil
Browse files Browse the repository at this point in the history
  • Loading branch information
saulshanabrook committed Jul 29, 2016
1 parent c813039 commit 1974af7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions inject/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require("imports?this=>window!webcrypto-shim");

import {parse, stringify} from "../src/serializeBinary";

declare var require: any;
Expand Down
2 changes: 1 addition & 1 deletion inject/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var failPlugin = require('webpack-fail-plugin');
var webpack = require('webpack');

module.exports = {
entry: ['babel-polyfill', 'webcrypto-shim', './index.ts'],
entry: ['babel-polyfill', './index.ts'],
output: {
filename: "./dist/index.js",
},
Expand Down
2 changes: 1 addition & 1 deletion src/serializeBinary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const CryptoKeySerializer: Serializer<CryptoKeyWithData | CryptoKey, CryptoKeySe
isType: (o: any) => {
const localStr = o.toLocaleString();
// can't use CryptoKey or constructor on WebView iOS
const isCryptoKey = localStr === "[object CryptoKey]" || localStr === "[object Key]";
const isCryptoKey = localStr === "[object CryptoKey]" || localStr === "[object Key]" || (o.constructor && o.constructor.name === "CryptoKey");
const isCryptoKeyWithData = o._jwk && !o.serialized;
return isCryptoKey || isCryptoKeyWithData;
},
Expand Down

0 comments on commit 1974af7

Please sign in to comment.