hypel 0.2.3 → 0.2.4

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