@symbo.ls/scratch 0.7.7 → 0.7.8
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.
- package/package.json +1 -1
- package/src/utils/sequence.js +4 -2
package/package.json
CHANGED
package/src/utils/sequence.js
CHANGED
|
@@ -150,7 +150,7 @@ export const getSequenceValue = (value = 'A', sequenceProps) => {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// if subsequence is not set but value is applied
|
|
153
|
-
if (absValue.length === 2) {
|
|
153
|
+
if (!sequence[absValue] && absValue.length === 2) {
|
|
154
154
|
if (CONFIG.verbose) console.warn(absValue, '- value is not found because `subSequence` is set to false')
|
|
155
155
|
absValue = absValue.slice(0, 1)
|
|
156
156
|
}
|
|
@@ -179,10 +179,12 @@ export const getSequenceValuePropertyPair = (value, propertyName, sequenceProps)
|
|
|
179
179
|
return { [propertyName]: getSequenceValue(value, sequenceProps) }
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
export const findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index]
|
|
183
|
+
|
|
182
184
|
export const findHeadings = propertyNames => {
|
|
183
185
|
const { h1Matches, sequence } = propertyNames
|
|
184
186
|
return new Array(6).fill(null).map((_, i) => {
|
|
185
|
-
const findLetter =
|
|
187
|
+
const findLetter = findHeadingLetter(h1Matches, i)
|
|
186
188
|
return sequence[findLetter]
|
|
187
189
|
})
|
|
188
190
|
}
|