Advertisement
pharmokan

helper utility library notes

Apr 14th, 2020
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.06 KB | None | 0 0
  1. need helpers for SUGAR LIBRARY TO EXTEND need helpers for SUGAR LIBRARY TO EXTEND
  2. --- ---
  3. unique from arr uniq unique unique from arr uniq unique
  4. unique from arr and arr2 (in arr but not in arr2, in arr2, but not in arr) uniq missingfromboth unique from arr and arr2 (in arr but not in arr2, in arr2, but not in arr) uniq missingfromboth
  5. unique in arr that is not in arr2 notin prototype missing unique in arr that is not in arr2 notin prototype missing
  6. same from arr same same from arr same
  7. same in arr and arr2 same samein same in arr and arr2 same samein
  8. remove in arr that are in arr2 remove prototype remove in arr that are in arr2 remove prototype
  9. remove in arr that are not in arr2 remove prototype remove in arr that are not in arr2 remove prototype
  10. filter in arr that are in arr2 ? Same filter in arr that are in arr2 ? Same
  11. filter in arr that are not in arr2 ?same filter in arr that are not in arr2 ?same
  12. add to arr items that are in arr2 but not in arr addUnique prototype add to arr items that are in arr2 but not in arr addUnique prototype
  13. arr contains arr2[i] isin prototype contains arr contains arr2[i] isin prototype contains
  14. math.max.apply max prototype math.max.apply max
  15. math.min.apply min prototype math.min.apply min
  16. regex | match | test regex regex | match | test regex
  17. math.abs abs math.abs abs
  18. toString string str toString string str
  19. parseInt num parseInt num
  20. is empty isempty empty is empty isempty empty
  21. null | undefined | '' | 0 | [] | {} exists take FROM RAMDA null | undefined | '' | 0 | [] | {} exists take FROM RAMDA
  22. swap swap swap swap
  23. indexof | position pos position idxof inarr indexof | position pos position idxof inarr
  24. match by common key object
  25.  
  26. obj obj
  27. --- ---
  28. entries keys entries keys
  29. values vals value val values vals value val
  30. has value hasval has value hasval
  31. key exists keyexist haskey key exists keyexist haskey
  32. assign if key not exist key assign if key not exist key
  33. pick pick pick pick
  34. omit omit omit omit
  35. match/merge by common key object
  36. merge merge combine
  37. fs fs
  38. -- --
  39. readdir getfiles readdir getfiles
  40. chdir cd chdir cd
  41. rename rename ren rename rename
  42. copy cp copy cp
  43. move mv move mv
  44. executecmdon(file,fn) exec executecmdon(file,fn) exec
  45. recycle bin del recycle bin del
  46. getdirs getdirs getdirs
  47.  
  48. need snippets for need snippets for
  49. --- ---
  50. arrays arrays
  51. -- --
  52. filter fil filter filter fil filter
  53. reduce red reduce reduce red reduce
  54. map map map map
  55. length as l l length as l l
  56. indexof iof indexof iof
  57. splice as sp or spl spl sp splice as sp or spl spl sp
  58. push push push push
  59. join join join join
  60. concat concat con conc concat concat con conc
  61. every every all every every all
  62. some some som some some som
  63. includes includes inc includes includes inc
  64. sort sort sort sort
  65.  
  66. strings strings
  67. -- --
  68. split split split split
  69. replace replace rep replace replace rep
  70. regex regex regex regex
  71. match match match match
  72. test test test test
  73.  
  74. dir.getfiles.split('\.')[0].split('_')[0].unique.as('storis').then(getsku.prepend("#")).merge('storis')
  75.  
  76. dir ret string
  77. getfiles static method ret arr
  78. split function ret [arr]
  79. unique static method
  80. as function ret global key,pair var
  81. then promise
  82. getsku static method
  83. prepend function ret
  84. merge function ret key,pair global var + input
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement