tunnckoCore / blankr

:heart: tasks, todos, ideas, streaks, WIP, etc
https://i.am.charlike.online
4 stars 1 forks source link

issue for `braces`: need options for escape `{` #19

Closed tunnckoCore closed 9 years ago

tunnckoCore commented 9 years ago

We need something like this

writeFixture('fixture.js', 'benchmark/fixtures/a/{b,{c,d},e/d}/*.\{js,md,txt\}');
//=> [
  "benchmark/fixtures/a/b/*.{js,md,txt}",
  "benchmark/fixtures/a/c/*.{js,md,txt}",
  "benchmark/fixtures/a/e/d/*.{js,md,txt}",
  "benchmark/fixtures/a/d/*.{js,md,txt}"
]

then we can pass the string to globbing lib, eg micromatch.

With single slash it removes it, with two \\, not works. The result is

//=> [
  "benchmark/fixtures/a/b/*.\\{js,md,txt\\}",
  "benchmark/fixtures/a/c/*.\\{js,md,txt\\}",
  "benchmark/fixtures/a/e/d/*.\\{js,md,txt\\}",
  "benchmark/fixtures/a/d/*.\\{js,md,txt\\}"
]
tunnckoCore commented 9 years ago

done.