Skip to content

Commit

Permalink
fix: Add backwards compatiblity with CommonJS require() (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapsssito committed Sep 6, 2020
1 parent 99beac9 commit af36905
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 14 deletions.
2 changes: 1 addition & 1 deletion examples/udpsockets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.2",
"react-native-udp": "^3.2.0"
"react-native-udp": "^4.0.1"
},
"devDependencies": {
"@babel/core": "^7.8.4",
Expand Down
31 changes: 19 additions & 12 deletions examples/udpsockets/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,7 @@ balanced-match@^1.0.0:
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=

base64-js@1.3.1, base64-js@^1.1.2, base64-js@^1.2.3:
base64-js@^1.0.2, base64-js@^1.1.2, base64-js@^1.2.3:
version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
Expand Down Expand Up @@ -1817,6 +1817,14 @@ buffer-from@^1.0.0:
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==

buffer@^5.6.0:
version "5.6.0"
resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.6.0.tgz#a31749dc7d81d84db08abf937b6b8c4033f62786"
integrity sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==
dependencies:
base64-js "^1.0.2"
ieee754 "^1.1.4"

bytes@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.0.0.tgz#d32815404d689699f85a4ea4fa8755dd13a96048"
Expand Down Expand Up @@ -3241,6 +3249,11 @@ iconv-lite@^0.6.2:
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"

ieee754@^1.1.4:
version "1.1.13"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"
integrity sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==

ignore@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc"
Expand Down Expand Up @@ -3358,11 +3371,6 @@ ip-regex@^2.1.0:
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9"
integrity sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=

ip-regex@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.1.0.tgz#5ad62f685a14edb421abebc2fff8db94df67b455"
integrity sha512-pKnZpbgCTfH/1NLIlOduP/V+WRXzC2MOz3Qo8xmxk8C5GudJLgK5QyLVXOSWy3ParAH7Eemurl3xjv/WXYFvMA==

is-accessor-descriptor@^0.1.6:
version "0.1.6"
resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
Expand Down Expand Up @@ -5441,14 +5449,13 @@ react-is@^16.12.0, react-is@^16.8.1, react-is@^16.8.4, react-is@^16.8.6:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

react-native-udp@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/react-native-udp/-/react-native-udp-3.2.0.tgz#d32620c762937a2cd21b24c57edfa83982faafb0"
integrity sha512-3Pev5834P2vmj2mjTGDPGEi6eiwRfborxBVyhgNWNTLNCVQcF277CwsUmgRDN0+6PZFrjQX7BiFFDFRIxIRjyg==
react-native-udp@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/react-native-udp/-/react-native-udp-4.0.1.tgz#ed88aa45070a69f60a4460710deca653e907e6d5"
integrity sha512-uaEDFnLdHeAx0d7ea8uXJeQwjltfoqhvrj9/gntuOtDFq326fZBwqZgd8PQBke1q/R/ZBBZr0s4SBNfl3GwirQ==
dependencies:
base64-js "1.3.1"
buffer "^5.6.0"
events "^3.1.0"
ip-regex "^4.1.0"

react-native@0.63.2:
version "0.63.2"
Expand Down
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UdpSocket from './UdpSocket'

export default class UdpSockets {
class UdpSockets {
/**
* Creates a `UdpSockets.Socket` object. Once the socket is created, calling
* `socket.bind()` will instruct the socket tobegin listening for datagram
Expand All @@ -21,3 +21,7 @@ export default class UdpSockets {

static Socket = UdpSocket
}

export default UdpSockets

module.exports = UdpSockets

0 comments on commit af36905

Please sign in to comment.