mirror of
https://github.com/Mibew/simple-icons.git
synced 2025-05-01 16:46:43 +03:00
Avoid certain cases for data consistency (#7222)
This commit is contained in:
parent
c05890dc5f
commit
dd4ddc7fa9
@ -55,22 +55,6 @@
|
|||||||
"license": {
|
"license": {
|
||||||
"description": "The license for the icon",
|
"description": "The license for the icon",
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"required": ["type", "url"],
|
|
||||||
"properties": {
|
|
||||||
"type": {
|
|
||||||
"description": "The license name or 'custom'",
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["custom"]
|
|
||||||
},
|
|
||||||
"url": {
|
|
||||||
"description": "The URL to the license text by the brand",
|
|
||||||
"$ref": "#/definitions/url"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": false
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"required": ["type"],
|
"required": ["type"],
|
||||||
@ -166,6 +150,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": false
|
"additionalProperties": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"required": ["type", "url"],
|
||||||
|
"properties": {
|
||||||
|
"type": {
|
||||||
|
"description": "The license name or 'custom'",
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["custom"]
|
||||||
|
},
|
||||||
|
"url": {
|
||||||
|
"description": "The URL to the license text by the brand",
|
||||||
|
"$ref": "#/definitions/url"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"additionalProperties": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -235,7 +235,6 @@
|
|||||||
"pattern": "^https?://[^\\s]+$"
|
"pattern": "^https?://[^\\s]+$"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"icons": {
|
"icons": {
|
||||||
@ -243,5 +242,7 @@
|
|||||||
"type": "array",
|
"type": "array",
|
||||||
"items": { "$ref": "#/definitions/brand" }
|
"items": { "$ref": "#/definitions/brand" }
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": ["icons"]
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import simpleIcons from '../index.js';
|
import simpleIcons from '../index.js';
|
||||||
import { getIconSlug, getIconsData } from '../scripts/utils.js';
|
import { getIconSlug, getIconsData, titleToSlug } from '../scripts/utils.js';
|
||||||
import { test } from 'mocha';
|
import { test } from 'mocha';
|
||||||
import { strict as assert } from 'node:assert';
|
import { strict as assert } from 'node:assert';
|
||||||
|
|
||||||
@ -16,6 +16,15 @@ import { strict as assert } from 'node:assert';
|
|||||||
assert.equal(found.hex, icon.hex);
|
assert.equal(found.hex, icon.hex);
|
||||||
assert.equal(found.source, icon.source);
|
assert.equal(found.source, icon.source);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (icon.slug) {
|
||||||
|
// if an icon data has a slug, it must be different to the
|
||||||
|
// slug inferred from the title, which prevents adding
|
||||||
|
// unnecessary slugs to icons data
|
||||||
|
test(`'${icon.title}' slug must be necessary`, () => {
|
||||||
|
assert.notEqual(titleToSlug(icon.title), icon.slug);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test(`Iterating over simpleIcons only exposes icons`, () => {
|
test(`Iterating over simpleIcons only exposes icons`, () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user