@yume-chan/struct 0.0.9 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/CHANGELOG.json +65 -0
  2. package/CHANGELOG.md +39 -0
  3. package/LICENSE +21 -21
  4. package/README.md +769 -709
  5. package/esm/basic/definition.d.ts +44 -0
  6. package/esm/basic/definition.d.ts.map +1 -0
  7. package/esm/basic/definition.js +13 -9
  8. package/esm/basic/definition.js.map +1 -1
  9. package/esm/basic/field-value.d.ts +38 -0
  10. package/esm/basic/field-value.d.ts.map +1 -0
  11. package/esm/basic/field-value.js +13 -7
  12. package/esm/basic/field-value.js.map +1 -1
  13. package/esm/basic/index.d.ts +6 -0
  14. package/esm/basic/index.d.ts.map +1 -0
  15. package/esm/basic/index.js +5 -4
  16. package/esm/basic/index.js.map +1 -1
  17. package/esm/basic/options.d.ts +10 -0
  18. package/esm/basic/options.d.ts.map +1 -0
  19. package/esm/basic/{context.js → options.js} +1 -1
  20. package/esm/basic/options.js.map +1 -0
  21. package/esm/basic/stream.d.ts +19 -0
  22. package/esm/basic/stream.d.ts.map +1 -0
  23. package/esm/basic/stream.js +2 -0
  24. package/esm/basic/stream.js.map +1 -0
  25. package/{dts → esm}/basic/struct-value.d.ts +3 -3
  26. package/esm/basic/struct-value.d.ts.map +1 -0
  27. package/esm/basic/struct-value.js +7 -15
  28. package/esm/basic/struct-value.js.map +1 -1
  29. package/esm/index.d.ts +14 -0
  30. package/esm/index.d.ts.map +1 -0
  31. package/esm/index.js +5 -5
  32. package/esm/index.js.map +1 -1
  33. package/{dts → esm}/struct.d.ts +25 -22
  34. package/esm/struct.d.ts.map +1 -0
  35. package/esm/struct.js +75 -52
  36. package/esm/struct.js.map +1 -1
  37. package/esm/syncbird.d.ts +65 -0
  38. package/esm/syncbird.d.ts.map +1 -0
  39. package/esm/syncbird.js +38 -0
  40. package/esm/syncbird.js.map +1 -0
  41. package/esm/types/bigint.d.ts +25 -0
  42. package/esm/types/bigint.d.ts.map +1 -0
  43. package/esm/types/bigint.js +45 -0
  44. package/esm/types/bigint.js.map +1 -0
  45. package/esm/types/buffer/base.d.ts +63 -0
  46. package/esm/types/buffer/base.d.ts.map +1 -0
  47. package/esm/types/buffer/base.js +100 -0
  48. package/esm/types/buffer/base.js.map +1 -0
  49. package/esm/types/buffer/fixed-length.d.ts +8 -0
  50. package/esm/types/buffer/fixed-length.d.ts.map +1 -0
  51. package/esm/types/buffer/fixed-length.js +8 -0
  52. package/esm/types/buffer/fixed-length.js.map +1 -0
  53. package/esm/types/buffer/index.d.ts +4 -0
  54. package/esm/types/buffer/index.d.ts.map +1 -0
  55. package/esm/types/buffer/index.js +4 -0
  56. package/esm/types/buffer/index.js.map +1 -0
  57. package/esm/types/buffer/variable-length.d.ts +43 -0
  58. package/esm/types/buffer/variable-length.d.ts.map +1 -0
  59. package/esm/types/buffer/variable-length.js +76 -0
  60. package/esm/types/buffer/variable-length.js.map +1 -0
  61. package/esm/types/index.d.ts +4 -0
  62. package/esm/types/index.d.ts.map +1 -0
  63. package/esm/types/index.js +3 -4
  64. package/esm/types/index.js.map +1 -1
  65. package/esm/types/number.d.ts +32 -0
  66. package/esm/types/number.d.ts.map +1 -0
  67. package/esm/types/number.js +26 -18
  68. package/esm/types/number.js.map +1 -1
  69. package/{dts → esm}/utils.d.ts +3 -2
  70. package/{dts → esm}/utils.d.ts.map +1 -1
  71. package/esm/utils.js +16 -0
  72. package/esm/utils.js.map +1 -1
  73. package/package.json +46 -49
  74. package/src/basic/definition.ts +70 -69
  75. package/src/basic/field-value.ts +67 -73
  76. package/src/basic/index.ts +5 -4
  77. package/src/basic/options.ts +19 -0
  78. package/src/basic/stream.ts +19 -0
  79. package/src/basic/struct-value.ts +39 -45
  80. package/src/index.ts +17 -5
  81. package/src/struct.ts +609 -575
  82. package/src/syncbird.ts +131 -0
  83. package/src/types/bigint.ts +102 -0
  84. package/src/types/buffer/base.ts +176 -0
  85. package/src/types/buffer/fixed-length.ts +17 -0
  86. package/src/types/buffer/index.ts +3 -0
  87. package/src/types/buffer/variable-length.ts +156 -0
  88. package/src/types/index.ts +3 -4
  89. package/src/types/number.ts +115 -100
  90. package/src/utils.ts +70 -51
  91. package/cjs/basic/context.js +0 -7
  92. package/cjs/basic/context.js.map +0 -1
  93. package/cjs/basic/definition.js +0 -25
  94. package/cjs/basic/definition.js.map +0 -1
  95. package/cjs/basic/field-value.js +0 -40
  96. package/cjs/basic/field-value.js.map +0 -1
  97. package/cjs/basic/index.js +0 -8
  98. package/cjs/basic/index.js.map +0 -1
  99. package/cjs/basic/struct-value.js +0 -46
  100. package/cjs/basic/struct-value.js.map +0 -1
  101. package/cjs/index.js +0 -11
  102. package/cjs/index.js.map +0 -1
  103. package/cjs/struct.js +0 -177
  104. package/cjs/struct.js.map +0 -1
  105. package/cjs/types/array-buffer.js +0 -118
  106. package/cjs/types/array-buffer.js.map +0 -1
  107. package/cjs/types/fixed-length-array-buffer.js +0 -12
  108. package/cjs/types/fixed-length-array-buffer.js.map +0 -1
  109. package/cjs/types/index.js +0 -8
  110. package/cjs/types/index.js.map +0 -1
  111. package/cjs/types/number.js +0 -52
  112. package/cjs/types/number.js.map +0 -1
  113. package/cjs/types/variable-length-array-buffer.js +0 -77
  114. package/cjs/types/variable-length-array-buffer.js.map +0 -1
  115. package/cjs/utils.js +0 -11
  116. package/cjs/utils.js.map +0 -1
  117. package/dts/basic/context.d.ts +0 -36
  118. package/dts/basic/context.d.ts.map +0 -1
  119. package/dts/basic/definition.d.ts +0 -48
  120. package/dts/basic/definition.d.ts.map +0 -1
  121. package/dts/basic/field-value.d.ts +0 -40
  122. package/dts/basic/field-value.d.ts.map +0 -1
  123. package/dts/basic/index.d.ts +0 -5
  124. package/dts/basic/index.d.ts.map +0 -1
  125. package/dts/basic/struct-value.d.ts.map +0 -1
  126. package/dts/index.d.ts +0 -6
  127. package/dts/index.d.ts.map +0 -1
  128. package/dts/struct.d.ts.map +0 -1
  129. package/dts/types/array-buffer.d.ts +0 -70
  130. package/dts/types/array-buffer.d.ts.map +0 -1
  131. package/dts/types/fixed-length-array-buffer.d.ts +0 -8
  132. package/dts/types/fixed-length-array-buffer.d.ts.map +0 -1
  133. package/dts/types/index.d.ts +0 -5
  134. package/dts/types/index.d.ts.map +0 -1
  135. package/dts/types/number.d.ts +0 -33
  136. package/dts/types/number.d.ts.map +0 -1
  137. package/dts/types/variable-length-array-buffer.d.ts +0 -32
  138. package/dts/types/variable-length-array-buffer.d.ts.map +0 -1
  139. package/esm/basic/context.js.map +0 -1
  140. package/esm/types/array-buffer.js +0 -109
  141. package/esm/types/array-buffer.js.map +0 -1
  142. package/esm/types/fixed-length-array-buffer.js +0 -8
  143. package/esm/types/fixed-length-array-buffer.js.map +0 -1
  144. package/esm/types/variable-length-array-buffer.js +0 -71
  145. package/esm/types/variable-length-array-buffer.js.map +0 -1
  146. package/src/basic/context.ts +0 -42
  147. package/src/types/array-buffer.ts +0 -184
  148. package/src/types/fixed-length-array-buffer.ts +0 -17
  149. package/src/types/variable-length-array-buffer.ts +0 -145
  150. package/tsconfig.cjs.json +0 -11
  151. package/tsconfig.esm.json +0 -15
