node-red-contrib-tak-registration 0.14.0 → 0.15.0

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 (447) hide show
  1. package/README.md +1 -1
  2. package/node_modules/@types/geojson/README.md +1 -1
  3. package/node_modules/@types/geojson/index.d.ts +36 -2
  4. package/node_modules/@types/geojson/package.json +2 -2
  5. package/node_modules/@types/node/README.md +2 -2
  6. package/node_modules/@types/node/assert.d.ts +14 -0
  7. package/node_modules/@types/node/async_hooks.d.ts +64 -2
  8. package/node_modules/@types/node/buffer.buffer.d.ts +117 -39
  9. package/node_modules/@types/node/buffer.d.ts +6 -13
  10. package/node_modules/@types/node/cluster.d.ts +1 -1
  11. package/node_modules/@types/node/constants.d.ts +14 -12
  12. package/node_modules/@types/node/crypto.d.ts +44 -10
  13. package/node_modules/@types/node/dgram.d.ts +10 -7
  14. package/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
  15. package/node_modules/@types/node/fs/promises.d.ts +23 -26
  16. package/node_modules/@types/node/fs.d.ts +166 -125
  17. package/node_modules/@types/node/globals.d.ts +141 -338
  18. package/node_modules/@types/node/http.d.ts +25 -3
  19. package/node_modules/@types/node/http2.d.ts +3 -4
  20. package/node_modules/@types/node/https.d.ts +3 -1
  21. package/node_modules/@types/node/inspector.d.ts +36 -0
  22. package/node_modules/@types/node/module.d.ts +599 -236
  23. package/node_modules/@types/node/net.d.ts +44 -13
  24. package/node_modules/@types/node/package.json +9 -4
  25. package/node_modules/@types/node/perf_hooks.d.ts +5 -0
  26. package/node_modules/@types/node/process.d.ts +69 -2
  27. package/node_modules/@types/node/querystring.d.ts +2 -3
  28. package/node_modules/@types/node/readline.d.ts +6 -1
  29. package/node_modules/@types/node/sea.d.ts +1 -1
  30. package/node_modules/@types/node/sqlite.d.ts +291 -17
  31. package/node_modules/@types/node/stream/consumers.d.ts +32 -6
  32. package/node_modules/@types/node/stream/web.d.ts +9 -4
  33. package/node_modules/@types/node/stream.d.ts +936 -1000
  34. package/node_modules/@types/node/test.d.ts +169 -137
  35. package/node_modules/@types/node/timers/promises.d.ts +24 -13
  36. package/node_modules/@types/node/timers.d.ts +159 -112
  37. package/node_modules/@types/node/tls.d.ts +34 -1
  38. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +110 -35
  39. package/node_modules/@types/node/util.d.ts +323 -110
  40. package/node_modules/@types/node/v8.d.ts +81 -0
  41. package/node_modules/@types/node/vm.d.ts +21 -6
  42. package/node_modules/@types/node/worker_threads.d.ts +1 -0
  43. package/node_modules/@types/node/zlib.d.ts +167 -36
  44. package/node_modules/axios/CHANGELOG.md +124 -0
  45. package/node_modules/axios/README.md +38 -16
  46. package/node_modules/axios/dist/axios.js +44 -39
  47. package/node_modules/axios/dist/axios.js.map +1 -1
  48. package/node_modules/axios/dist/axios.min.js +2 -1
  49. package/node_modules/axios/dist/axios.min.js.map +1 -1
  50. package/node_modules/axios/dist/browser/axios.cjs +43 -39
  51. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  52. package/node_modules/axios/dist/esm/axios.js +43 -39
  53. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  54. package/node_modules/axios/dist/esm/axios.min.js +2 -1
  55. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  56. package/node_modules/axios/dist/node/axios.cjs +74 -43
  57. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  58. package/node_modules/axios/index.d.cts +3 -2
  59. package/node_modules/axios/index.d.ts +5 -2
  60. package/node_modules/axios/lib/adapters/fetch.js +1 -1
  61. package/node_modules/axios/lib/adapters/http.js +1 -1
  62. package/node_modules/axios/lib/core/Axios.js +11 -2
  63. package/node_modules/axios/lib/core/AxiosHeaders.js +15 -3
  64. package/node_modules/axios/lib/core/buildFullPath.js +3 -2
  65. package/node_modules/axios/lib/env/data.js +1 -1
  66. package/node_modules/axios/lib/helpers/formDataToStream.js +4 -3
  67. package/node_modules/axios/lib/helpers/resolveConfig.js +1 -1
  68. package/node_modules/axios/lib/platform/node/index.js +26 -0
  69. package/node_modules/axios/lib/utils.js +12 -28
  70. package/node_modules/axios/package.json +3 -3
  71. package/node_modules/bignumber.js/CHANGELOG.md +82 -1
  72. package/node_modules/bignumber.js/LICENCE.md +1 -1
  73. package/node_modules/bignumber.js/README.md +6 -4
  74. package/node_modules/bignumber.js/bignumber.d.mts +6 -0
  75. package/node_modules/bignumber.js/bignumber.d.ts +3 -1829
  76. package/node_modules/bignumber.js/bignumber.js +3 -3
  77. package/node_modules/bignumber.js/bignumber.mjs +3 -3
  78. package/node_modules/bignumber.js/package.json +17 -7
  79. package/node_modules/bignumber.js/types.d.ts +1821 -0
  80. package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
  81. package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
  82. package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
  83. package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
  84. package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
  85. package/node_modules/call-bind-apply-helpers/README.md +62 -0
  86. package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
  87. package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
  88. package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
  89. package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
  90. package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
  91. package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
  92. package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
  93. package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
  94. package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
  95. package/node_modules/call-bind-apply-helpers/index.js +15 -0
  96. package/node_modules/call-bind-apply-helpers/package.json +85 -0
  97. package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
  98. package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
  99. package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
  100. package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
  101. package/node_modules/dunder-proto/.eslintrc +5 -0
  102. package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
  103. package/node_modules/dunder-proto/.nycrc +13 -0
  104. package/node_modules/dunder-proto/CHANGELOG.md +24 -0
  105. package/node_modules/dunder-proto/LICENSE +21 -0
  106. package/node_modules/dunder-proto/README.md +54 -0
  107. package/node_modules/dunder-proto/get.d.ts +5 -0
  108. package/node_modules/dunder-proto/get.js +30 -0
  109. package/node_modules/dunder-proto/package.json +76 -0
  110. package/node_modules/dunder-proto/set.d.ts +5 -0
  111. package/node_modules/dunder-proto/set.js +35 -0
  112. package/node_modules/dunder-proto/test/get.js +34 -0
  113. package/node_modules/dunder-proto/test/index.js +4 -0
  114. package/node_modules/dunder-proto/test/set.js +50 -0
  115. package/node_modules/dunder-proto/tsconfig.json +9 -0
  116. package/node_modules/es-define-property/.eslintrc +13 -0
  117. package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
  118. package/node_modules/es-define-property/.nycrc +9 -0
  119. package/node_modules/es-define-property/CHANGELOG.md +29 -0
  120. package/node_modules/es-define-property/LICENSE +21 -0
  121. package/node_modules/es-define-property/README.md +49 -0
  122. package/node_modules/es-define-property/index.d.ts +3 -0
  123. package/node_modules/es-define-property/index.js +14 -0
  124. package/node_modules/es-define-property/package.json +81 -0
  125. package/node_modules/es-define-property/test/index.js +56 -0
  126. package/node_modules/es-define-property/tsconfig.json +10 -0
  127. package/node_modules/es-errors/.eslintrc +5 -0
  128. package/node_modules/es-errors/.github/FUNDING.yml +12 -0
  129. package/node_modules/es-errors/CHANGELOG.md +40 -0
  130. package/node_modules/es-errors/LICENSE +21 -0
  131. package/node_modules/es-errors/README.md +55 -0
  132. package/node_modules/es-errors/eval.d.ts +3 -0
  133. package/node_modules/es-errors/eval.js +4 -0
  134. package/node_modules/es-errors/index.d.ts +3 -0
  135. package/node_modules/es-errors/index.js +4 -0
  136. package/node_modules/es-errors/package.json +80 -0
  137. package/node_modules/es-errors/range.d.ts +3 -0
  138. package/node_modules/es-errors/range.js +4 -0
  139. package/node_modules/es-errors/ref.d.ts +3 -0
  140. package/node_modules/es-errors/ref.js +4 -0
  141. package/node_modules/es-errors/syntax.d.ts +3 -0
  142. package/node_modules/es-errors/syntax.js +4 -0
  143. package/node_modules/es-errors/test/index.js +19 -0
  144. package/node_modules/es-errors/tsconfig.json +49 -0
  145. package/node_modules/es-errors/type.d.ts +3 -0
  146. package/node_modules/es-errors/type.js +4 -0
  147. package/node_modules/es-errors/uri.d.ts +3 -0
  148. package/node_modules/es-errors/uri.js +4 -0
  149. package/node_modules/es-object-atoms/.eslintrc +16 -0
  150. package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
  151. package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
  152. package/node_modules/es-object-atoms/LICENSE +21 -0
  153. package/node_modules/es-object-atoms/README.md +63 -0
  154. package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
  155. package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
  156. package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
  157. package/node_modules/es-object-atoms/ToObject.js +10 -0
  158. package/node_modules/es-object-atoms/index.d.ts +3 -0
  159. package/node_modules/es-object-atoms/index.js +4 -0
  160. package/node_modules/es-object-atoms/isObject.d.ts +3 -0
  161. package/node_modules/es-object-atoms/isObject.js +6 -0
  162. package/node_modules/es-object-atoms/package.json +80 -0
  163. package/node_modules/es-object-atoms/test/index.js +38 -0
  164. package/node_modules/es-object-atoms/tsconfig.json +6 -0
  165. package/node_modules/es-set-tostringtag/.eslintrc +13 -0
  166. package/node_modules/es-set-tostringtag/.nycrc +9 -0
  167. package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
  168. package/node_modules/es-set-tostringtag/LICENSE +21 -0
  169. package/node_modules/es-set-tostringtag/README.md +53 -0
  170. package/node_modules/es-set-tostringtag/index.d.ts +10 -0
  171. package/node_modules/es-set-tostringtag/index.js +35 -0
  172. package/node_modules/es-set-tostringtag/package.json +78 -0
  173. package/node_modules/es-set-tostringtag/test/index.js +85 -0
  174. package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
  175. package/node_modules/fast-xml-parser/CHANGELOG.md +63 -0
  176. package/node_modules/fast-xml-parser/README.md +37 -51
  177. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
  178. package/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
  179. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  180. package/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
  181. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  182. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  183. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  184. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  185. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
  186. package/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
  187. package/node_modules/fast-xml-parser/package.json +36 -18
  188. package/node_modules/fast-xml-parser/src/cli/cli.js +12 -12
  189. package/node_modules/fast-xml-parser/src/cli/man.js +6 -1
  190. package/node_modules/fast-xml-parser/src/cli/read.js +30 -79
  191. package/node_modules/fast-xml-parser/src/fxp.d.ts +28 -1
  192. package/node_modules/fast-xml-parser/src/fxp.js +11 -8
  193. package/node_modules/fast-xml-parser/src/ignoreAttributes.js +2 -4
  194. package/node_modules/fast-xml-parser/src/util.js +14 -18
  195. package/node_modules/fast-xml-parser/src/{v5 → v6}/CharsSymbol.js +1 -1
  196. package/node_modules/fast-xml-parser/src/{v5 → v6}/EntitiesParser.js +3 -6
  197. package/node_modules/fast-xml-parser/src/{v5 → v6}/OptionsBuilder.js +3 -6
  198. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/BaseOutputBuilder.js +1 -3
  199. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsArrBuilder.js +3 -3
  200. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsMinArrBuilder.js +3 -5
  201. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/JsObjBuilder.js +3 -5
  202. package/node_modules/fast-xml-parser/src/{v5 → v6}/OutputBuilders/ParserOptionsBuilder.js +6 -11
  203. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPath.js +1 -1
  204. package/node_modules/fast-xml-parser/src/{v5 → v6}/TagPathMatcher.js +3 -5
  205. package/node_modules/fast-xml-parser/src/{v5 → v6}/XMLParser.js +3 -5
  206. package/node_modules/fast-xml-parser/src/{v5 → v6}/Xml2JsParser.js +8 -10
  207. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlPartReader.js +4 -10
  208. package/node_modules/fast-xml-parser/src/{v5 → v6}/XmlSpecialTagsReader.js +5 -12
  209. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/BufferSource.js +1 -3
  210. package/node_modules/fast-xml-parser/src/{v5 → v6}/inputSource/StringSource.js +1 -3
  211. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/EntitiesParser.js +3 -5
  212. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParser.js +1 -2
  213. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/booleanParserExt.js +1 -2
  214. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/currency.js +1 -3
  215. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/join.js +1 -2
  216. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/number.js +2 -4
  217. package/node_modules/fast-xml-parser/src/{v5 → v6}/valueParsers/trim.js +1 -3
  218. package/node_modules/fast-xml-parser/src/validator.js +5 -5
  219. package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +5 -4
  220. package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +1 -2
  221. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +287 -71
  222. package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +3 -5
  223. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +23 -23
  224. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +21 -8
  225. package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +8 -2
  226. package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +22 -7
  227. package/node_modules/form-data/lib/form_data.js +24 -22
  228. package/node_modules/form-data/package.json +17 -14
  229. package/node_modules/function-bind/.eslintrc +21 -0
  230. package/node_modules/function-bind/.github/FUNDING.yml +12 -0
  231. package/node_modules/function-bind/.github/SECURITY.md +3 -0
  232. package/node_modules/function-bind/.nycrc +13 -0
  233. package/node_modules/function-bind/CHANGELOG.md +136 -0
  234. package/node_modules/function-bind/LICENSE +20 -0
  235. package/node_modules/function-bind/README.md +46 -0
  236. package/node_modules/function-bind/implementation.js +84 -0
  237. package/node_modules/function-bind/index.js +5 -0
  238. package/node_modules/function-bind/package.json +87 -0
  239. package/node_modules/function-bind/test/.eslintrc +9 -0
  240. package/node_modules/function-bind/test/index.js +252 -0
  241. package/node_modules/get-intrinsic/.eslintrc +42 -0
  242. package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
  243. package/node_modules/get-intrinsic/.nycrc +9 -0
  244. package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
  245. package/node_modules/get-intrinsic/LICENSE +21 -0
  246. package/node_modules/get-intrinsic/README.md +71 -0
  247. package/node_modules/get-intrinsic/index.js +378 -0
  248. package/node_modules/get-intrinsic/package.json +97 -0
  249. package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
  250. package/node_modules/get-proto/.eslintrc +10 -0
  251. package/node_modules/get-proto/.github/FUNDING.yml +12 -0
  252. package/node_modules/get-proto/.nycrc +9 -0
  253. package/node_modules/get-proto/CHANGELOG.md +21 -0
  254. package/node_modules/get-proto/LICENSE +21 -0
  255. package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
  256. package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
  257. package/node_modules/get-proto/README.md +50 -0
  258. package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
  259. package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
  260. package/node_modules/get-proto/index.d.ts +5 -0
  261. package/node_modules/get-proto/index.js +27 -0
  262. package/node_modules/get-proto/package.json +81 -0
  263. package/node_modules/get-proto/test/index.js +68 -0
  264. package/node_modules/get-proto/tsconfig.json +9 -0
  265. package/node_modules/gopd/.eslintrc +16 -0
  266. package/node_modules/gopd/.github/FUNDING.yml +12 -0
  267. package/node_modules/gopd/CHANGELOG.md +45 -0
  268. package/node_modules/gopd/LICENSE +21 -0
  269. package/node_modules/gopd/README.md +40 -0
  270. package/node_modules/gopd/gOPD.d.ts +1 -0
  271. package/node_modules/gopd/gOPD.js +4 -0
  272. package/node_modules/gopd/index.d.ts +5 -0
  273. package/node_modules/gopd/index.js +15 -0
  274. package/node_modules/gopd/package.json +77 -0
  275. package/node_modules/gopd/test/index.js +36 -0
  276. package/node_modules/gopd/tsconfig.json +9 -0
  277. package/node_modules/has-symbols/.eslintrc +11 -0
  278. package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
  279. package/node_modules/has-symbols/.nycrc +9 -0
  280. package/node_modules/has-symbols/CHANGELOG.md +91 -0
  281. package/node_modules/has-symbols/LICENSE +21 -0
  282. package/node_modules/has-symbols/README.md +46 -0
  283. package/node_modules/has-symbols/index.d.ts +3 -0
  284. package/node_modules/has-symbols/index.js +14 -0
  285. package/node_modules/has-symbols/package.json +111 -0
  286. package/node_modules/has-symbols/shams.d.ts +3 -0
  287. package/node_modules/has-symbols/shams.js +45 -0
  288. package/node_modules/has-symbols/test/index.js +22 -0
  289. package/node_modules/has-symbols/test/shams/core-js.js +29 -0
  290. package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
  291. package/node_modules/has-symbols/test/tests.js +58 -0
  292. package/node_modules/has-symbols/tsconfig.json +10 -0
  293. package/node_modules/has-tostringtag/.eslintrc +5 -0
  294. package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
  295. package/node_modules/has-tostringtag/.nycrc +13 -0
  296. package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
  297. package/node_modules/has-tostringtag/LICENSE +21 -0
  298. package/node_modules/has-tostringtag/README.md +46 -0
  299. package/node_modules/has-tostringtag/index.d.ts +3 -0
  300. package/node_modules/has-tostringtag/index.js +8 -0
  301. package/node_modules/has-tostringtag/package.json +108 -0
  302. package/node_modules/has-tostringtag/shams.d.ts +3 -0
  303. package/node_modules/has-tostringtag/shams.js +8 -0
  304. package/node_modules/has-tostringtag/test/index.js +21 -0
  305. package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
  306. package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
  307. package/node_modules/has-tostringtag/test/tests.js +15 -0
  308. package/node_modules/has-tostringtag/tsconfig.json +49 -0
  309. package/node_modules/hasown/.eslintrc +5 -0
  310. package/node_modules/hasown/.github/FUNDING.yml +12 -0
  311. package/node_modules/hasown/.nycrc +13 -0
  312. package/node_modules/hasown/CHANGELOG.md +40 -0
  313. package/node_modules/hasown/LICENSE +21 -0
  314. package/node_modules/hasown/README.md +40 -0
  315. package/node_modules/hasown/index.d.ts +3 -0
  316. package/node_modules/hasown/index.js +8 -0
  317. package/node_modules/hasown/package.json +92 -0
  318. package/node_modules/hasown/tsconfig.json +6 -0
  319. package/node_modules/long/README.md +93 -87
  320. package/node_modules/long/index.d.ts +2 -2
  321. package/node_modules/long/index.js +360 -246
  322. package/node_modules/long/package.json +12 -4
  323. package/node_modules/long/types.d.ts +474 -0
  324. package/node_modules/long/umd/index.d.ts +2 -456
  325. package/node_modules/long/umd/index.js +1585 -1395
  326. package/node_modules/long/umd/types.d.ts +474 -0
  327. package/node_modules/math-intrinsics/.eslintrc +16 -0
  328. package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
  329. package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
  330. package/node_modules/math-intrinsics/LICENSE +21 -0
  331. package/node_modules/math-intrinsics/README.md +50 -0
  332. package/node_modules/math-intrinsics/abs.d.ts +1 -0
  333. package/node_modules/math-intrinsics/abs.js +4 -0
  334. package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
  335. package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
  336. package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
  337. package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
  338. package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
  339. package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
  340. package/node_modules/math-intrinsics/floor.d.ts +1 -0
  341. package/node_modules/math-intrinsics/floor.js +4 -0
  342. package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
  343. package/node_modules/math-intrinsics/isFinite.js +12 -0
  344. package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
  345. package/node_modules/math-intrinsics/isInteger.js +16 -0
  346. package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
  347. package/node_modules/math-intrinsics/isNaN.js +6 -0
  348. package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
  349. package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
  350. package/node_modules/math-intrinsics/max.d.ts +1 -0
  351. package/node_modules/math-intrinsics/max.js +4 -0
  352. package/node_modules/math-intrinsics/min.d.ts +1 -0
  353. package/node_modules/math-intrinsics/min.js +4 -0
  354. package/node_modules/math-intrinsics/mod.d.ts +3 -0
  355. package/node_modules/math-intrinsics/mod.js +9 -0
  356. package/node_modules/math-intrinsics/package.json +86 -0
  357. package/node_modules/math-intrinsics/pow.d.ts +1 -0
  358. package/node_modules/math-intrinsics/pow.js +4 -0
  359. package/node_modules/math-intrinsics/round.d.ts +1 -0
  360. package/node_modules/math-intrinsics/round.js +4 -0
  361. package/node_modules/math-intrinsics/sign.d.ts +3 -0
  362. package/node_modules/math-intrinsics/sign.js +11 -0
  363. package/node_modules/math-intrinsics/test/index.js +192 -0
  364. package/node_modules/math-intrinsics/tsconfig.json +3 -0
  365. package/node_modules/protobufjs/dist/light/protobuf.js +531 -80
  366. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  367. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  368. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  369. package/node_modules/protobufjs/dist/minimal/protobuf.js +2 -2
  370. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +2 -2
  371. package/node_modules/protobufjs/dist/protobuf.js +671 -144
  372. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  373. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  374. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  375. package/node_modules/protobufjs/index.d.ts +71 -13
  376. package/node_modules/protobufjs/package.json +4 -2
  377. package/node_modules/protobufjs/src/decoder.js +8 -10
  378. package/node_modules/protobufjs/src/encoder.js +1 -1
  379. package/node_modules/protobufjs/src/enum.js +25 -0
  380. package/node_modules/protobufjs/src/field.js +104 -28
  381. package/node_modules/protobufjs/src/namespace.js +124 -13
  382. package/node_modules/protobufjs/src/object.js +139 -4
  383. package/node_modules/protobufjs/src/oneof.js +19 -0
  384. package/node_modules/protobufjs/src/parse.js +139 -63
  385. package/node_modules/protobufjs/src/root.js +52 -15
  386. package/node_modules/protobufjs/src/service.js +23 -1
  387. package/node_modules/protobufjs/src/type.js +29 -4
  388. package/node_modules/protobufjs/src/util.js +4 -1
  389. package/node_modules/strnum/.github/SECURITY.md +5 -0
  390. package/node_modules/strnum/CHANGELOG.md +33 -0
  391. package/node_modules/strnum/README.md +14 -3
  392. package/node_modules/strnum/algo.stflow +84 -0
  393. package/node_modules/strnum/package.json +9 -2
  394. package/node_modules/strnum/strnum.js +72 -67
  395. package/node_modules/strnum/strnum.test.js +29 -6
  396. package/node_modules/strnum/test.js +9 -0
  397. package/node_modules/undici-types/dispatcher.d.ts +1 -0
  398. package/node_modules/undici-types/package.json +1 -1
  399. package/node_modules/undici-types/readable.d.ts +5 -0
  400. package/node_modules/undici-types/webidl.d.ts +6 -0
  401. package/node_modules/uuid/README.md +12 -12
  402. package/node_modules/uuid/dist/cjs/types.d.ts +1 -1
  403. package/node_modules/uuid/dist/cjs/v1.d.ts +1 -1
  404. package/node_modules/uuid/dist/cjs/v1.js +1 -1
  405. package/node_modules/uuid/dist/cjs/v3.d.ts +1 -1
  406. package/node_modules/uuid/dist/cjs/v35.d.ts +1 -1
  407. package/node_modules/uuid/dist/cjs/v4.d.ts +1 -1
  408. package/node_modules/uuid/dist/cjs/v5.d.ts +1 -1
  409. package/node_modules/uuid/dist/cjs/v6.d.ts +1 -1
  410. package/node_modules/uuid/dist/cjs/v7.d.ts +1 -1
  411. package/node_modules/uuid/dist/cjs/v7.js +1 -1
  412. package/node_modules/uuid/dist/cjs-browser/types.d.ts +1 -1
  413. package/node_modules/uuid/dist/cjs-browser/v1.d.ts +1 -1
  414. package/node_modules/uuid/dist/cjs-browser/v1.js +1 -1
  415. package/node_modules/uuid/dist/cjs-browser/v3.d.ts +1 -1
  416. package/node_modules/uuid/dist/cjs-browser/v35.d.ts +1 -1
  417. package/node_modules/uuid/dist/cjs-browser/v4.d.ts +1 -1
  418. package/node_modules/uuid/dist/cjs-browser/v5.d.ts +1 -1
  419. package/node_modules/uuid/dist/cjs-browser/v6.d.ts +1 -1
  420. package/node_modules/uuid/dist/cjs-browser/v7.d.ts +1 -1
  421. package/node_modules/uuid/dist/cjs-browser/v7.js +1 -1
  422. package/node_modules/uuid/dist/esm/types.d.ts +1 -1
  423. package/node_modules/uuid/dist/esm/v1.d.ts +1 -1
  424. package/node_modules/uuid/dist/esm/v1.js +1 -1
  425. package/node_modules/uuid/dist/esm/v3.d.ts +1 -1
  426. package/node_modules/uuid/dist/esm/v35.d.ts +1 -1
  427. package/node_modules/uuid/dist/esm/v4.d.ts +1 -1
  428. package/node_modules/uuid/dist/esm/v5.d.ts +1 -1
  429. package/node_modules/uuid/dist/esm/v6.d.ts +1 -1
  430. package/node_modules/uuid/dist/esm/v7.d.ts +1 -1
  431. package/node_modules/uuid/dist/esm/v7.js +1 -1
  432. package/node_modules/uuid/dist/esm-browser/types.d.ts +1 -1
  433. package/node_modules/uuid/dist/esm-browser/v1.d.ts +1 -1
  434. package/node_modules/uuid/dist/esm-browser/v1.js +1 -1
  435. package/node_modules/uuid/dist/esm-browser/v3.d.ts +1 -1
  436. package/node_modules/uuid/dist/esm-browser/v35.d.ts +1 -1
  437. package/node_modules/uuid/dist/esm-browser/v4.d.ts +1 -1
  438. package/node_modules/uuid/dist/esm-browser/v5.d.ts +1 -1
  439. package/node_modules/uuid/dist/esm-browser/v6.d.ts +1 -1
  440. package/node_modules/uuid/dist/esm-browser/v7.d.ts +1 -1
  441. package/node_modules/uuid/dist/esm-browser/v7.js +1 -1
  442. package/node_modules/uuid/package.json +1 -1
  443. package/package.json +7 -7
  444. package/tak-registration.html +4 -4
  445. package/tak-registration.js +16 -7
  446. package/node_modules/axios/SECURITY.md +0 -6
  447. /package/node_modules/fast-xml-parser/src/{v5 → v6}/Report.js +0 -0
