Skip to content

Commit

Permalink
Merge pull request #13 from design-ops/case-insensitive
Browse files Browse the repository at this point in the history
Case insensitive
  • Loading branch information
cdemetriadis authored Feb 21, 2022
2 parents 5199484 + 7ae7a07 commit 81d5f79
Show file tree
Hide file tree
Showing 13 changed files with 6 additions and 6 deletions.
Binary file modified src/__tests__/default-layer-styles.sketch
Binary file not shown.
Binary file modified src/__tests__/default-symbols.sketch
Binary file not shown.
Binary file modified src/__tests__/default-text-styles.sketch
Binary file not shown.
Binary file modified src/__tests__/duplicate-layer-styles.sketch
Binary file not shown.
Binary file modified src/__tests__/duplicate-symbols.sketch
Binary file not shown.
Binary file modified src/__tests__/duplicate-text-styles.sketch
Binary file not shown.
Binary file modified src/__tests__/symbol-names.sketch
Binary file not shown.
2 changes: 1 addition & 1 deletion src/rules/default-layer-styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const defaultLayerStyles: RuleDefinition = {
defaultTokens = (tokens.filter((element) => element.default == true));

for (const token of tokens) {
var existingElement = defaultTokens.find((element) => element.token == token.token);
var existingElement = defaultTokens.find((element) => element.token.toLowerCase() == token.token.toLowerCase());
if (existingElement == null) {
context.utils.report('\'' + token.token + '\' is missing a default layer style', token.object);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/default-symbols/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const defaultSymbols: RuleDefinition = {
defaultTokens = (tokens.filter((element) => element.default == true));

for (const token of tokens) {
var existingElement = defaultTokens.find((element) => element.token == token.token);
var existingElement = defaultTokens.find((element) => element.token.toLowerCase() == token.token.toLowerCase());
if (existingElement == null) {
context.utils.report('\'' + token.token + '\' is missing a default symbol', token.object);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/default-text-styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const defaultTextStyles: RuleDefinition = {
defaultTokens = (tokens.filter((element) => element.default == true));

for (const token of tokens) {
var existingElement = defaultTokens.find((element) => element.token == token.token);
var existingElement = defaultTokens.find((element) => element.token.toLowerCase() == token.token.toLowerCase());
if (existingElement == null) {
context.utils.report('\'' + token.token + '\' is missing a default text style', token.object);
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/duplicate-layer-styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const duplicateLayerStyles: RuleDefinition = {

for (const style of context.utils.objects.sharedStyle) {
if (style.value.textStyle == undefined) {
var existingElement = duplicates.find((element) => element.name == style.name)
var existingElement = duplicates.find((element) => element.name.toLowerCase() == style.name.toLowerCase())
if (existingElement != null)
existingElement.number++;
else {
Expand Down
2 changes: 1 addition & 1 deletion src/rules/duplicate-symbols/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const duplicateSymbols: RuleDefinition = {
var totalDuplicates: Array<Duplicate> = [];

for (const symbol of context.utils.objects.symbolMaster) {
var existingElement = duplicates.find((element) => element.name == symbol.name);
var existingElement = duplicates.find((element) => element.name.toLowerCase() == symbol.name.toLowerCase());
if (existingElement != null)
existingElement.number++;
else
Expand Down
2 changes: 1 addition & 1 deletion src/rules/duplicate-text-styles/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const duplicateTextStyles: RuleDefinition = {

for (const style of context.utils.objects.sharedStyle) {
if (style.value.textStyle != undefined) {
var existingElement = duplicates.find((element) => element.name == style.name)
var existingElement = duplicates.find((element) => element.name.toLowerCase() == style.name.toLowerCase())
if (existingElement != null)
existingElement.number++;
else {
Expand Down

0 comments on commit 81d5f79

Please sign in to comment.