hypel 0.2.3 → 0.2.5

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 (2) hide show
  1. package/hypel.js +6 -7
  2. package/package.json +1 -1
package/hypel.js CHANGED
@@ -86,19 +86,18 @@ const hypelsvg = h => {
86
86
  const encodeid = idstr => idstr.replace(nsSepPlainRe, ':')
87
87
  const decodeid = idstr => idstr.replace(nsSepEncodeRe, '/')
88
88
  const charCodeHyphen = 45 // the char "-"
89
- const tryprefixroot = (opts, classstr, prop) => (
90
- prop = opts[prop + 'root'],
91
- prop && prop !== classstr ? classstr + '.' + prop : classstr)
89
+ const tryprefix = (opts, classstr, prop, prefixname) => (
90
+ prop = opts[prop + prefixname],
91
+ prop && prop !== classstr ? prop + '.' + classstr : classstr)
92
92
  const getoptsclassidstr = (opts, classidstr, s) => (
93
93
  s = encodeid(classidstr.replace(nsKeyRe, (m, offset, r) => (
94
94
  m = m.slice(1),
95
95
  r = m in opts ? String(opts[m]) : m,
96
96
  r = classidstr.charCodeAt(offset + m.length + 1) === charCodeHyphen
97
- ? r : tryprefixroot(opts, r, m),
98
- r
97
+ ? r : tryprefix(opts, r, m, 'root'),
98
+ tryprefix(opts, r, m, 'prefix')
99
99
  ))),
100
- s
101
- )
100
+ s)
102
101
 
103
102
  const buildoptfns = helperfns => helperfns.TAG_NAMES.reduce((hhh, cur) => (
104
103
  hhh[cur] = (...args) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hypel",
3
3
  "type": "module",
4
- "version": "0.2.3",
4
+ "version": "0.2.5",
5
5
  "license": "MIT",
6
6
  "readmeFilename": "README.md",
7
7
  "description": "Terse syntax for hyperscript",