@@ -35,11 +35,25 @@ function Root(options) {
35
35
  * @type {string[]}
36
36
  */
37
37
  this.files = [];
38
+
39
+ /**
40
+ * Edition, defaults to proto2 if unspecified.
41
+ * @type {string}
42
+ * @private
43
+ */
44
+ this._edition = "proto2";
45
+
46
+ /**
47
+ * Global lookup cache of fully qualified names.
48
+ * @type {Object.<string,ReflectionObject>}
49
+ * @private
50
+ */
51
+ this._fullyQualifiedObjects = {};
38
52
  }
39
53
 
40
54
  /**
41
55
  * Loads a namespace descriptor into a root namespace.
42
- * @param {INamespace} json Nameespace descriptor
56
+ * @param {INamespace} json Namespace descriptor
43
57
  * @param {Root} [root] Root namespace, defaults to create a new one if omitted
44
58
  * @returns {Root} Root namespace
45
59
  */
@@ -48,7 +62,7 @@ Root.fromJSON = function fromJSON(json, root) {
48
62
  root = new Root();
49
63
  if (json.options)
50
64
  root.setOptions(json.options);
51
- return root.addJSON(json.nested);
65
+ return root.addJSON(json.nested).resolveAll();
52
66
  };
53
67
 
54
68
  /**
@@ -88,18 +102,24 @@ Root.prototype.load = function load(filename, options, callback) {
88
102
  options = undefined;
89
103
  }
90
104
  var self = this;
91
- if (!callback)
105
+ if (!callback) {
92
106
  return util.asPromise(load, self, filename, options);
107
+ }
93
108
 
94
109
  var sync = callback === SYNC; // undocumented
95
110
 
96
111
  // Finishes loading by calling the callback (exactly once)
97
112
  function finish(err, root) {
113
+ if (root) {
114
+ root.resolveAll();
115
+ }
98
116
  /* istanbul ignore if */
