Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: planttheidea/inline-loops.macro
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.2.0
Choose a base ref
...
head repository: planttheidea/inline-loops.macro
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Jun 17, 2019

  1. Copy the full SHA
    ab6b7ab View commit details

Commits on Jun 19, 2019

  1. add console warnings for deopt scenarios (#10)

    When a refactor could provide better inlining mechanisms, notify in the console.
    planttheidea authored Jun 19, 2019
    Copy the full SHA
    fb5d7c4 View commit details
  2. Release 1.2.1

    planttheidea committed Jun 19, 2019
    Copy the full SHA
    06c8ad6 View commit details
  3. update dist

    planttheidea committed Jun 19, 2019
    Copy the full SHA
    f03ee9e View commit details

Commits on Jun 27, 2019

  1. Copy the full SHA
    f7618b1 View commit details
  2. Release 1.2.2

    planttheidea committed Jun 27, 2019
    Copy the full SHA
    f91a68a View commit details

Commits on Aug 4, 2019

  1. update dependencies

    planttheidea committed Aug 4, 2019
    Copy the full SHA
    47295a4 View commit details

Commits on Nov 23, 2019

  1. Bump eslint-utils from 1.4.0 to 1.4.3 (#13)

    Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.4.0 to 1.4.3.
    - [Release notes](https://github.com/mysticatea/eslint-utils/releases)
    - [Commits](mysticatea/eslint-utils@v1.4.0...v1.4.3)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored and planttheidea committed Nov 23, 2019
    Copy the full SHA
    3fdec71 View commit details

Commits on Dec 28, 2019

  1. Copy the full SHA
    02926a2 View commit details
  2. Merge pull request #14 from planttheidea/dependabot/npm_and_yarn/hand…

    …lebars-4.5.3
    
    Bump handlebars from 4.1.2 to 4.5.3
    planttheidea authored Dec 28, 2019
    Copy the full SHA
    3c4be5f View commit details

Commits on Mar 15, 2020

  1. Bump acorn from 5.7.3 to 5.7.4

    Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
    - [Release notes](https://github.com/acornjs/acorn/releases)
    - [Commits](acornjs/acorn@5.7.3...5.7.4)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 15, 2020
    Copy the full SHA
    fecb54b View commit details
  2. Merge pull request #15 from planttheidea/dependabot/npm_and_yarn/acor…

    …n-5.7.4
    
    Bump acorn from 5.7.3 to 5.7.4
    planttheidea authored Mar 15, 2020
    Copy the full SHA
    c605f64 View commit details

Commits on Jul 17, 2020

  1. Bump lodash from 4.17.15 to 4.17.19

    Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
    - [Release notes](https://github.com/lodash/lodash/releases)
    - [Commits](lodash/lodash@4.17.15...4.17.19)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Jul 17, 2020
    Copy the full SHA
    7d01d91 View commit details

Commits on Jul 21, 2020

  1. Merge pull request #17 from planttheidea/dependabot/npm_and_yarn/loda…

    …sh-4.17.19
    
    Bump lodash from 4.17.15 to 4.17.19
    planttheidea authored Jul 21, 2020
    Copy the full SHA
    11437d1 View commit details

Commits on Dec 18, 2023

  1. V2 (#31)

    * update dependencies to latest
    
    * initial implementation of working transform with existing unit tests
    
    * fix eslint and get all tests passing
    
    * abstract out templates
    
    * abstract out traverse configs
    
    * abstract out utils
    
    * abstract handlers
    
    * delete previous setup
    
    * rename `callback` to `handler`
    
    * refine types
    
    * convert to TS and ESM
    
    * code cleanup
    
    * hoist type
    
    * Release 2.0.0-beta.0
    
    * clean up README
    
    * add CHANGELOG
    
    * rename tests and fix bad transforms
    
    * forgot one more
    
    * support usage in conditionals
    
    * Release 2.0.0-beta.1
    
    * support unary and binary expressions
    
    * also add `await` expressions
    
    * better handling of lazy usages
    
    * prevent `dist` from being stored in github
    
    * remove dist from git
    
    * centralize and improve IIFE wrapping
    
    * Release 2.0.0-beta.2
    
    * ensure top-level conditionals are respected
    
    * Release 2.0.0-beta.3
    
    * improve README
    
    * remove unused variable in template
    
    * rename `logic` to `returned` and fix unit tests
    planttheidea authored Dec 18, 2023
    Copy the full SHA
    69b7e93 View commit details
  2. Release 2.0.0

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    73e9846 View commit details
  3. Copy the full SHA
    45e0d85 View commit details
  4. update CHANGELOG

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    6024188 View commit details
  5. Release 2.0.1

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    2ecb4da View commit details
  6. prevent forEach methods from hoisting early returns, instead just c…

    …onverting to `continue` statements (#33)
    planttheidea authored Dec 18, 2023
    Copy the full SHA
    dbf6ab0 View commit details
  7. Copy the full SHA
    6607ece View commit details
  8. Copy the full SHA
    a6cc882 View commit details
  9. Release 2.0.2

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    c55a517 View commit details
  10. update CHANGELOG

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    9ec2cad View commit details
  11. [Fix] Types support read-only collections (#36)

    * support readonly arrays / objects
    
    * fix optional typing
    planttheidea authored Dec 18, 2023
    Copy the full SHA
    811a1e5 View commit details
  12. update CHANGELOG

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    2d53c9b View commit details
  13. Release 2.0.3

    planttheidea committed Dec 18, 2023
    Copy the full SHA
    0c90e0d View commit details

Commits on Dec 19, 2023

  1. Be smarter with when to wrap in IIFE (#37)

    * refactor `shouldWrapInClosure` to be more based on the owner than the contents
    
    * handle `await` expressions
    
    * handle JSX usage better
    
    * clean up commented code
    
    * update CHANGELOG
    planttheidea authored Dec 19, 2023
    Copy the full SHA
    111cfa7 View commit details
  2. Release 2.0.4

    planttheidea committed Dec 19, 2023
    Copy the full SHA
    3e6afcd View commit details
Showing with 8,933 additions and 8,313 deletions.
  1. +16 −0 .babelrc
  2. +13 −0 .eslintrc
  3. +2 −1 .gitignore
  4. +13 −0 .npmignore
  5. +0 −1 .npmrc
  6. +8 −0 .prettierrc
  7. +64 −0 CHANGELOG.md
  8. +136 −137 README.md
  9. +9 −5 __tests__/__fixtures__/bailout/early-return/code.js
  10. +23 −16 __tests__/__fixtures__/bailout/early-return/output.js
  11. +10 −14 __tests__/__fixtures__/bailout/multiple-returns/output.js
  12. +10 −8 __tests__/__fixtures__/cached/every/output.js
  13. +8 −10 __tests__/__fixtures__/cached/everyObject/output.js
  14. +6 −8 __tests__/__fixtures__/cached/everyRight/output.js
  15. +11 −6 __tests__/__fixtures__/cached/filter/output.js
  16. +8 −8 __tests__/__fixtures__/cached/filterObject/output.js
  17. +8 −6 __tests__/__fixtures__/cached/filterRight/output.js
  18. +10 −8 __tests__/__fixtures__/cached/find/output.js
  19. +10 −8 __tests__/__fixtures__/cached/findIndex/output.js
  20. +0 −3 __tests__/__fixtures__/cached/findIndexRight/code.js
  21. +0 −12 __tests__/__fixtures__/cached/findIndexRight/output.js
  22. +8 −10 __tests__/__fixtures__/cached/findKey/output.js
  23. +3 −0 __tests__/__fixtures__/cached/findLast/code.js
  24. +10 −0 __tests__/__fixtures__/cached/findLast/output.js
  25. +3 −0 __tests__/__fixtures__/cached/findLastIndex/code.js
  26. +10 −0 __tests__/__fixtures__/cached/findLastIndex/output.js
  27. +6 −10 __tests__/__fixtures__/cached/findObject/output.js
  28. +0 −3 __tests__/__fixtures__/cached/findRight/code.js
  29. +0 −12 __tests__/__fixtures__/cached/findRight/output.js
  30. +9 −7 __tests__/__fixtures__/cached/flatMap/output.js
  31. +5 −7 __tests__/__fixtures__/cached/flatMapRight/output.js
  32. +1 −1 __tests__/__fixtures__/cached/forEach/output.js
  33. +2 −3 __tests__/__fixtures__/cached/forEachObject/output.js
  34. +2 −2 __tests__/__fixtures__/cached/forEachRight/output.js
  35. +5 −6 __tests__/__fixtures__/cached/map/output.js
  36. +4 −7 __tests__/__fixtures__/cached/mapObject/output.js
  37. +6 −6 __tests__/__fixtures__/cached/mapRight/output.js
  38. +3 −5 __tests__/__fixtures__/cached/reduce-no-initialValue/output.js
  39. +3 −5 __tests__/__fixtures__/cached/reduce/output.js
  40. +11 −15 __tests__/__fixtures__/cached/reduceObject-no-initialValue/output.js
  41. +11 −8 __tests__/__fixtures__/cached/reduceObject/output.js
  42. +4 −7 __tests__/__fixtures__/cached/reduceRight-no-initialValue/output.js
  43. +4 −6 __tests__/__fixtures__/cached/reduceRight/output.js
  44. +10 −8 __tests__/__fixtures__/cached/some/output.js
  45. +8 −10 __tests__/__fixtures__/cached/someObject/output.js
  46. +6 −8 __tests__/__fixtures__/cached/someRight/output.js
  47. +5 −0 __tests__/__fixtures__/complex/array-element/code.js
  48. +9 −0 __tests__/__fixtures__/complex/array-element/output.js
  49. +5 −0 __tests__/__fixtures__/complex/async-await/code.js
  50. +16 −0 __tests__/__fixtures__/complex/async-await/output.js
  51. +5 −0 __tests__/__fixtures__/complex/binary-expression/code.js
  52. +8 −0 __tests__/__fixtures__/complex/binary-expression/output.js
  53. +0 −14 __tests__/__fixtures__/complex/conditional/output.js
  54. +24 −24 __tests__/__fixtures__/complex/contrived/output.js
  55. +21 −17 __tests__/__fixtures__/complex/deep-every/output.js
  56. +12 −9 __tests__/__fixtures__/complex/deep-iterable/output.js
  57. +5 −8 __tests__/__fixtures__/complex/deep-map/output.js
  58. +5 −0 __tests__/__fixtures__/complex/default-parameter/code.js
  59. +14 −0 __tests__/__fixtures__/complex/default-parameter/output.js
  60. +9 −6 __tests__/__fixtures__/complex/destructured-params-array/output.js
  61. +10 −9 __tests__/__fixtures__/complex/destructured-params-object/output.js
  62. +12 −0 __tests__/__fixtures__/complex/for-each-early-return/code.js
  63. +10 −0 __tests__/__fixtures__/complex/for-each-early-return/output.js
  64. +12 −0 __tests__/__fixtures__/complex/for-each-hoisted/code.js
  65. +13 −0 __tests__/__fixtures__/complex/for-each-hoisted/output.js
  66. +12 −0 __tests__/__fixtures__/complex/for-each-right-early-return/code.js
  67. +10 −0 __tests__/__fixtures__/complex/for-each-right-early-return/output.js
  68. +12 −0 __tests__/__fixtures__/complex/for-each-right-hoisted/code.js
  69. +13 −0 __tests__/__fixtures__/complex/for-each-right-hoisted/output.js
  70. +14 −0 __tests__/__fixtures__/complex/if-statement-object/code.js
  71. +18 −0 __tests__/__fixtures__/complex/if-statement-object/output.js
  72. +2 −2 __tests__/__fixtures__/complex/{conditional → if-statement}/code.js
  73. +14 −0 __tests__/__fixtures__/complex/if-statement/output.js
  74. +42 −41 __tests__/__fixtures__/complex/inlined-large-function/output.js
  75. +12 −0 __tests__/__fixtures__/complex/jsx-conditional/code.js
  76. +23 −0 __tests__/__fixtures__/complex/jsx-conditional/output.js
  77. +13 −12 __tests__/__fixtures__/complex/jsx/output.js
  78. +5 −0 __tests__/__fixtures__/complex/logical-expression-left/code.js
  79. +8 −0 __tests__/__fixtures__/complex/logical-expression-left/output.js
  80. +5 −0 __tests__/__fixtures__/complex/logical-expression-nested/code.js
  81. +14 −0 __tests__/__fixtures__/complex/logical-expression-nested/output.js
  82. +5 −0 __tests__/__fixtures__/complex/logical-expression-right/code.js
  83. +14 −0 __tests__/__fixtures__/complex/logical-expression-right/output.js
  84. +8 −0 __tests__/__fixtures__/complex/object-property/code.js
  85. +12 −0 __tests__/__fixtures__/complex/object-property/output.js
  86. +12 −10 __tests__/__fixtures__/complex/shallow-every/output.js
  87. +3 −1 __tests__/__fixtures__/complex/shallow-iterable/code.js
  88. +16 −15 __tests__/__fixtures__/complex/shallow-iterable/output.js
  89. +6 −7 __tests__/__fixtures__/complex/shallow-map/output.js
  90. +5 −0 __tests__/__fixtures__/complex/ternary-alternative/code.js
  91. +13 −0 __tests__/__fixtures__/complex/ternary-alternative/output.js
  92. +5 −0 __tests__/__fixtures__/complex/ternary-condition/code.js
  93. +8 −0 __tests__/__fixtures__/complex/ternary-condition/output.js
  94. +5 −0 __tests__/__fixtures__/complex/ternary-consequence/code.js
  95. +13 −0 __tests__/__fixtures__/complex/ternary-consequence/output.js
  96. +5 −0 __tests__/__fixtures__/complex/ternary-nested/code.js
  97. +14 −0 __tests__/__fixtures__/complex/ternary-nested/output.js
  98. +9 −7 __tests__/__fixtures__/complex/this/output.js
  99. +5 −0 __tests__/__fixtures__/complex/unary-expression/code.js
  100. +8 −0 __tests__/__fixtures__/complex/unary-expression/output.js
  101. +10 −8 __tests__/__fixtures__/inlined-arrow-expression/every/output.js
  102. +8 −10 __tests__/__fixtures__/inlined-arrow-expression/everyObject/output.js
  103. +6 −8 __tests__/__fixtures__/inlined-arrow-expression/everyRight/output.js
  104. +11 −6 __tests__/__fixtures__/inlined-arrow-expression/filter/output.js
  105. +8 −8 __tests__/__fixtures__/inlined-arrow-expression/filterObject/output.js
  106. +8 −6 __tests__/__fixtures__/inlined-arrow-expression/filterRight/output.js
  107. +10 −8 __tests__/__fixtures__/inlined-arrow-expression/find/output.js
  108. +10 −8 __tests__/__fixtures__/inlined-arrow-expression/findIndex/output.js
  109. +0 −3 __tests__/__fixtures__/inlined-arrow-expression/findIndexRight/code.js
  110. +0 −12 __tests__/__fixtures__/inlined-arrow-expression/findIndexRight/output.js
  111. +8 −10 __tests__/__fixtures__/inlined-arrow-expression/findKey/output.js
  112. +3 −0 __tests__/__fixtures__/inlined-arrow-expression/findLast/code.js
  113. +10 −0 __tests__/__fixtures__/inlined-arrow-expression/findLast/output.js
  114. +3 −0 __tests__/__fixtures__/inlined-arrow-expression/findLastIndex/code.js
  115. +10 −0 __tests__/__fixtures__/inlined-arrow-expression/findLastIndex/output.js
  116. +6 −10 __tests__/__fixtures__/inlined-arrow-expression/findObject/output.js
  117. +0 −3 __tests__/__fixtures__/inlined-arrow-expression/findRight/code.js
  118. +0 −12 __tests__/__fixtures__/inlined-arrow-expression/findRight/output.js
  119. +10 −8 __tests__/__fixtures__/inlined-arrow-expression/flatMap/output.js
  120. +6 −8 __tests__/__fixtures__/inlined-arrow-expression/flatMapRight/output.js
  121. +1 −1 __tests__/__fixtures__/inlined-arrow-expression/forEach/output.js
  122. +2 −3 __tests__/__fixtures__/inlined-arrow-expression/forEachObject/output.js
  123. +2 −2 __tests__/__fixtures__/inlined-arrow-expression/forEachRight/output.js
  124. +5 −6 __tests__/__fixtures__/inlined-arrow-expression/map/output.js
  125. +4 −7 __tests__/__fixtures__/inlined-arrow-expression/mapObject/output.js
  126. +6 −6 __tests__/__fixtures__/inlined-arrow-expression/mapRight/output.js
  127. +3 −5 __tests__/__fixtures__/inlined-arrow-expression/reduce-no-initialValue/output.js
  128. +3 −5 __tests__/__fixtures__/inlined-arrow-expression/reduce/output.js
  129. +11 −15 __tests__/__fixtures__/inlined-arrow-expression/reduceObject-no-initialValue/output.js
  130. +11 −8 __tests__/__fixtures__/inlined-arrow-expression/reduceObject/output.js
  131. +4 −7 __tests__/__fixtures__/inlined-arrow-expression/reduceRight-no-initialValue/output.js
  132. +4 −6 __tests__/__fixtures__/inlined-arrow-expression/reduceRight/output.js
  133. +10 −8 __tests__/__fixtures__/inlined-arrow-expression/some/output.js
  134. +8 −10 __tests__/__fixtures__/inlined-arrow-expression/someObject/output.js
  135. +6 −8 __tests__/__fixtures__/inlined-arrow-expression/someRight/output.js
  136. +10 −8 __tests__/__fixtures__/inlined-arrow-return/every/output.js
  137. +8 −10 __tests__/__fixtures__/inlined-arrow-return/everyObject/output.js
  138. +6 −8 __tests__/__fixtures__/inlined-arrow-return/everyRight/output.js
  139. +11 −6 __tests__/__fixtures__/inlined-arrow-return/filter/output.js
  140. +8 −8 __tests__/__fixtures__/inlined-arrow-return/filterObject/output.js
  141. +8 −6 __tests__/__fixtures__/inlined-arrow-return/filterRight/output.js
  142. +10 −8 __tests__/__fixtures__/inlined-arrow-return/find/output.js
  143. +10 −8 __tests__/__fixtures__/inlined-arrow-return/findIndex/output.js
  144. +0 −5 __tests__/__fixtures__/inlined-arrow-return/findIndexRight/code.js
  145. +0 −12 __tests__/__fixtures__/inlined-arrow-return/findIndexRight/output.js
  146. +8 −10 __tests__/__fixtures__/inlined-arrow-return/findKey/output.js
  147. +5 −0 __tests__/__fixtures__/inlined-arrow-return/findLast/code.js
  148. +10 −0 __tests__/__fixtures__/inlined-arrow-return/findLast/output.js
  149. +5 −0 __tests__/__fixtures__/inlined-arrow-return/findLastIndex/code.js
  150. +10 −0 __tests__/__fixtures__/inlined-arrow-return/findLastIndex/output.js
  151. +6 −10 __tests__/__fixtures__/inlined-arrow-return/findObject/output.js
  152. +0 −5 __tests__/__fixtures__/inlined-arrow-return/findRight/code.js
  153. +0 −12 __tests__/__fixtures__/inlined-arrow-return/findRight/output.js
  154. +10 −8 __tests__/__fixtures__/inlined-arrow-return/flatMap/output.js
  155. +6 −8 __tests__/__fixtures__/inlined-arrow-return/flatMapRight/output.js
  156. +1 −1 __tests__/__fixtures__/inlined-arrow-return/forEach/output.js
  157. +2 −3 __tests__/__fixtures__/inlined-arrow-return/forEachObject/output.js
  158. +2 −2 __tests__/__fixtures__/inlined-arrow-return/forEachRight/output.js
  159. +5 −6 __tests__/__fixtures__/inlined-arrow-return/map/output.js
  160. +4 −7 __tests__/__fixtures__/inlined-arrow-return/mapObject/output.js
  161. +6 −6 __tests__/__fixtures__/inlined-arrow-return/mapRight/output.js
  162. +3 −5 __tests__/__fixtures__/inlined-arrow-return/reduce-no-initialValue/output.js
  163. +3 −5 __tests__/__fixtures__/inlined-arrow-return/reduce/output.js
  164. +11 −15 __tests__/__fixtures__/inlined-arrow-return/reduceObject-no-initialValue/output.js
  165. +11 −8 __tests__/__fixtures__/inlined-arrow-return/reduceObject/output.js
  166. +4 −7 __tests__/__fixtures__/inlined-arrow-return/reduceRight-no-initialValue/output.js
  167. +4 −6 __tests__/__fixtures__/inlined-arrow-return/reduceRight/output.js
  168. +10 −8 __tests__/__fixtures__/inlined-arrow-return/some/output.js
  169. +8 −10 __tests__/__fixtures__/inlined-arrow-return/someObject/output.js
  170. +6 −8 __tests__/__fixtures__/inlined-arrow-return/someRight/output.js
  171. +10 −8 __tests__/__fixtures__/inlined-function-return/every/output.js
  172. +8 −10 __tests__/__fixtures__/inlined-function-return/everyObject/output.js
  173. +6 −8 __tests__/__fixtures__/inlined-function-return/everyRight/output.js
  174. +11 −6 __tests__/__fixtures__/inlined-function-return/filter/output.js
  175. +8 −8 __tests__/__fixtures__/inlined-function-return/filterObject/output.js
  176. +8 −6 __tests__/__fixtures__/inlined-function-return/filterRight/output.js
  177. +10 −8 __tests__/__fixtures__/inlined-function-return/find/output.js
  178. +10 −8 __tests__/__fixtures__/inlined-function-return/findIndex/output.js
  179. +0 −5 __tests__/__fixtures__/inlined-function-return/findIndexRight/code.js
  180. +0 −12 __tests__/__fixtures__/inlined-function-return/findIndexRight/output.js
  181. +8 −10 __tests__/__fixtures__/inlined-function-return/findKey/output.js
  182. +5 −0 __tests__/__fixtures__/inlined-function-return/findLast/code.js
  183. +10 −0 __tests__/__fixtures__/inlined-function-return/findLast/output.js
  184. +5 −0 __tests__/__fixtures__/inlined-function-return/findLastIndex/code.js
  185. +10 −0 __tests__/__fixtures__/inlined-function-return/findLastIndex/output.js
  186. +6 −10 __tests__/__fixtures__/inlined-function-return/findObject/output.js
  187. +0 −5 __tests__/__fixtures__/inlined-function-return/findRight/code.js
  188. +0 −12 __tests__/__fixtures__/inlined-function-return/findRight/output.js
  189. +10 −8 __tests__/__fixtures__/inlined-function-return/flatMap/output.js
  190. +6 −8 __tests__/__fixtures__/inlined-function-return/flatMapRight/output.js
  191. +1 −1 __tests__/__fixtures__/inlined-function-return/forEach/output.js
  192. +2 −3 __tests__/__fixtures__/inlined-function-return/forEachObject/output.js
  193. +2 −2 __tests__/__fixtures__/inlined-function-return/forEachRight/output.js
  194. +5 −6 __tests__/__fixtures__/inlined-function-return/map/output.js
  195. +4 −7 __tests__/__fixtures__/inlined-function-return/mapObject/output.js
  196. +6 −6 __tests__/__fixtures__/inlined-function-return/mapRight/output.js
  197. +3 −5 __tests__/__fixtures__/inlined-function-return/reduce-no-initialValue/output.js
  198. +3 −5 __tests__/__fixtures__/inlined-function-return/reduce/output.js
  199. +11 −15 __tests__/__fixtures__/inlined-function-return/reduceObject-no-initialValue/output.js
  200. +11 −8 __tests__/__fixtures__/inlined-function-return/reduceObject/output.js
  201. +4 −7 __tests__/__fixtures__/inlined-function-return/reduceRight-no-initialValue/output.js
  202. +4 −6 __tests__/__fixtures__/inlined-function-return/reduceRight/output.js
  203. +10 −8 __tests__/__fixtures__/inlined-function-return/some/output.js
  204. +8 −10 __tests__/__fixtures__/inlined-function-return/someObject/output.js
  205. +6 −8 __tests__/__fixtures__/inlined-function-return/someRight/output.js
  206. +12 −11 __tests__/__fixtures__/uncached/every/output.js
  207. +11 −14 __tests__/__fixtures__/uncached/everyObject/output.js
  208. +8 −11 __tests__/__fixtures__/uncached/everyRight/output.js
  209. +13 −10 __tests__/__fixtures__/uncached/filter/output.js
  210. +11 −13 __tests__/__fixtures__/uncached/filterObject/output.js
  211. +10 −10 __tests__/__fixtures__/uncached/filterRight/output.js
  212. +12 −12 __tests__/__fixtures__/uncached/find/output.js
  213. +12 −11 __tests__/__fixtures__/uncached/findIndex/output.js
  214. +0 −7 __tests__/__fixtures__/uncached/findIndexRight/code.js
  215. +0 −15 __tests__/__fixtures__/uncached/findIndexRight/output.js
  216. +11 −15 __tests__/__fixtures__/uncached/findKey/output.js
  217. +7 −0 __tests__/__fixtures__/uncached/findLast/code.js
  218. +12 −0 __tests__/__fixtures__/uncached/findLast/output.js
  219. +7 −0 __tests__/__fixtures__/uncached/findLastIndex/code.js
  220. +12 −0 __tests__/__fixtures__/uncached/findLastIndex/output.js
  221. +9 −15 __tests__/__fixtures__/uncached/findObject/output.js
  222. +0 −7 __tests__/__fixtures__/uncached/findRight/code.js
  223. +0 −16 __tests__/__fixtures__/uncached/findRight/output.js
  224. +15 −10 __tests__/__fixtures__/uncached/flatMap/output.js
  225. +11 −10 __tests__/__fixtures__/uncached/flatMapRight/output.js
  226. +9 −7 __tests__/__fixtures__/uncached/forEach/output.js
  227. +6 −9 __tests__/__fixtures__/uncached/forEachObject/output.js
  228. +5 −7 __tests__/__fixtures__/uncached/forEachRight/output.js
  229. +7 −10 __tests__/__fixtures__/uncached/map/output.js
  230. +7 −12 __tests__/__fixtures__/uncached/mapObject/output.js
  231. +8 −10 __tests__/__fixtures__/uncached/mapRight/output.js
  232. +11 −8 __tests__/__fixtures__/uncached/reduce-no-initialValue/output.js
  233. +11 −8 __tests__/__fixtures__/uncached/reduce/output.js
  234. +14 −17 __tests__/__fixtures__/uncached/reduceObject-no-initialValue/output.js
  235. +15 −12 __tests__/__fixtures__/uncached/reduceObject/output.js
  236. +7 −9 __tests__/__fixtures__/uncached/reduceRight-no-initialValue/output.js
  237. +7 −8 __tests__/__fixtures__/uncached/reduceRight/output.js
  238. +12 −11 __tests__/__fixtures__/uncached/some/output.js
  239. +11 −14 __tests__/__fixtures__/uncached/someObject/output.js
  240. +8 −11 __tests__/__fixtures__/uncached/someRight/output.js
  241. +1 −1 __tests__/__runtime__/filter.js
  242. +44 −26 __tests__/__runtime__/find.js
  243. +50 −28 __tests__/__runtime__/findIndex-findKey.js
  244. +1 −1 __tests__/__runtime__/map.js
  245. +1 −1 __tests__/__runtime__/reduce-no-initialValue.js
  246. +44 −13 __tests__/__runtime__/reduce.js
  247. +3 −11 __tests__/runtime.test.js
  248. +0 −630 dist/handlers.js
  249. +0 −336 dist/helpers.js
  250. +0 −123 dist/index.d.ts
  251. +0 −203 dist/inline-loops.macro.js
  252. +139 −87 index.d.ts
  253. +6 −0 jest.config.js
  254. +27 −70 package.json
  255. +0 −647 src/handlers.js
  256. +787 −0 src/handlers.ts
  257. +0 −342 src/helpers.js
  258. +0 −203 src/inline-loops.macro.js
  259. +73 −0 src/inline-loops.macro.ts
  260. +377 −0 src/templates.ts
  261. +95 −0 src/traverse.ts
  262. +69 −0 src/types.ts
  263. +278 −0 src/utils.ts
  264. +20 −0 tsconfig.json
  265. +4,901 −3,989 yarn.lock
16 changes: 16 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"plugins": [
"babel-plugin-macros",
[
"@babel/plugin-transform-runtime",
{
"absoluteRuntime": false,
"corejs": false,
"helpers": true,
"regenerator": false,
"useESModules": false
}
]
],
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
}
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"node": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "commonjs"
},
"plugins": ["@typescript-eslint"],
"root": true
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
node_modules
dist
13 changes: 13 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
__tests__
src
.babelrc
.eslintrc
.gitignore
.npmignore
.npmrc
.prettierrc
.release-it.beta.json
.release-it.json
jest.config.js
tsconfig.json
yarn.lock
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all"
}
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## CHANGELOG

# 2.0.4

- [#37](https://github.com/planttheidea/inline-loops.macro/pull/37/files) - Smarter IIFE wrapper determination logic

# 2.0.3

- [#36](https://github.com/planttheidea/inline-loops.macro/pull/36) - Allow readonly collections, and fix `reduce*` method types for callback

# 2.0.2

- [#33](https://github.com/planttheidea/inline-loops.macro/pull/33) - Prevent `forEach*` methods from hoisting early returns
- [#34](https://github.com/planttheidea/inline-loops.macro/pull/34) - Simplify and fix `findIndex` / `findKey` / `findLastIndex` types
- [#35](https://github.com/planttheidea/inline-loops.macro/pull/35) - Reuse member expressions as the local collection

# 2.0.1

- [#32](https://github.com/planttheidea/inline-loops.macro/pull/32) - Fix `forEach*` methods not including the hoisted function call

# 2.0.0

## Breaking change

- `findRight` has been renamed to `findLast`
- `findIndexRight` has been renamed to `findLastIndex`

## Enhancements

- Support for conditional and lazy scenarios (ternaries, logical expressions, default parameter assignments, etc.)
- Better TS typing
- Better inline handling of complex logic

# 1.2.2

- Fix types related to `ArrayHandler` / `ObjectHandler` [#12](https://github.com/planttheidea/inline-loops.macro/pull/12)

# 1.2.1

- Add console warnings for deopt scenarios [#10](https://github.com/planttheidea/inline-loops.macro/pull/10)

# 1.2.0

- Expand aggressive inliner [#8](https://github.com/planttheidea/inline-loops.macro/pull/8)

# 1.1.0

- Add `flatMap` / `flatMapRight` [#6](https://github.com/planttheidea/inline-loops.macro/pull/6)

# 1.0.3

- Republish for bad version

# 1.0.2

- Allow inline of reduce [#1](https://github.com/planttheidea/inline-loops.macro/pull/1)

# 1.0.1

- fix description

# 1.0.0

- Initial release!
Loading