@bbn/bbn 1.0.12 → 1.0.14

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 (463) hide show
  1. package/dist/bundle.d.ts +945 -11
  2. package/dist/bundle.js +5206 -20
  3. package/dist/fn/_addLoader.d.ts +2 -0
  4. package/dist/fn/_addLoader.js +29 -0
  5. package/dist/fn/_compareValues.d.ts +2 -0
  6. package/dist/fn/_compareValues.js +40 -0
  7. package/dist/fn/_deleteLoader.d.ts +2 -0
  8. package/dist/fn/_deleteLoader.js +26 -0
  9. package/dist/fn/abort.d.ts +2 -0
  10. package/dist/fn/abort.js +5 -0
  11. package/dist/fn/abortURL.d.ts +2 -0
  12. package/dist/fn/abortURL.js +14 -0
  13. package/dist/fn/addColors.d.ts +2 -0
  14. package/dist/fn/addColors.js +17 -0
  15. package/dist/fn/addInputs.d.ts +3 -0
  16. package/dist/fn/addInputs.js +34 -0
  17. package/dist/fn/addStyle.d.ts +2 -0
  18. package/dist/fn/addStyle.js +6 -0
  19. package/dist/fn/adjustHeight.d.ts +2 -0
  20. package/dist/fn/adjustHeight.js +10 -0
  21. package/dist/fn/adjustSize.d.ts +2 -0
  22. package/dist/fn/adjustSize.js +8 -0
  23. package/dist/fn/adjustWidth.d.ts +2 -0
  24. package/dist/fn/adjustWidth.js +10 -0
  25. package/dist/fn/ajax.d.ts +2 -0
  26. package/dist/fn/ajax.js +103 -0
  27. package/dist/fn/analyzeFunction.d.ts +11 -0
  28. package/dist/fn/analyzeFunction.js +132 -0
  29. package/dist/fn/animateCss.d.ts +2 -0
  30. package/dist/fn/animateCss.js +13 -0
  31. package/dist/fn/arrayBuffer2String.d.ts +2 -0
  32. package/dist/fn/arrayBuffer2String.js +2 -0
  33. package/dist/fn/arrayFromProp.d.ts +2 -0
  34. package/dist/fn/arrayFromProp.js +4 -0
  35. package/dist/fn/autoExtend.d.ts +2 -0
  36. package/dist/fn/autoExtend.js +12 -0
  37. package/dist/fn/baseName.d.ts +2 -0
  38. package/dist/fn/baseName.js +17 -0
  39. package/dist/fn/br2nl.d.ts +2 -0
  40. package/dist/fn/br2nl.js +3 -0
  41. package/dist/fn/calendar.d.ts +2 -0
  42. package/dist/fn/calendar.js +16 -0
  43. package/dist/fn/callback.d.ts +2 -0
  44. package/dist/fn/callback.js +81 -0
  45. package/dist/fn/camelToCss.d.ts +2 -0
  46. package/dist/fn/camelToCss.js +2 -0
  47. package/dist/fn/camelize.d.ts +2 -0
  48. package/dist/fn/camelize.js +9 -0
  49. package/dist/fn/canvasToImage.d.ts +2 -0
  50. package/dist/fn/canvasToImage.js +2 -0
  51. package/dist/fn/center.d.ts +2 -0
  52. package/dist/fn/center.js +15 -0
  53. package/dist/fn/checkProps.d.ts +2 -0
  54. package/dist/fn/checkProps.js +3 -0
  55. package/dist/fn/checkPropsDetails.d.ts +5 -0
  56. package/dist/fn/checkPropsDetails.js +49 -0
  57. package/dist/fn/checkPropsOrDie.d.ts +2 -0
  58. package/dist/fn/checkPropsOrDie.js +9 -0
  59. package/dist/fn/checkType.d.ts +2 -0
  60. package/dist/fn/checkType.js +61 -0
  61. package/dist/fn/circularReplacer.d.ts +2 -0
  62. package/dist/fn/circularReplacer.js +33 -0
  63. package/dist/fn/clone.d.ts +3 -0
  64. package/dist/fn/clone.js +14 -0
  65. package/dist/fn/colorToHex.d.ts +2 -0
  66. package/dist/fn/colorToHex.js +2 -0
  67. package/dist/fn/compare.d.ts +2 -0
  68. package/dist/fn/compare.js +86 -0
  69. package/dist/fn/compareConditions.d.ts +3 -0
  70. package/dist/fn/compareConditions.js +40 -0
  71. package/dist/fn/copy.d.ts +2 -0
  72. package/dist/fn/copy.js +31 -0
  73. package/dist/fn/correctCase.d.ts +2 -0
  74. package/dist/fn/correctCase.js +2 -0
  75. package/dist/fn/count.d.ts +2 -0
  76. package/dist/fn/count.js +3 -0
  77. package/dist/fn/crc32.d.ts +2 -0
  78. package/dist/fn/crc32.js +9 -0
  79. package/dist/fn/createObject.d.ts +2 -0
  80. package/dist/fn/createObject.js +9 -0
  81. package/dist/fn/cssExists.d.ts +2 -0
  82. package/dist/fn/cssExists.js +25 -0
  83. package/dist/fn/date.d.ts +2 -0
  84. package/dist/fn/date.js +28 -0
  85. package/dist/fn/dateSQL.d.ts +2 -0
  86. package/dist/fn/dateSQL.js +4 -0
  87. package/dist/fn/daysInMonth.d.ts +2 -0
  88. package/dist/fn/daysInMonth.js +9 -0
  89. package/dist/fn/deepPath.d.ts +3 -0
  90. package/dist/fn/deepPath.js +21 -0
  91. package/dist/fn/defaultAjaxAbortFunction.d.ts +2 -0
  92. package/dist/fn/defaultAjaxAbortFunction.js +3 -0
  93. package/dist/fn/defaultAjaxErrorFunction.d.ts +2 -0
  94. package/dist/fn/defaultAjaxErrorFunction.js +3 -0
  95. package/dist/fn/defaultAlertFunction.d.ts +2 -0
  96. package/dist/fn/defaultAlertFunction.js +2 -0
  97. package/dist/fn/defaultConfirmFunction.d.ts +2 -0
  98. package/dist/fn/defaultConfirmFunction.js +14 -0
  99. package/dist/fn/defaultEndLoadingFunction.d.ts +2 -0
  100. package/dist/fn/defaultEndLoadingFunction.js +2 -0
  101. package/dist/fn/defaultErrorFunction.d.ts +2 -0
  102. package/dist/fn/defaultErrorFunction.js +3 -0
  103. package/dist/fn/defaultHistoryFunction.d.ts +2 -0
  104. package/dist/fn/defaultHistoryFunction.js +2 -0
  105. package/dist/fn/defaultLinkFunction.d.ts +2 -0
  106. package/dist/fn/defaultLinkFunction.js +2 -0
  107. package/dist/fn/defaultPostLinkFunction.d.ts +2 -0
  108. package/dist/fn/defaultPostLinkFunction.js +2 -0
  109. package/dist/fn/defaultPreLinkFunction.d.ts +2 -0
  110. package/dist/fn/defaultPreLinkFunction.js +2 -0
  111. package/dist/fn/defaultResizeFunction.d.ts +2 -0
  112. package/dist/fn/defaultResizeFunction.js +2 -0
  113. package/dist/fn/defaultStartLoadingFunction.d.ts +2 -0
  114. package/dist/fn/defaultStartLoadingFunction.js +2 -0
  115. package/dist/fn/deleteProp.d.ts +2 -0
  116. package/dist/fn/deleteProp.js +3 -0
  117. package/dist/fn/diffObj.d.ts +3 -0
  118. package/dist/fn/diffObj.js +77 -0
  119. package/dist/fn/dirName.d.ts +2 -0
  120. package/dist/fn/dirName.js +18 -0
  121. package/dist/fn/download.d.ts +2 -0
  122. package/dist/fn/download.js +35 -0
  123. package/dist/fn/downloadContent.d.ts +2 -0
  124. package/dist/fn/downloadContent.js +37 -0
  125. package/dist/fn/each.d.ts +2 -0
  126. package/dist/fn/each.js +23 -0
  127. package/dist/fn/eraseCookie.d.ts +2 -0
  128. package/dist/fn/eraseCookie.js +2 -0
  129. package/dist/fn/error.d.ts +2 -0
  130. package/dist/fn/error.js +13 -0
  131. package/dist/fn/escapeDquotes.d.ts +2 -0
  132. package/dist/fn/escapeDquotes.js +8 -0
  133. package/dist/fn/escapeRegExp.d.ts +2 -0
  134. package/dist/fn/escapeRegExp.js +2 -0
  135. package/dist/fn/escapeSquotes.d.ts +2 -0
  136. package/dist/fn/escapeSquotes.js +8 -0
  137. package/dist/fn/escapeTicks.d.ts +2 -0
  138. package/dist/fn/escapeTicks.js +8 -0
  139. package/dist/fn/escapeUrl.d.ts +2 -0
  140. package/dist/fn/escapeUrl.js +38 -0
  141. package/dist/fn/extend.d.ts +3 -0
  142. package/dist/fn/extend.js +67 -0
  143. package/dist/fn/extendOut.d.ts +3 -0
  144. package/dist/fn/extendOut.js +24 -0
  145. package/dist/fn/fdate.d.ts +2 -0
  146. package/dist/fn/fdate.js +18 -0
  147. package/dist/fn/fdatetime.d.ts +2 -0
  148. package/dist/fn/fdatetime.js +15 -0
  149. package/dist/fn/fieldValue.d.ts +2 -0
  150. package/dist/fn/fieldValue.js +24 -0
  151. package/dist/fn/fileExt.d.ts +2 -0
  152. package/dist/fn/fileExt.js +11 -0
  153. package/dist/fn/filter.d.ts +3 -0
  154. package/dist/fn/filter.js +42 -0
  155. package/dist/fn/filterToConditions.d.ts +3 -0
  156. package/dist/fn/filterToConditions.js +25 -0
  157. package/dist/fn/findAll.d.ts +3 -0
  158. package/dist/fn/findAll.js +16 -0
  159. package/dist/fn/fori.d.ts +2 -0
  160. package/dist/fn/fori.js +19 -0
  161. package/dist/fn/forir.d.ts +2 -0
  162. package/dist/fn/forir.js +19 -0
  163. package/dist/fn/format.d.ts +2 -0
  164. package/dist/fn/format.js +11 -0
  165. package/dist/fn/formatBytes.d.ts +2 -0
  166. package/dist/fn/formatBytes.js +8 -0
  167. package/dist/fn/formatDate.d.ts +2 -0
  168. package/dist/fn/formatDate.js +2 -0
  169. package/dist/fn/formatSize.d.ts +2 -0
  170. package/dist/fn/formatSize.js +12 -0
  171. package/dist/fn/formdata.d.ts +2 -0
  172. package/dist/fn/formdata.js +48 -0
  173. package/dist/fn/fromXml.d.ts +2 -0
  174. package/dist/fn/fromXml.js +44 -0
  175. package/dist/fn/ftime.d.ts +2 -0
  176. package/dist/fn/ftime.js +14 -0
  177. package/dist/fn/getAllTags.d.ts +2 -0
  178. package/dist/fn/getAllTags.js +3 -0
  179. package/dist/fn/getAncestors.d.ts +2 -0
  180. package/dist/fn/getAncestors.js +26 -0
  181. package/dist/fn/getAttributes.d.ts +2 -0
  182. package/dist/fn/getAttributes.js +10 -0
  183. package/dist/fn/getBrowserName.d.ts +2 -0
  184. package/dist/fn/getBrowserName.js +11 -0
  185. package/dist/fn/getBrowserVersion.d.ts +2 -0
  186. package/dist/fn/getBrowserVersion.js +11 -0
  187. package/dist/fn/getCookie.d.ts +2 -0
  188. package/dist/fn/getCookie.js +18 -0
  189. package/dist/fn/getCssVar.d.ts +2 -0
  190. package/dist/fn/getCssVar.js +7 -0
  191. package/dist/fn/getDay.d.ts +2 -0
  192. package/dist/fn/getDay.js +17 -0
  193. package/dist/fn/getDeviceType.d.ts +2 -0
  194. package/dist/fn/getDeviceType.js +11 -0
  195. package/dist/fn/getEventData.d.ts +2 -0
  196. package/dist/fn/getEventData.js +80 -0
  197. package/dist/fn/getField.d.ts +2 -0
  198. package/dist/fn/getField.js +9 -0
  199. package/dist/fn/getFieldValues.d.ts +2 -0
  200. package/dist/fn/getFieldValues.js +13 -0
  201. package/dist/fn/getHTMLOfSelection.d.ts +2 -0
  202. package/dist/fn/getHTMLOfSelection.js +28 -0
  203. package/dist/fn/getHtml.d.ts +2 -0
  204. package/dist/fn/getHtml.js +9 -0
  205. package/dist/fn/getLoader.d.ts +2 -0
  206. package/dist/fn/getLoader.js +10 -0
  207. package/dist/fn/getPath.d.ts +2 -0
  208. package/dist/fn/getPath.js +31 -0
  209. package/dist/fn/getProp.d.ts +2 -0
  210. package/dist/fn/getProp.js +3 -0
  211. package/dist/fn/getProperty.d.ts +2 -0
  212. package/dist/fn/getProperty.js +11 -0
  213. package/dist/fn/getRequestId.d.ts +2 -0
  214. package/dist/fn/getRequestId.js +12 -0
  215. package/dist/fn/getRow.d.ts +2 -0
  216. package/dist/fn/getRow.js +9 -0
  217. package/dist/fn/getScrollBarSize.d.ts +2 -0
  218. package/dist/fn/getScrollBarSize.js +21 -0
  219. package/dist/fn/getText.d.ts +2 -0
  220. package/dist/fn/getText.js +2 -0
  221. package/dist/fn/getTimeoff.d.ts +2 -0
  222. package/dist/fn/getTimeoff.js +8 -0
  223. package/dist/fn/happy.d.ts +2 -0
  224. package/dist/fn/happy.js +3 -0
  225. package/dist/fn/hash.d.ts +2 -0
  226. package/dist/fn/hash.js +35 -0
  227. package/dist/fn/hex2rgb.d.ts +6 -0
  228. package/dist/fn/hex2rgb.js +2 -0
  229. package/dist/fn/history.d.ts +2 -0
  230. package/dist/fn/history.js +2 -0
  231. package/dist/fn/html2text.d.ts +2 -0
  232. package/dist/fn/html2text.js +2 -0
  233. package/dist/fn/imageToCanvas.d.ts +2 -0
  234. package/dist/fn/imageToCanvas.js +2 -0
  235. package/dist/fn/imgToBase64.d.ts +2 -0
  236. package/dist/fn/imgToBase64.js +4 -0
  237. package/dist/fn/info.d.ts +2 -0
  238. package/dist/fn/info.js +3 -0
  239. package/dist/fn/init.d.ts +2 -0
  240. package/dist/fn/init.js +110 -0
  241. package/dist/fn/isActiveInterface.d.ts +2 -0
  242. package/dist/fn/isActiveInterface.js +9 -0
  243. package/dist/fn/isArray.d.ts +2 -0
  244. package/dist/fn/isArray.js +11 -0
  245. package/dist/fn/isBlob.d.ts +2 -0
  246. package/dist/fn/isBlob.js +11 -0
  247. package/dist/fn/isBoolean.d.ts +2 -0
  248. package/dist/fn/isBoolean.js +11 -0
  249. package/dist/fn/isCanvas.d.ts +2 -0
  250. package/dist/fn/isCanvas.js +11 -0
  251. package/dist/fn/isColor.d.ts +2 -0
  252. package/dist/fn/isColor.js +9 -0
  253. package/dist/fn/isComment.d.ts +2 -0
  254. package/dist/fn/isComment.js +11 -0
  255. package/dist/fn/isCp.d.ts +2 -0
  256. package/dist/fn/isCp.js +18 -0
  257. package/dist/fn/isDate.d.ts +2 -0
  258. package/dist/fn/isDate.js +11 -0
  259. package/dist/fn/isDesktopDevice.d.ts +2 -0
  260. package/dist/fn/isDesktopDevice.js +2 -0
  261. package/dist/fn/isDimension.d.ts +2 -0
  262. package/dist/fn/isDimension.js +8 -0
  263. package/dist/fn/isDom.d.ts +2 -0
  264. package/dist/fn/isDom.js +11 -0
  265. package/dist/fn/isEmail.d.ts +2 -0
  266. package/dist/fn/isEmail.js +9 -0
  267. package/dist/fn/isEmpty.d.ts +2 -0
  268. package/dist/fn/isEmpty.js +18 -0
  269. package/dist/fn/isEvent.d.ts +2 -0
  270. package/dist/fn/isEvent.js +11 -0
  271. package/dist/fn/isFocused.d.ts +2 -0
  272. package/dist/fn/isFocused.js +2 -0
  273. package/dist/fn/isFunction.d.ts +2 -0
  274. package/dist/fn/isFunction.js +11 -0
  275. package/dist/fn/isHostname.d.ts +2 -0
  276. package/dist/fn/isHostname.js +12 -0
  277. package/dist/fn/isIP.d.ts +2 -0
  278. package/dist/fn/isIP.js +6 -0
  279. package/dist/fn/isInside.d.ts +2 -0
  280. package/dist/fn/isInside.js +21 -0
  281. package/dist/fn/isInt.d.ts +2 -0
  282. package/dist/fn/isInt.js +11 -0
  283. package/dist/fn/isIterable.d.ts +2 -0
  284. package/dist/fn/isIterable.js +2 -0
  285. package/dist/fn/isMobile.d.ts +2 -0
  286. package/dist/fn/isMobile.js +4 -0
  287. package/dist/fn/isMobileDevice.d.ts +2 -0
  288. package/dist/fn/isMobileDevice.js +2 -0
  289. package/dist/fn/isNull.d.ts +2 -0
  290. package/dist/fn/isNull.js +11 -0
  291. package/dist/fn/isNumber.d.ts +2 -0
  292. package/dist/fn/isNumber.js +11 -0
  293. package/dist/fn/isObject.d.ts +2 -0
  294. package/dist/fn/isObject.js +11 -0
  295. package/dist/fn/isPercent.d.ts +2 -0
  296. package/dist/fn/isPercent.js +11 -0
  297. package/dist/fn/isPrimitive.d.ts +2 -0
  298. package/dist/fn/isPrimitive.js +11 -0
  299. package/dist/fn/isPromise.d.ts +2 -0
  300. package/dist/fn/isPromise.js +11 -0
  301. package/dist/fn/isPropSize.d.ts +2 -0
  302. package/dist/fn/isPropSize.js +6 -0
  303. package/dist/fn/isSQLDate.d.ts +2 -0
  304. package/dist/fn/isSQLDate.js +11 -0
  305. package/dist/fn/isSame.d.ts +3 -0
  306. package/dist/fn/isSame.js +30 -0
  307. package/dist/fn/isString.d.ts +2 -0
  308. package/dist/fn/isString.js +11 -0
  309. package/dist/fn/isSymbol.d.ts +2 -0
  310. package/dist/fn/isSymbol.js +11 -0
  311. package/dist/fn/isTabletDevice.d.ts +2 -0
  312. package/dist/fn/isTabletDevice.js +2 -0
  313. package/dist/fn/isURL.d.ts +2 -0
  314. package/dist/fn/isURL.js +3 -0
  315. package/dist/fn/isValidDimension.d.ts +2 -0
  316. package/dist/fn/isValidDimension.js +12 -0
  317. package/dist/fn/isValidName.d.ts +2 -0
  318. package/dist/fn/isValidName.js +13 -0
  319. package/dist/fn/isValue.d.ts +2 -0
  320. package/dist/fn/isValue.js +12 -0
  321. package/dist/fn/isVue.d.ts +2 -0
  322. package/dist/fn/isVue.js +27 -0
  323. package/dist/fn/iterate.d.ts +2 -0
  324. package/dist/fn/iterate.js +15 -0
  325. package/dist/fn/lightenDarkenHex.d.ts +2 -0
  326. package/dist/fn/lightenDarkenHex.js +27 -0
  327. package/dist/fn/link.d.ts +3 -0
  328. package/dist/fn/link.js +87 -0
  329. package/dist/fn/log.d.ts +2 -0
  330. package/dist/fn/log.js +34 -0
  331. package/dist/fn/makeReactive.d.ts +3 -0
  332. package/dist/fn/makeReactive.js +137 -0
  333. package/dist/fn/map.d.ts +3 -0
  334. package/dist/fn/map.js +11 -0
  335. package/dist/fn/md5.d.ts +2 -0
  336. package/dist/fn/md5.js +92 -0
  337. package/dist/fn/money.d.ts +2 -0
  338. package/dist/fn/money.js +63 -0
  339. package/dist/fn/move.d.ts +2 -0
  340. package/dist/fn/move.js +11 -0
  341. package/dist/fn/multiorder.d.ts +2 -0
  342. package/dist/fn/multiorder.js +22 -0
  343. package/dist/fn/nl2br.d.ts +2 -0
  344. package/dist/fn/nl2br.js +3 -0
  345. package/dist/fn/numProperties.d.ts +2 -0
  346. package/dist/fn/numProperties.js +7 -0
  347. package/dist/fn/objectToFormData.d.ts +2 -0
  348. package/dist/fn/objectToFormData.js +31 -0
  349. package/dist/fn/order.d.ts +2 -0
  350. package/dist/fn/order.js +8 -0
  351. package/dist/fn/outerHeight.d.ts +2 -0
  352. package/dist/fn/outerHeight.js +9 -0
  353. package/dist/fn/outerWidth.d.ts +2 -0
  354. package/dist/fn/outerWidth.js +9 -0
  355. package/dist/fn/percent.d.ts +2 -0
  356. package/dist/fn/percent.js +2 -0
  357. package/dist/fn/pickValue.d.ts +2 -0
  358. package/dist/fn/pickValue.js +4 -0
  359. package/dist/fn/post.d.ts +2 -0
  360. package/dist/fn/post.js +7 -0
  361. package/dist/fn/postOut.d.ts +2 -0
  362. package/dist/fn/postOut.js +30 -0
  363. package/dist/fn/printf.d.ts +2 -0
  364. package/dist/fn/printf.js +2 -0
  365. package/dist/fn/quotes2html.d.ts +2 -0
  366. package/dist/fn/quotes2html.js +11 -0
  367. package/dist/fn/randomInt.d.ts +2 -0
  368. package/dist/fn/randomInt.js +2 -0
  369. package/dist/fn/randomString.d.ts +2 -0
  370. package/dist/fn/randomString.js +38 -0
  371. package/dist/fn/removeAccents.d.ts +2 -0
  372. package/dist/fn/removeAccents.js +16 -0
  373. package/dist/fn/removeEmpty.d.ts +2 -0
  374. package/dist/fn/removeEmpty.js +31 -0
  375. package/dist/fn/removeExtraSpaces.d.ts +2 -0
  376. package/dist/fn/removeExtraSpaces.js +2 -0
  377. package/dist/fn/removeHtmlComments.d.ts +2 -0
  378. package/dist/fn/removeHtmlComments.js +8 -0
  379. package/dist/fn/removePrivateProp.d.ts +3 -0
  380. package/dist/fn/removePrivateProp.js +19 -0
  381. package/dist/fn/removeTrailingChars.d.ts +2 -0
  382. package/dist/fn/removeTrailingChars.js +16 -0
  383. package/dist/fn/repeat.d.ts +2 -0
  384. package/dist/fn/repeat.js +3 -0
  385. package/dist/fn/replaceAll.d.ts +2 -0
  386. package/dist/fn/replaceAll.js +9 -0
  387. package/dist/fn/replaceSelection.d.ts +2 -0
  388. package/dist/fn/replaceSelection.js +36 -0
  389. package/dist/fn/resize.d.ts +2 -0
  390. package/dist/fn/resize.js +38 -0
  391. package/dist/fn/rgb2hex.d.ts +2 -0
  392. package/dist/fn/rgb2hex.js +8 -0
  393. package/dist/fn/riterate.d.ts +2 -0
  394. package/dist/fn/riterate.js +3 -0
  395. package/dist/fn/roundDecimal.d.ts +2 -0
  396. package/dist/fn/roundDecimal.js +2 -0
  397. package/dist/fn/sanitize.d.ts +2 -0
  398. package/dist/fn/sanitize.js +17 -0
  399. package/dist/fn/search.d.ts +2 -0
  400. package/dist/fn/search.js +62 -0
  401. package/dist/fn/selectElementText.d.ts +2 -0
  402. package/dist/fn/selectElementText.js +23 -0
  403. package/dist/fn/selector.d.ts +2 -0
  404. package/dist/fn/selector.js +2 -0
  405. package/dist/fn/setCookie.d.ts +2 -0
  406. package/dist/fn/setCookie.js +11 -0
  407. package/dist/fn/setCssVar.d.ts +2 -0
  408. package/dist/fn/setCssVar.js +7 -0
  409. package/dist/fn/setNavigationVars.d.ts +2 -0
  410. package/dist/fn/setNavigationVars.js +39 -0
  411. package/dist/fn/setProp.d.ts +2 -0
  412. package/dist/fn/setProp.js +3 -0
  413. package/dist/fn/setProperty.d.ts +2 -0
  414. package/dist/fn/setProperty.js +23 -0
  415. package/dist/fn/shorten.d.ts +2 -0
  416. package/dist/fn/shorten.js +18 -0
  417. package/dist/fn/shortenObj.d.ts +3 -0
  418. package/dist/fn/shortenObj.js +17 -0
  419. package/dist/fn/shuffle.d.ts +0 -5
  420. package/dist/fn/shuffle.js +1 -11
  421. package/dist/fn/simpleHash.d.ts +2 -0
  422. package/dist/fn/simpleHash.js +4 -0
  423. package/dist/fn/simpleHash1.d.ts +2 -0
  424. package/dist/fn/simpleHash1.js +10 -0
  425. package/dist/fn/simpleHash2.d.ts +2 -0
  426. package/dist/fn/simpleHash2.js +10 -0
  427. package/dist/fn/startChrono.d.ts +2 -0
  428. package/dist/fn/startChrono.js +13 -0
  429. package/dist/fn/stat.d.ts +2 -0
  430. package/dist/fn/stat.js +48 -0
  431. package/dist/fn/stopChrono.d.ts +2 -0
  432. package/dist/fn/stopChrono.js +6 -0
  433. package/dist/fn/string2ArrayBuffer.d.ts +2 -0
  434. package/dist/fn/string2ArrayBuffer.js +9 -0
  435. package/dist/fn/submit.d.ts +2 -0
  436. package/dist/fn/submit.js +38 -0
  437. package/dist/fn/substr.d.ts +2 -0
  438. package/dist/fn/substr.js +18 -0
  439. package/dist/fn/sum.d.ts +2 -0
  440. package/dist/fn/sum.js +6 -0
  441. package/dist/fn/timestamp.d.ts +2 -0
  442. package/dist/fn/timestamp.js +2 -0
  443. package/dist/fn/toCSV.d.ts +2 -0
  444. package/dist/fn/toCSV.js +40 -0
  445. package/dist/fn/toggleFullScreen.d.ts +2 -0
  446. package/dist/fn/toggleFullScreen.js +37 -0
  447. package/dist/fn/translate.d.ts +2 -0
  448. package/dist/fn/translate.js +4 -0
  449. package/dist/fn/treatAjaxArguments.d.ts +2 -0
  450. package/dist/fn/treatAjaxArguments.js +67 -0
  451. package/dist/fn/trim.d.ts +2 -0
  452. package/dist/fn/trim.js +20 -0
  453. package/dist/fn/uniqString.d.ts +2 -0
  454. package/dist/fn/uniqString.js +30 -0
  455. package/dist/fn/unique.d.ts +2 -0
  456. package/dist/fn/unique.js +2 -0
  457. package/dist/fn/upload.d.ts +2 -0
  458. package/dist/fn/upload.js +26 -0
  459. package/dist/fn/warning.d.ts +2 -0
  460. package/dist/fn/warning.js +3 -0
  461. package/dist/index.d.ts +1 -6
  462. package/dist/index.js +458 -5
  463. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ declare const removeAccents: (st: any) => any;
2
+ export { removeAccents };
@@ -0,0 +1,16 @@
1
+ import { bbn } from '../definitions';
2
+ import { isString } from './isString';
3
+ import { log } from './log';
4
+ const removeAccents = function (st) {
5
+ if (!isString(st)) {
6
+ if (st.toString) {
7
+ st = st.toString();
8
+ }
9
+ else {
10
+ log(st);
11
+ throw new Error(bbn._("removeAccent expects a string"));
12
+ }
13
+ }
14
+ return st.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
15
+ };
16
+ export { removeAccents };
@@ -0,0 +1,2 @@
1
+ declare const removeEmpty: (arr: any) => any[];
2
+ export { removeEmpty };
@@ -0,0 +1,31 @@
1
+ import { isArray } from './isArray';
2
+ import { isObject } from './isObject';
3
+ import { numProperties } from './numProperties';
4
+ const removeEmpty = function (arr) {
5
+ var tmp = [];
6
+ if (isArray(arr)) {
7
+ for (let i = 0; i < arr.length; i++) {
8
+ let ok = false;
9
+ if (arr[i]) {
10
+ if (isArray(arr[i])) {
11
+ if (arr[i].length) {
12
+ ok = true;
13
+ }
14
+ }
15
+ else if (isObject(arr[i])) {
16
+ if (numProperties(arr[i])) {
17
+ ok = true;
18
+ }
19
+ }
20
+ else {
21
+ ok = true;
22
+ }
23
+ }
24
+ if (ok) {
25
+ tmp.push(arr[i]);
26
+ }
27
+ }
28
+ }
29
+ return tmp;
30
+ };
31
+ export { removeEmpty };
@@ -0,0 +1,2 @@
1
+ declare const removeExtraSpaces: (str: any) => any;
2
+ export { removeExtraSpaces };
@@ -0,0 +1,2 @@
1
+ const removeExtraSpaces = function (str) { return str.replace(/\s+/g, ' ').trim(); };
2
+ export { removeExtraSpaces };
@@ -0,0 +1,2 @@
1
+ declare const removeHtmlComments: (str: any) => any;
2
+ export { removeHtmlComments };
@@ -0,0 +1,8 @@
1
+ import { isString } from './isString';
2
+ const removeHtmlComments = function (str) {
3
+ if (!isString(str)) {
4
+ return str;
5
+ }
6
+ return str.replace(/<!--[\s\S]*?-->/g, '');
7
+ };
8
+ export { removeHtmlComments };
@@ -0,0 +1,3 @@
1
+ import { removePrivateProp } from './removePrivateProp';
2
+ declare const removePrivateProp: (obj: any, deep: any) => boolean;
3
+ export { removePrivateProp };
@@ -0,0 +1,19 @@
1
+ import { substr } from './substr';
2
+ const removePrivateProp = function (obj, deep) {
3
+ var r = false;
4
+ if (typeof (obj) === "object") {
5
+ r = {};
6
+ for (var n in obj) {
7
+ if (substr(n, 0, 1).match(/^[A-z0-9]$/) && Object.hasOwn(obj, n)) {
8
+ if (deep && (typeof (obj[n]) === "object")) {
9
+ r[n] = removePrivateProp(obj[n], true);
10
+ }
11
+ else {
12
+ r[n] = obj[n];
13
+ }
14
+ }
15
+ }
16
+ }
17
+ return r;
18
+ };
19
+ export { removePrivateProp };
@@ -0,0 +1,2 @@
1
+ declare const removeTrailingChars: (st: any, char: any) => any;
2
+ export { removeTrailingChars };
@@ -0,0 +1,16 @@
1
+ import { substr } from './substr';
2
+ const removeTrailingChars = function (st, char) {
3
+ if (!char) {
4
+ char = ' ';
5
+ }
6
+ if (char.length) {
7
+ while (substr(st, -char.length) === char) {
8
+ st = substr(st, 0, st.length - char.length);
9
+ }
10
+ while (substr(st, 0, char.length) === char) {
11
+ st = substr(st, char.length);
12
+ }
13
+ }
14
+ return st;
15
+ };
16
+ export { removeTrailingChars };
@@ -0,0 +1,2 @@
1
+ declare const repeat: (st: any, num: any) => string;
2
+ export { repeat };
@@ -0,0 +1,3 @@
1
+ import { iterate } from './iterate';
2
+ const repeat = function (st, num) { let res = ''; iterate(num, () => { res += st; }); return res; };
3
+ export { repeat };
@@ -0,0 +1,2 @@
1
+ declare const replaceAll: (find: any, replace: any, str: any, flags?: string) => any;
2
+ export { replaceAll };
@@ -0,0 +1,9 @@
1
+ import { isObject } from './isObject';
2
+ import { escapeRegExp } from './escapeRegExp';
3
+ const replaceAll = function (find, replace, str, flags = '') {
4
+ if (str !== undefined) {
5
+ return str.toString().replace(isObject(find) ? find : new RegExp(escapeRegExp(find), 'g' + flags), replace);
6
+ }
7
+ return false;
8
+ };
9
+ export { replaceAll };
@@ -0,0 +1,2 @@
1
+ declare const replaceSelection: (html: any, selectInserted: any) => void;
2
+ export { replaceSelection };
@@ -0,0 +1,36 @@
1
+ const replaceSelection = function (html, selectInserted) {
2
+ let sel, range, fragment;
3
+ sel = window.getSelection();
4
+ if (sel.getRangeAt && sel.rangeCount) {
5
+ range = window.getSelection().getRangeAt(0);
6
+ range.deleteContents();
7
+ if (range.createContextualFragment) {
8
+ fragment = range.createContextualFragment(html);
9
+ }
10
+ else {
11
+ const div = document.createElement("div");
12
+ let child;
13
+ div.innerHTML = html;
14
+ fragment = document.createDocumentFragment();
15
+ while ((child = div.firstChild)) {
16
+ fragment.appendChild(child);
17
+ }
18
+ }
19
+ const firstInsertedNode = fragment.firstChild;
20
+ const lastInsertedNode = fragment.lastChild;
21
+ range.insertNode(fragment);
22
+ sel.removeAllRanges();
23
+ if (selectInserted) {
24
+ if (firstInsertedNode) {
25
+ range.setStartBefore(firstInsertedNode);
26
+ range.setEndAfter(lastInsertedNode);
27
+ }
28
+ sel.addRange(range);
29
+ }
30
+ else {
31
+ range.setStartAfter(lastInsertedNode);
32
+ sel.addRange(range);
33
+ }
34
+ }
35
+ };
36
+ export { replaceSelection };
@@ -0,0 +1,2 @@
1
+ declare const resize: () => void;
2
+ export { resize };
@@ -0,0 +1,38 @@
1
+ import { bbn } from '../definitions';
2
+ import { getCssVar } from './getCssVar';
3
+ import { each } from './each';
4
+ import { defaultResizeFunction } from './defaultResizeFunction';
5
+ const resize = function () {
6
+ let diffW = bbn.env.width !== window.innerWidth;
7
+ let diffH = bbn.env.height !== window.innerHeight;
8
+ if (diffW || diffH) {
9
+ if (diffW) {
10
+ bbn.env.width = window.innerWidth || window.document.documentElement.clientWidth || window.document.body.clientWidth;
11
+ document.documentElement.style.setProperty('--vw', (bbn.env.width * 0.01) + 'px');
12
+ }
13
+ if (diffH) {
14
+ bbn.env.height = window.innerHeight || window.document.documentElement.clientHeight || window.document.body.clientHeight;
15
+ document.documentElement.style.setProperty('--vh', (bbn.env.height * 0.01) + 'px');
16
+ }
17
+ let smallWidth = getCssVar('mobile-limit') || 650;
18
+ let newCls = 'bbn-screen-' + (bbn.env.width < parseInt(smallWidth) ? 'small' : 'regular');
19
+ let classes = (document.body.className || '').split(' ');
20
+ let done = false;
21
+ each(classes, (cls, idx) => {
22
+ let bits = cls.split('-');
23
+ if ((bits.length === 3) && (cls.indexOf('bbn-screen-') === 0)) {
24
+ done = true;
25
+ if (cls !== newCls) {
26
+ classes.splice(idx, 1, newCls);
27
+ }
28
+ return false;
29
+ }
30
+ });
31
+ if (!done) {
32
+ classes.push(newCls);
33
+ }
34
+ document.body.className = classes.join(' ');
35
+ defaultResizeFunction();
36
+ }
37
+ };
38
+ export { resize };
@@ -0,0 +1,2 @@
1
+ declare const rgb2hex: (rgb: any) => string;
2
+ export { rgb2hex };
@@ -0,0 +1,8 @@
1
+ const rgb2hex = function (rgb) {
2
+ rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
3
+ return (rgb && rgb.length === 4) ? "#" +
4
+ ("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) +
5
+ ("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) +
6
+ ("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
7
+ };
8
+ export { rgb2hex };
@@ -0,0 +1,2 @@
1
+ declare const riterate: (obj: any, fn: any, noPrivate: any) => any;
2
+ export { riterate };
@@ -0,0 +1,3 @@
1
+ import { iterate } from './iterate';
2
+ const riterate = function (obj, fn, noPrivate) { return iterate(obj, fn, noPrivate, true); };
3
+ export { riterate };
@@ -0,0 +1,2 @@
1
+ declare const roundDecimal: (value: any, decimals: any) => number;
2
+ export { roundDecimal };
@@ -0,0 +1,2 @@
1
+ const roundDecimal = function (value, decimals) { return Number(Math.round(value + 'e' + decimals) + 'e-' + decimals); };
2
+ export { roundDecimal };
@@ -0,0 +1,2 @@
1
+ declare const sanitize: (str: any, separator?: string) => any;
2
+ export { sanitize };
@@ -0,0 +1,17 @@
1
+ import { removeAccents } from './removeAccents';
2
+ import { trim } from './trim';
3
+ const sanitize = function (str, separator = '_') {
4
+ let escaped = ['[', ']', '{', '}', '(', ')', '-', '+', '*', '/'];
5
+ let exp = '[';
6
+ for (let i = 0; i < separator.length; i++) {
7
+ if (escaped.includes(separator[i])) {
8
+ exp += '\\';
9
+ }
10
+ exp += separator[i];
11
+ }
12
+ exp += ']+';
13
+ let re = new RegExp(exp, 'g');
14
+ let res = removeAccents(str).replace(/[^a-z0-9]/gi, separator).replace(re, separator);
15
+ return trim(res, separator);
16
+ };
17
+ export { sanitize };
@@ -0,0 +1,2 @@
1
+ declare const search: (arr: any, prop: any, val: any, operator: any, startFrom: any) => any;
2
+ export { search };
@@ -0,0 +1,62 @@
1
+ import { bbn } from '../definitions';
2
+ import { isIterable } from './isIterable';
3
+ import { isString } from './isString';
4
+ import { compareConditions } from './compareConditions';
5
+ import { filterToConditions } from './filterToConditions';
6
+ import { isObject } from './isObject';
7
+ import { numProperties } from './numProperties';
8
+ import { isNumber } from './isNumber';
9
+ const search = function (arr, prop, val, operator, startFrom) {
10
+ if (!isIterable(arr)) {
11
+ throw new Error(bbn._("The first argument for a search should be iterable") + " " + (typeof arr) + " " + bbn._("given"));
12
+ }
13
+ if (!arr.length) {
14
+ return -1;
15
+ }
16
+ let filter = {};
17
+ let isFunction = false;
18
+ if (isString(prop)) {
19
+ filter.conditions = [{ field: prop, value: val, operator: operator || '=' }];
20
+ }
21
+ else if (!prop) {
22
+ isFunction = true;
23
+ filter = a => { return compareConditions({ value: a }, filterToConditions({ logic: 'AND', conditions: [{ field: 'value', operator: operator || '=', value: val }] })); };
24
+ }
25
+ else {
26
+ startFrom = operator;
27
+ operator = val;
28
+ if (isObject(prop)) {
29
+ filter = prop;
30
+ }
31
+ else if (isFunction(prop)) {
32
+ isFunction = true;
33
+ filter = prop;
34
+ }
35
+ }
36
+ if (isFunction || (isObject(filter) && numProperties(filter))) {
37
+ if (isNumber(operator)) {
38
+ startFrom = operator;
39
+ operator = undefined;
40
+ }
41
+ if (!isNumber(startFrom)) {
42
+ startFrom = 0;
43
+ }
44
+ if (isFunction) {
45
+ for (let i = startFrom; i < arr.length; i++) {
46
+ if (filter(arr[i])) {
47
+ return i;
48
+ }
49
+ }
50
+ }
51
+ else {
52
+ filter = filterToConditions(filter);
53
+ for (let i = startFrom; i < arr.length; i++) {
54
+ if (compareConditions(arr[i], filter)) {
55
+ return i;
56
+ }
57
+ }
58
+ }
59
+ }
60
+ return -1;
61
+ };
62
+ export { search };
@@ -0,0 +1,2 @@
1
+ declare const selectElementText: (ele: any, win: any) => void;
2
+ export { selectElementText };
@@ -0,0 +1,23 @@
1
+ const selectElementText = function (ele, win) {
2
+ win = win || window;
3
+ if (ele instanceof HTMLInputElement) {
4
+ ele.select();
5
+ return;
6
+ }
7
+ let doc = win.document;
8
+ let sel;
9
+ let range;
10
+ if (win.getSelection && doc.createRange) {
11
+ sel = win.getSelection();
12
+ range = doc.createRange();
13
+ range.selectNodeContents(ele);
14
+ sel.removeAllRanges();
15
+ sel.addRange(range);
16
+ }
17
+ else if (doc.body.createTextRange) {
18
+ range = doc.body.createTextRange();
19
+ range.moveToElementText(ele);
20
+ range.select();
21
+ }
22
+ };
23
+ export { selectElementText };
@@ -0,0 +1,2 @@
1
+ declare const selector: (ele: any) => any;
2
+ export { selector };
@@ -0,0 +1,2 @@
1
+ const selector = function (ele) { return (typeof el === 'string') ? document.querySelector(ele) : ele; };
2
+ export { selector };
@@ -0,0 +1,2 @@
1
+ declare const setCookie: (name: any, value: any, days: any) => void;
2
+ export { setCookie };
@@ -0,0 +1,11 @@
1
+ const setCookie = function (name, value, days) {
2
+ let expires = "";
3
+ if (days) {
4
+ let date = new Date();
5
+ date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
6
+ expires = "; expires=" + date.toUTCString();
7
+ }
8
+ let st = escape(JSON.stringify({ value: value }));
9
+ document.cookie = name + "=" + st + expires + "; path=/";
10
+ };
11
+ export { setCookie };
@@ -0,0 +1,2 @@
1
+ declare const setCssVar: (varname: any, value: any) => void;
2
+ export { setCssVar };
@@ -0,0 +1,7 @@
1
+ const setCssVar = function (varname, value) {
2
+ if (varname.indexOf('--') !== 0) {
3
+ varname = '--' + varname;
4
+ }
5
+ document.documentElement.setProperty(varname, value);
6
+ };
7
+ export { setCssVar };
@@ -0,0 +1,2 @@
1
+ declare const setNavigationVars: (url: any, title: any, data: any, repl: any) => void;
2
+ export { setNavigationVars };
@@ -0,0 +1,39 @@
1
+ import { bbn } from '../definitions';
2
+ import { substr } from './substr';
3
+ import { filter } from './filter';
4
+ import { extend } from './extend';
5
+ import { html2text } from './html2text';
6
+ const setNavigationVars = function (url, title, data, repl) {
7
+ bbn.env.old_path = bbn.env.path;
8
+ bbn.env.url = ['https:/', 'http://'].includes(substr(url, 0, 7)) ? url : bbn.env.root + url;
9
+ bbn.env.path = substr(bbn.env.url, bbn.env.root.length);
10
+ bbn.env.params = filter(bbn.env.path.split("/"), (v) => { return v !== ''; });
11
+ let h = window.history;
12
+ if (h) {
13
+ let state = h.state;
14
+ let obj = { url: bbn.env.path, old_path: bbn.env.old_path || null, data: data || {} };
15
+ if (state && (state.url === bbn.env.path)) {
16
+ if (state.data) {
17
+ extend(obj.data, state.data);
18
+ }
19
+ if (state.title && !title) {
20
+ title = state.title;
21
+ }
22
+ repl = 1;
23
+ }
24
+ if (!title) {
25
+ title = bbn.env.siteTitle;
26
+ }
27
+ else {
28
+ title = html2text(title);
29
+ }
30
+ if (repl) {
31
+ obj.reload = 1;
32
+ h.replaceState(obj, title, bbn.env.url);
33
+ }
34
+ else {
35
+ h.pushState(obj, title, bbn.env.url);
36
+ }
37
+ }
38
+ };
39
+ export { setNavigationVars };
@@ -0,0 +1,2 @@
1
+ declare const setProp: (obj: any, prop: any, value: any, writable?: boolean, configurable?: boolean) => void;
2
+ export { setProp };
@@ -0,0 +1,3 @@
1
+ import { bbn } from '../definitions';
2
+ const setProp = function (obj, prop, value, writable = true, configurable = true) { checkType(prop, "string", bbn._("The prop must be a string in setProp")); checkType(obj, "object", bbn._("The obj must be an object in setProp")); Object.defineProperty(obj, prop, { value: value, writable: writable, configurable: configurable }); };
3
+ export { setProp };
@@ -0,0 +1,2 @@
1
+ declare const setProperty: (obj: any, prop: any, value: any, force: any) => void;
2
+ export { setProperty };
@@ -0,0 +1,23 @@
1
+ import { bbn } from '../definitions';
2
+ import { each } from './each';
3
+ const setProperty = function (obj, prop, value, force) {
4
+ if ((typeof obj === 'object') && (typeof prop === 'string')) {
5
+ let o = obj;
6
+ const bits = prop.split('.');
7
+ each(bits, (v, i) => {
8
+ if (!o) {
9
+ if (!force) {
10
+ throw new Error(bbn._("The object is invalid"));
11
+ }
12
+ o = {};
13
+ }
14
+ if (bits.length - 1 === i) {
15
+ o[v] = value;
16
+ }
17
+ else {
18
+ o = o[v];
19
+ }
20
+ });
21
+ }
22
+ };
23
+ export { setProperty };
@@ -0,0 +1,2 @@
1
+ declare const shorten: (st: any, len: any, adj: any) => any;
2
+ export { shorten };
@@ -0,0 +1,18 @@
1
+ import { bbn } from '../definitions';
2
+ import { isString } from './isString';
3
+ import { substr } from './substr';
4
+ const shorten = function (st, len, adj) {
5
+ if (typeof (st).toLowerCase() === 'string') {
6
+ if (!len) {
7
+ len = bbn.var.shortenLen;
8
+ }
9
+ if ((adj === undefined) || !isString(adj)) {
10
+ adj = '...';
11
+ }
12
+ if (st.length > len) {
13
+ st = substr(st, 0, len) + adj;
14
+ }
15
+ }
16
+ return st;
17
+ };
18
+ export { shorten };
@@ -0,0 +1,3 @@
1
+ import { shortenObj } from './shortenObj';
2
+ declare const shortenObj: (obj: any, max?: number) => any;
3
+ export { shortenObj };
@@ -0,0 +1,17 @@
1
+ import { clone } from './clone';
2
+ import { each } from './each';
3
+ import { isString } from './isString';
4
+ import { shorten } from './shorten';
5
+ const shortenObj = function (obj, max = 100) {
6
+ let o = clone(obj);
7
+ each(o, (a, n) => {
8
+ if (isString(a) && (a.length > max)) {
9
+ o[n] = shorten(a, max);
10
+ }
11
+ else if (a && (typeof a === 'object')) {
12
+ o[n] = shortenObj(a);
13
+ }
14
+ });
15
+ return o;
16
+ };
17
+ export { shortenObj };
@@ -1,7 +1,2 @@
1
- /**
2
- *
3
- * @param {Array} array
4
- * @returns Array
5
- */
6
1
  declare const shuffle: (array: any) => any;
7
2
  export { shuffle };
@@ -1,19 +1,9 @@
1
- /**
2
- *
3
- * @param {Array} array
4
- * @returns Array
5
- */
6
1
  const shuffle = function (array) {
7
2
  let currentIndex = array.length, randomIndex;
8
- // While there remain elements to shuffle.
9
3
  while (currentIndex != 0) {
10
- // Pick a remaining element.
11
4
  randomIndex = Math.floor(Math.random() * currentIndex);
12
5
  currentIndex--;
13
- // And swap it with the current element.
14
- [array[currentIndex], array[randomIndex]] = [
15
- array[randomIndex], array[currentIndex]
16
- ];
6
+ [array[currentIndex], array[randomIndex]] = [array[randomIndex], array[currentIndex]];
17
7
  }
18
8
  return array;
19
9
  };
@@ -0,0 +1,2 @@
1
+ declare const simpleHash: (str: any) => any;
2
+ export { simpleHash };
@@ -0,0 +1,4 @@
1
+ import { simpleHash1 } from './simpleHash1';
2
+ import { simpleHash2 } from './simpleHash2';
3
+ const simpleHash = function (str) { const part1 = simpleHash1(str).toString(16).padStart(8, '0'); const part2 = simpleHash2(str).toString(16).padStart(8, '0'); return part1 + part2; };
4
+ export { simpleHash };
@@ -0,0 +1,2 @@
1
+ declare const simpleHash1: (str: any) => number;
2
+ export { simpleHash1 };
@@ -0,0 +1,10 @@
1
+ const simpleHash1 = function (str) {
2
+ let hash = 0;
3
+ for (let i = 0; i < str.length; i++) {
4
+ const char = str.charCodeAt(i);
5
+ hash = ((hash << 5) - hash) + char;
6
+ hash |= 0;
7
+ }
8
+ return hash;
9
+ };
10
+ export { simpleHash1 };
@@ -0,0 +1,2 @@
1
+ declare const simpleHash2: (str: any) => number;
2
+ export { simpleHash2 };
@@ -0,0 +1,10 @@
1
+ const simpleHash2 = function (str) {
2
+ let hash = 0;
3
+ for (let i = 0; i < str.length; i++) {
4
+ const char = str.charCodeAt(i);
5
+ hash = char + (hash << 6) + (hash << 16) - hash;
6
+ hash |= 0;
7
+ }
8
+ return hash;
9
+ };
10
+ export { simpleHash2 };
@@ -0,0 +1,2 @@
1
+ declare const startChrono: (name: any) => void;
2
+ export { startChrono };
@@ -0,0 +1,13 @@
1
+ import { each } from './each';
2
+ const startChrono = function (name) {
3
+ let now = (new Date()).getTime();
4
+ let h1 = 3600 * 1000;
5
+ if (_private.length) {
6
+ each(_private, (t, n) => { if (now - t > h1) {
7
+ delete _private[n];
8
+ } });
9
+ now = (new Date()).getTime();
10
+ }
11
+ _private[name] = now;
12
+ };
13
+ export { startChrono };