Skip to content

Commit

Permalink
0.9.2 fix bug using $compose with style object
Browse files Browse the repository at this point in the history
- ran npm upgrade
  • Loading branch information
fuzetsu committed Jul 15, 2020
1 parent 8504227 commit cf5e468
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 57 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.9.2

_2020-07-15_

Fixed bug where `$compose` would fail to work with zaftig style objects. They were getting concatenated and rendering with a `.`

## 0.9.1

_2020-07-01_
Expand Down
108 changes: 54 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zaftig",
"version": "0.9.1",
"version": "0.9.2",
"description": "css for your js",
"source": "src/index.js",
"main": "dist/zaftig.es5.min.js",
Expand All @@ -26,7 +26,7 @@
"homepage": "https://github.com/fuzetsu/zaftig#readme",
"devDependencies": {
"buble": "^0.20",
"jsdom": "^16",
"jsdom": "^16.3.0",
"ospec": "^4.1.1",
"terser": "^4.8.0"
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { hasOwnProperty, getPrototypeOf } = Object
const err = (...args) => console.error('zaftig:', ...args)

const zip = (parts, args) =>
parts.reduce((acc, c, i) => acc + c + (args[i] == null ? '' : args[i]), '')
parts.reduce((acc, c, i) => acc + c + (args[i] == null ? '' : String(args[i])), '')

const memo = (fn, cache = {}) => x => (x in cache ? cache[x] : (cache[x] = fn(x)))

Expand Down
5 changes: 5 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,5 +229,10 @@ h6 { basic-fn hello world foo }
o(z`$name bob;$compose hello world`.class).equals('bob-test-1 hello world')
o(z.getSheet()).equals(undefined)
})
o('interpolating zaftig style into template yields bare className', () => {
const z = zaf.new({ id: 'test' })
const style = z`c green`
o(z`$compose ${style}`.class).equals('test-2 test-1')
})
// TODO: add tests for selector prefixing and better error handling (JSDOM doesn't seem to give syntax errors like browsers do)
})

0 comments on commit cf5e468

Please sign in to comment.