package/CHANGELOG.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@yume-chan/struct",
3
+ "entries": [
4
+ {
5
+ "version": "0.0.13",
6
+ "tag": "@yume-chan/struct_v0.0.13",
7
+ "date": "Thu, 28 Apr 2022 01:23:53 GMT",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "comment": "Fix an issue that `uint64` still deserialize to negative numbers"
12
+ },
13
+ {
14
+ "comment": "Fix an issue where `Syncbird` can't synchronously invoke `then` on some Bluebird internal methods (for example `reduce`)"
15
+ }
16
+ ]
17
+ }
18
+ },
19
+ {
20
+ "version": "0.0.12",
21
+ "tag": "@yume-chan/struct_v0.0.12",
22
+ "date": "Sun, 03 Apr 2022 11:18:47 GMT",
23
+ "comments": {}
24
+ },
25
+ {
26
+ "version": "0.0.11",
27
+ "tag": "@yume-chan/struct_v0.0.11",
28
+ "date": "Sun, 03 Apr 2022 11:18:11 GMT",
29
+ "comments": {
30
+ "none": [
31
+ {
32
+ "comment": "Update to use Web Streams API"
33
+ },
34
+ {
35
+ "comment": "Improve compatibility with Node.js 12 ESM format"
36
+ },
37
+ {
38
+ "comment": "Update compatibility matrix"
39
+ },
40
+ {
41
+ "comment": "Update license year"
42
+ }
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "version": "0.0.10",
48
+ "tag": "@yume-chan/struct_v0.0.10",
49
+ "date": "Sun, 09 Jan 2022 15:52:20 GMT",
50
+ "comments": {
51
+ "none": [
52
+ {
53
+ "comment": "Add synchronized deserialize support"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "version": "0.0.9",
60
+ "tag": "@yume-chan/struct_v0.0.9",
61
+ "date": "Sun, 09 Jan 2022 15:50:20 GMT",
62
+ "comments": {}
63
+ }
64
+ ]
65
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,39 @@
1
+ # Change Log - @yume-chan/struct
2
+
3
+ This log was last generated on Thu, 28 Apr 2022 01:23:53 GMT and should not be manually modified.
4
+
5
+ ## 0.0.13
6
+ Thu, 28 Apr 2022 01:23:53 GMT
7
+
8
+ ### Updates
9
+
10
+ - Fix an issue that `uint64` still deserialize to negative numbers
11
+ - Fix an issue where `Syncbird` can't synchronously invoke `then` on some Bluebird internal methods (for example `reduce`)
12
+
13
+ ## 0.0.12
14
+ Sun, 03 Apr 2022 11:18:47 GMT
15
+
16
+ _Version update only_
17
+
18
+ ## 0.0.11
19
+ Sun, 03 Apr 2022 11:18:11 GMT
20
+
21
+ ### Updates
22
+
23
+ - Update to use Web Streams API
24
+ - Improve compatibility with Node.js 12 ESM format
25
+ - Update compatibility matrix
26
+ - Update license year
27
+
28
+ ## 0.0.10
29
+ Sun, 09 Jan 2022 15:52:20 GMT
30
+
31
+ ### Updates
32
+
33
+ - Add synchronized deserialize support
34
+
35
+ ## 0.0.9
36
+ Sun, 09 Jan 2022 15:50:20 GMT
37
+
38
+ _Initial release_
39
+
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2020 Simon Chan
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2020-2022 Simon Chan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.