99
- if (!callback)
117
+ if (!callback) {
100
118
  return;
101
- if (sync)
119
+ }
120
+ if (sync) {
102
121
  throw err;
122
+ }
103
123
  var cb = callback;
104
124
  callback = null;
105
125
  cb(err, root);
@@ -139,8 +159,9 @@ Root.prototype.load = function load(filename, options, callback) {
139
159
  } catch (err) {
140
160
  finish(err);
141
161
  }
142
- if (!sync && !queued)
162
+ if (!sync && !queued) {
143
163
  finish(null, self); // only once anyway
164
+ }
144
165
  }
145
166
 
146
167
  // Fetches a single file
@@ -148,15 +169,16 @@ Root.prototype.load = function load(filename, options, callback) {
148
169
  filename = getBundledFileName(filename) || filename;
149
170
 
150
171
  // Skip if already loaded / attempted
151
- if (self.files.indexOf(filename) > -1)
172
+ if (self.files.indexOf(filename) > -1) {
152
173
  return;
174
+ }
153
175
  self.files.push(filename);
154
176
 
155
177
  // Shortcut bundled definitions
156
178
  if (filename in common) {
157
- if (sync)
179
+ if (sync) {
158
180
  process(filename, common[filename]);
159
- else {
181
+ } else {
160
182
  ++queued;
161
183
  setTimeout(function() {
162
184
  --queued;
@@ -182,8 +204,9 @@ Root.prototype.load = function load(filename, options, callback) {
182
204
  self.fetch(filename, function(err, source) {
183
205
  --queued;
184
206
  /* istanbul ignore if */
185
- if (!callback)
207
+ if (!callback) {
186
208
  return; // terminated meanwhile
209
+ }
187
210
  if (err) {
188
211
  /* istanbul ignore else */
189
212
  if (!weak)
@@ -200,17 +223,21 @@ Root.prototype.load = function load(filename, options, callback) {
200
223
 
201
224
  // Assembling the root namespace doesn't require working type
202
225
  // references anymore, so we can load everything in parallel
203
- if (util.isString(filename))
226
+ if (util.isString(filename)) {
204
227
  filename = [ filename ];
228
+ }
205
229
  for (var i = 0, resolved; i < filename.length; ++i)
206
230
  if (resolved = self.resolvePath("", filename[i]))
207
231
  fetch(resolved);
208
-
209
- if (sync)
232
+ if (sync) {
233
+ self.resolveAll();
210
234
  return self;
211
- if (!queued)
235
+ }
236
+ if (!queued) {
212
237
  finish(null, self);
213
- return undefined;
238
+ }
239
+
240
+ return self;
214
241
  };
215
242
  // function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined
216
243
 
@@ -252,10 +279,13 @@ Root.prototype.loadSync = function loadSync(filename, options) {
252
279
  * @override
253
280
  */
254
281
  Root.prototype.resolveAll = function resolveAll() {
282
+ if (!this._needsRecursiveResolve) return this;
283
+
255
284
  if (this.deferred.length)
256
285
  throw Error("unresolvable extensions: " + this.deferred.map(function(field) {
257
286
  return "'extend " + field.extend + "' in " + field.parent.fullName;
258
287
  }).join(", "));
288
+ this._resolveFeaturesRecursive(this._edition);
259
289
  return Namespace.prototype.resolveAll.call(this);
260
290
  };
261
291
 
@@ -318,6 +348,11 @@ Root.prototype._handleAdd = function _handleAdd(object) {
318
348
  object.parent[object.name] = object; // expose namespace as property of its parent
319
349
  }
320
350
 
351
+ if (object instanceof Type || object instanceof Enum || object instanceof Field) {
352
+ // Only store types and enums for quick lookup during resolve.
353
+ this._fullyQualifiedObjects[object.fullName] = object;
354
+ }
355
+
321
356
  // The above also adds uppercased (and thus conflict-free) nested types, services and enums as
322
357
  // properties of namespaces just like static code does. This allows using a .d.ts generated for
323
358
  // a static module with reflection-based solutions where the condition is met.
@@ -358,6 +393,8 @@ Root.prototype._handleRemove = function _handleRemove(object) {
358
393
  delete object.parent[object.name]; // unexpose namespaces
359
394
 
360
395
  }
396
+
397
+ delete this._fullyQualifiedObjects[object.fullName];
361
398
  };
362
399
 
363
400
  // Sets up cyclic dependencies (called in index-light)
@@ -57,7 +57,10 @@ Service.fromJSON = function fromJSON(name, json) {
57
57
  service.add(Method.fromJSON(names[i], json.methods[names[i]]));
58
58
  if (json.nested)
59
59
  service.addJSON(json.nested);
60
+ if (json.edition)
61
+ service._edition = json.edition;
60
62
  service.comment = json.comment;
63
+ service._defaultEdition = "proto3"; // For backwards-compatibility.
61
64
  return service;
62
65
  };
63
66
 
@@ -70,6 +73,7 @@ Service.prototype.toJSON = function toJSON(toJSONOptions) {
70
73
  var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
71
74
  var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
72
75
  return util.toObject([
76
+ "edition" , this._editionToJSON(),
73
77
  "options" , inherited && inherited.options || undefined,
74
78
  "methods" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},
75
79
  "nested" , inherited && inherited.nested || undefined,
@@ -106,10 +110,28 @@ Service.prototype.get = function get(name) {
106
110
  * @override
107
111
  */
108
112
  Service.prototype.resolveAll = function resolveAll() {
113
+ if (!this._needsRecursiveResolve) return this;
114
+
115
+ Namespace.prototype.resolve.call(this);
109
116
  var methods = this.methodsArray;
110
117
  for (var i = 0; i < methods.length; ++i)
111
118
  methods[i].resolve();
112
- return Namespace.prototype.resolve.call(this);
119
+ return this;
120
+ };
121
+
122
+ /**
123
+ * @override
124
+ */
125
+ Service.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
126
+ if (!this._needsRecursiveFeatureResolution) return this;
127
+
128
+ edition = this._edition || edition;
129
+
130
+ Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
131
+ this.methodsArray.forEach(method => {
132
+ method._resolveFeaturesRecursive(edition);
133
+ });
134
+ return this;
113
135
  };
114
136
 
115
137
  /**
@@ -272,6 +272,9 @@ Type.fromJSON = function fromJSON(name, json) {
272
272
  type.group = true;
273
273
  if (json.comment)
274
274
  type.comment = json.comment;
275
+ if (json.edition)
276
+ type._edition = json.edition;
277
+ type._defaultEdition = "proto3"; // For backwards-compatibility.
275
278
  return type;
276
279
  };
277
280
 
@@ -284,6 +287,7 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
284
287
  var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);
285
288
  var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;
286
289
  return util.toObject([
290
+ "edition" , this._editionToJSON(),
287
291
  "options" , inherited && inherited.options || undefined,
288
292
  "oneofs" , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),
289
293
  "fields" , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},
@@ -299,13 +303,34 @@ Type.prototype.toJSON = function toJSON(toJSONOptions) {
299
303
  * @override
300
304
  */
301
305
  Type.prototype.resolveAll = function resolveAll() {
302
- var fields = this.fieldsArray, i = 0;
303
- while (i < fields.length)
304
- fields[i++].resolve();
306
+ if (!this._needsRecursiveResolve) return this;
307
+
308
+ Namespace.prototype.resolveAll.call(this);
305
309
  var oneofs = this.oneofsArray; i = 0;
306
310
  while (i < oneofs.length)
307
311
  oneofs[i++].resolve();
308
- return Namespace.prototype.resolveAll.call(this);
312
+ var fields = this.fieldsArray, i = 0;
313
+ while (i < fields.length)
314
+ fields[i++].resolve();
315
+ return this;
316
+ };
317
+
318
+ /**
319
+ * @override
320
+ */
321
+ Type.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {
322
+ if (!this._needsRecursiveFeatureResolution) return this;
323
+
324
+ edition = this._edition || edition;
325
+
326
+ Namespace.prototype._resolveFeaturesRecursive.call(this, edition);
327
+ this.oneofsArray.forEach(oneof => {
328
+ oneof._resolveFeatures(edition);
329
+ });
330
+ this.fieldsArray.forEach(field => {
331
+ field._resolveFeatures(edition);
332
+ });
333
+ return this;
309
334
  };
310
335
 
311
336
  /**
@@ -171,9 +171,10 @@ util.decorateEnum = function decorateEnum(object) {
171
171
  * @param {Object.<string,*>} dst Destination object
172
172
  * @param {string} path dot '.' delimited path of the property to set
173
173
  * @param {Object} value the value to set
174
+ * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set
174
175
  * @returns {Object.<string,*>} Destination object
175
176
  */
176
- util.setProperty = function setProperty(dst, path, value) {
177
+ util.setProperty = function setProperty(dst, path, value, ifNotSet) {
177
178
  function setProp(dst, path, value) {
178
179
  var part = path.shift();
179
180
  if (part === "__proto__" || part === "prototype") {
@@ -183,6 +184,8 @@ util.setProperty = function setProperty(dst, path, value) {
183
184
  dst[part] = setProp(dst[part] || {}, path, value);
184
185
  } else {
185
186
  var prevValue = dst[part];
187
+ if (prevValue && ifNotSet)
188
+ return dst;
186
189
  if (prevValue)
187
190
  value = [].concat(prevValue).concat(value);
188
191
  dst[part] = value;
@@ -0,0 +1,5 @@
1
+ If you believe you have found a security vulnerability in this repository which can be potentially harful for the users in anyway, please do not report security vulnerabilities through public GitHub issues. Instead, please report it to us as described below.
2
+
3
+ ## Security contact information
4
+
5
+ To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
@@ -0,0 +1,33 @@
1
+
2
+ **2.1.1 / 2025-05-15**
3
+ - remove unnecessary check to remove lint error
4
+
5
+ **2.1.0 / 2025-05-01**
6
+ - fix e-notation
7
+ - to return string when invalid enotation is found. Eg `E24`
8
+ - to return valid number when only leading zero before e char is present
9
+
10
+ **2.0.5 / 2025-02-27**
11
+ - changes done in 1.1.2
12
+
13
+ **1.1.2 / 2025-02-27**
14
+ - fix skiplike for 0
15
+
16
+ **1.1.1 / 2025-02-21**
17
+ - All recent fixes of version 2
18
+
19
+ **2.0.4 / 2025-02-20**
20
+ - remove console log
21
+
22
+ **2.0.3 / 2025-02-20**
23
+ - fix for string which are falsly identified as e-notation
24
+
25
+ **2.0.1 / 2025-02-20**
26
+ - fix: handle only zeros
27
+ - fix: return original string when NaN
28
+
29
+ **2.0.0 / 2025-02-20**
30
+ - Migrating to ESM modules. No functional change
31
+
32
+ **1.1.0 / 2025-02-20**
33
+ - fix (#9): support missing floating point and e notations
@@ -1,6 +1,16 @@
1
1
  # strnum
2
2
  Parse string into Number based on configuration
3
3
 
4
+ ## Users
5
+
6
+ <a href="https://github.com/aws-amplify" target="_blank"><img src="https://avatars.githubusercontent.com/u/41077760?s=100&v=4"></a>
7
+ <a href="https://github.com/astrapay" target="_blank"><img src="https://avatars.githubusercontent.com/u/90901882?s=100&v=4"></a>
8
+ <a href="https://github.com/process-analytics" target="_blank"><img src="https://avatars.githubusercontent.com/u/60110287?s=100&v=4"></a>
9
+ <a href="https://github.com/NaturalIntelligence" target="_blank"><img src="https://avatars.githubusercontent.com/u/16322633?s=100&v=4"></a>
10
+ Many React Native projects and plugins
11
+
12
+ ## Usage
13
+
4
14
  ```bash
5
15
  npm install strnum
6
16
  ```
@@ -80,7 +90,8 @@ toNumber("+1212121212", { skipLike: /\+[0-9]{10}/} )); //"+1212121212"
80
90
 
81
91
  Supported Options
82
92
  ```js
83
- hex : true, //when hexadecimal string should be parsed
93
+ hex: true, //when hexadecimal string should be parsed
84
94
  leadingZeros: true, //when number with leading zeros like 08 should be parsed. 0.0 is not impacted
85
- eNotation: true //when number with eNotation or number parsed in eNotation should be considered
86
- ```
95
+ eNotation: true, //when number with eNotation or number parsed in eNotation should be considered
96
+ skipLike: /regex/ //when string should not be parsed when it matches the specified regular expression
97
+ ```
@@ -0,0 +1,84 @@
1
+
2
+ FLOW: toNumber
3
+ input: x, options
4
+ IF not string
5
+ END x
6
+ ELSE_IF should skip
7
+ END x
8
+ ELSE_IF 0
9
+ END 0
10
+ ELSE_IF hex is supported AND x is hex
11
+ END int of x of base 16
12
+ ELSE_IF possible e notation
13
+ FOLLOW: resolve enotation (x, trimmed x, options)
14
+ ELSE
15
+ IF match numeric pattern
16
+ separate sign, leading zeros, pure number
17
+ IF x doesn't starts with "[+-]0."
18
+ END number(x)
19
+ IF leading zeros are not allowed
20
+ IF leading zeros > 1
21
+ #00.1
22
+ END x
23
+ ELSE_IF leading zeros == 1 AND decimal is not adjacent to leading zeros
24
+ #06.5
25
+ #but not 0.65, .65, 6.0
26
+ END x
27
+ ELSE_IF str has only zeros
28
+ END 0
29
+ ELSE
30
+ parse x to number
31
+ IF parsed x == 0 or -0
32
+ END parsed x
33
+ ELSE_IF parsed x is eNotation
34
+ IF conversion to enotation is allowed
35
+ END parsed x
36
+ ELSE
37
+ END x
38
+ ELSE_IF floating number
39
+ IF parsed x is 0
40
+ END parsed x
41
+ ELSE_IF parsed x == number without leading 0s
42
+ #0.456. 0.79000
43
+ END parsed x
44
+ ELSE_IF parsed x is negative AND == parsed x == number without leading 0s
45
+ END parsed x
46
+ ELSE
47
+ END x
48
+ ELSE_IF leading 0s are present
49
+ IF parsed x == x without leading 0s
50
+ END parsed x
51
+ ELSE
52
+ END x
53
+ ELSE
54
+ IF parsed x == x (consider sign)
55
+ END parsed x
56
+ ELSE
57
+ END x
58
+
59
+ ELSE
60
+ END x
61
+
62
+
63
+
64
+ FLOW: resolve enotation
65
+ input: x, trimmed x, options
66
+ IF eNotation has not to be evaluated
67
+ END x
68
+ IF match eNotation pattern
69
+ extract sign, eChar, leading zeros
70
+ find if eChar adjacent to leading zeros
71
+
72
+ IF leading zeros > 1 AND eChar adjacent to leading zeros
73
+ # 00e, -00e
74
+ END x
75
+ ELSE_IF exp is `0e`, `0.e`, `-0.e`, `-0e`
76
+ END number(x);
77
+ ELSE_IF leading zeros are allowed but eChar is not adjacent to leading zeros
78
+ # -003e2
79
+ remove leading zeros
80
+ END number(x)
81
+ ELSE
82
+ END x
83
+ ELSE
84
+ END x
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "strnum",
3
- "version": "1.0.5",
3
+ "version": "2.1.1",
4
4
  "description": "Parse String to Number based on configuration",
5
+ "type": "module",
5
6
  "main": "strnum.js",
6
7
  "scripts": {
7
8
  "test": "jasmine strnum.test.js"
@@ -18,7 +19,13 @@
18
19
  },
19
20
  "author": "Amit Gupta (https://amitkumargupta.work/)",
20
21
  "license": "MIT",
22
+ "funding": [
23
+ {
24
+ "type": "github",
25
+ "url": "https://github.com/sponsors/NaturalIntelligence"
26
+ }
27
+ ],
21
28
  "devDependencies": {
22
- "jasmine": "^3.10.0"
29
+ "jasmine": "^5.6.0"
23
30
  }
24
31
  }
@@ -1,111 +1,109 @@
1
1
  const hexRegex = /^[-+]?0x[a-fA-F0-9]+$/;
2
- const numRegex = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
3
- // const octRegex = /0x[a-z0-9]+/;
2
+ const numRegex = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
3
+ // const octRegex = /^0x[a-z0-9]+/;
4
4
  // const binRegex = /0x[a-z0-9]+/;
5
5
 
6
-
7
- //polyfill
8
- if (!Number.parseInt && window.parseInt) {
9
- Number.parseInt = window.parseInt;
10
- }
11
- if (!Number.parseFloat && window.parseFloat) {
12
- Number.parseFloat = window.parseFloat;
13
- }
14
-
15
-
6
+
16
7
  const consider = {
17
8
  hex : true,
9
+ // oct: false,
18
10
  leadingZeros: true,
19
11
  decimalPoint: "\.",
20
- eNotation: true
12
+ eNotation: true,
21
13
  //skipLike: /regex/
22
14
  };
23
15
 
24
- function toNumber(str, options = {}){
25
- // const options = Object.assign({}, consider);
26
- // if(opt.leadingZeros === false){
27
- // options.leadingZeros = false;
28
- // }else if(opt.hex === false){
29
- // options.hex = false;
30
- // }
31
-
16
+ export default function toNumber(str, options = {}){
32
17
  options = Object.assign({}, consider, options );
33
18
  if(!str || typeof str !== "string" ) return str;
34
19
 
35
20
  let trimmedStr = str.trim();
36
- // if(trimmedStr === "0.0") return 0;
37
- // else if(trimmedStr === "+0.0") return 0;
38
- // else if(trimmedStr === "-0.0") return -0;
39
-
21
+
40
22
  if(options.skipLike !== undefined && options.skipLike.test(trimmedStr)) return str;
23
+ else if(str==="0") return 0;
41
24
  else if (options.hex && hexRegex.test(trimmedStr)) {
42
- return Number.parseInt(trimmedStr, 16);
43
- // } else if (options.parseOct && octRegex.test(str)) {
25
+ return parse_int(trimmedStr, 16);
26
+ // }else if (options.oct && octRegex.test(str)) {
44
27
  // return Number.parseInt(val, 8);
28
+ }else if (trimmedStr.search(/.+[eE].+/)!== -1) { //eNotation
29
+ return resolveEnotation(str,trimmedStr,options);
45
30
  // }else if (options.parseBin && binRegex.test(str)) {
46
31
  // return Number.parseInt(val, 2);
47
32
  }else{
48
33
  //separate negative sign, leading zeros, and rest number
49
34
  const match = numRegex.exec(trimmedStr);
35
+ // +00.123 => [ , '+', '00', '.123', ..
50
36
  if(match){
51
- const sign = match[1];
37
+ const sign = match[1] || "";
52
38
  const leadingZeros = match[2];
53
39
  let numTrimmedByZeros = trimZeros(match[3]); //complete num without leading zeros
40
+ const decimalAdjacentToLeadingZeros = sign ? // 0., -00., 000.
41
+ str[leadingZeros.length+1] === "."
42
+ : str[leadingZeros.length] === ".";
43
+
54
44
  //trim ending zeros for floating number
55
-
56
- const eNotation = match[4] || match[6];
57
- if(!options.leadingZeros && leadingZeros.length > 0 && sign && trimmedStr[2] !== ".") return str; //-0123
58
- else if(!options.leadingZeros && leadingZeros.length > 0 && !sign && trimmedStr[1] !== ".") return str; //0123
45
+ if(!options.leadingZeros //leading zeros are not allowed
46
+ && (leadingZeros.length > 1
47
+ || (leadingZeros.length === 1 && !decimalAdjacentToLeadingZeros))){
48
+ // 00, 00.3, +03.24, 03, 03.24
49
+ return str;
50
+ }
59
51
  else{//no leading zeros or leading zeros are allowed
60
52
  const num = Number(trimmedStr);
61
- const numStr = "" + num;
62
- if(numStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation
63
- if(options.eNotation) return num;
64
- else return str;
65
- }else if(eNotation){ //given number has enotation
53
+ const parsedStr = String(num);
54
+
55
+ if( num === 0) return num;
56
+ if(parsedStr.search(/[eE]/) !== -1){ //given number is long and parsed to eNotation
66
57
  if(options.eNotation) return num;
67
58
  else return str;
68
59
  }else if(trimmedStr.indexOf(".") !== -1){ //floating number
69
- // const decimalPart = match[5].substr(1);
70
- // const intPart = trimmedStr.substr(0,trimmedStr.indexOf("."));
71
-
72
-
73
- // const p = numStr.indexOf(".");
74
- // const givenIntPart = numStr.substr(0,p);
75
- // const givenDecPart = numStr.substr(p+1);
76
- if(numStr === "0" && (numTrimmedByZeros === "") ) return num; //0.0
77
- else if(numStr === numTrimmedByZeros) return num; //0.456. 0.79000
78
- else if( sign && numStr === "-"+numTrimmedByZeros) return num;
60
+ if(parsedStr === "0") return num; //0.0
61
+ else if(parsedStr === numTrimmedByZeros) return num; //0.456. 0.79000
62
+ else if( parsedStr === `${sign}${numTrimmedByZeros}`) return num;
79
63
  else return str;
80
64
  }
81
65
 
66
+ let n = leadingZeros? numTrimmedByZeros : trimmedStr;
82
67
  if(leadingZeros){
83
- // if(numTrimmedByZeros === numStr){
84
- // if(options.leadingZeros) return num;
85
- // else return str;
86
- // }else return str;
87
- if(numTrimmedByZeros === numStr) return num;
88
- else if(sign+numTrimmedByZeros === numStr) return num;
89
- else return str;
68
+ // -009 => -9
69
+ return (n === parsedStr) || (sign+n === parsedStr) ? num : str
70
+ }else {
71
+ // +9
72
+ return (n === parsedStr) || (n === sign+parsedStr) ? num : str
90
73
  }
91
-
92
- if(trimmedStr === numStr) return num;
93
- else if(trimmedStr === sign+numStr) return num;
94
- // else{
95
- // //number with +/- sign
96
- // trimmedStr.test(/[-+][0-9]);
97
-
98
- // }
99
- return str;
100
74
  }
101
- // else if(!eNotation && trimmedStr && trimmedStr !== Number(trimmedStr) ) return str;
102
-
103
75
  }else{ //non-numeric string
104
76
  return str;
105
77
  }
106
78
  }
107
79
  }
108
80
 
81
+ const eNotationRegx = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
82
+ function resolveEnotation(str,trimmedStr,options){
83
+ if(!options.eNotation) return str;
84
+ const notation = trimmedStr.match(eNotationRegx);
85
+ if(notation){
86
+ let sign = notation[1] || "";
87
+ const eChar = notation[3].indexOf("e") === -1 ? "E" : "e";
88
+ const leadingZeros = notation[2];
89
+ const eAdjacentToLeadingZeros = sign ? // 0E.
90
+ str[leadingZeros.length+1] === eChar
91
+ : str[leadingZeros.length] === eChar;
92
+
93
+ if(leadingZeros.length > 1 && eAdjacentToLeadingZeros) return str;
94
+ else if(leadingZeros.length === 1
95
+ && (notation[3].startsWith(`.${eChar}`) || notation[3][0] === eChar)){
96
+ return Number(trimmedStr);
97
+ }else if(options.leadingZeros && !eAdjacentToLeadingZeros){ //accept with leading zeros
98
+ //remove leading 0s
99
+ trimmedStr = (notation[1] || "") + notation[3];
100
+ return Number(trimmedStr);
101
+ }else return str;
102
+ }else{
103
+ return str;
104
+ }
105
+ }
106
+
109
107
  /**
110
108
  *
111
109
  * @param {string} numStr without leading zeros
@@ -116,9 +114,16 @@ function trimZeros(numStr){
116
114
  numStr = numStr.replace(/0+$/, ""); //remove ending zeros
117
115
  if(numStr === ".") numStr = "0";
118
116
  else if(numStr[0] === ".") numStr = "0"+numStr;
119
- else if(numStr[numStr.length-1] === ".") numStr = numStr.substr(0,numStr.length-1);
117
+ else if(numStr[numStr.length-1] === ".") numStr = numStr.substring(0,numStr.length-1);
120
118
  return numStr;
121
119
  }
122
120
  return numStr;
123
121
  }
124
- module.exports = toNumber
122
+
123
+ function parse_int(numStr, base){
124
+ //polyfill
125
+ if(parseInt) return parseInt(numStr, base);
126
+ else if(Number.parseInt) return Number.parseInt(numStr, base);
127
+ else if(window && window.parseInt) return window.parseInt(numStr, base);
128
+ else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")
129
+ }