@larsgw/formica 0.5.2 → 0.6.1
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/CHANGELOG.md +18 -0
- package/lib/catalog/value.js +2 -2
- package/lib/resources/content/clavis.js +10 -0
- package/lib/resources/content/index.js +0 -0
- package/lib/resources/content/sdd.js +151 -0
- package/lib/resources/parse-text.js +2 -2
- package/lib/resources/sdd.js +78 -0
- package/package.json +1 -1
- package/src/catalog/value.ts +2 -2
- package/src/resources/parse-text.ts +2 -2
- package/test/resources.js +12 -0
package/package.json
CHANGED
package/src/catalog/value.ts
CHANGED
|
@@ -6,8 +6,8 @@ import ietfTagListFactory = require('ietf-language-tag-regex')
|
|
|
6
6
|
const ietfTagList = ietfTagListFactory()
|
|
7
7
|
|
|
8
8
|
export const FORMATS = {
|
|
9
|
-
ENTRY_TYPE: ['print', 'online', 'cd'],
|
|
10
|
-
KEY_TYPE: ['key', 'matrix', 'reference', 'gallery', 'checklist', 'supplement', 'collection'],
|
|
9
|
+
ENTRY_TYPE: ['print', 'online', 'cd', 'application'],
|
|
10
|
+
KEY_TYPE: ['key', 'matrix', 'reference', 'gallery', 'checklist', 'supplement', 'collection', 'algorithm'],
|
|
11
11
|
COMPLETE: ['TRUE', 'FALSE'],
|
|
12
12
|
|
|
13
13
|
ID: /^B\d+$/,
|
|
@@ -245,8 +245,8 @@ function parseName (name: string, rank: Rank, parent: WorkingTaxon): WorkingTaxo
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
// Hybrids
|
|
248
|
-
if (rank === 'species' &&
|
|
249
|
-
name = '\u00D7'
|
|
248
|
+
if (rank === 'species' && /(^| )x /.test(name)) {
|
|
249
|
+
name = name.replace(/(^| )x /, '\u00D7')
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
// Divide the name into the main scientific name (only the epithet for taxa
|
package/test/resources.js
CHANGED
|
@@ -124,4 +124,16 @@ Microdynerus Thomson, 1874
|
|
|
124
124
|
`, 'T1')
|
|
125
125
|
assert.strictEqual(resource.taxa['T1:1:3'].scientificName, 'Microdynerus microdynerus (Dalla Torre, 1889)')
|
|
126
126
|
})
|
|
127
|
+
|
|
128
|
+
await t.test('parses hybrids', (t) => {
|
|
129
|
+
const [resource] = resources.parseTextFile(`---
|
|
130
|
+
levels: [species]
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
Rumex conglomeratus x maritimus
|
|
134
|
+
Tilia x vulgaris
|
|
135
|
+
`, 'T1')
|
|
136
|
+
assert.strictEqual(resource.taxa['T1:1:1'].scientificName, 'Rumex conglomeratus×maritimus')
|
|
137
|
+
assert.strictEqual(resource.taxa['T1:1:2'].scientificName, 'Tilia ×vulgaris')
|
|
138
|
+
})
|
|
127
139
|
})
|