Skip to content

Commit

Permalink
format code / update dependencies / tweak test data
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmartineau committed Feb 27, 2019
1 parent 4ef20e1 commit fd2f44e
Show file tree
Hide file tree
Showing 6 changed files with 734 additions and 929 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"workbench.colorCustomizations": {
"statusBar.background": "#91748d"
}
}
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,26 @@
"@ngard/tiny-get": "^1.0.1"
},
"devDependencies": {
"@types/jest": "^23.3.13",
"@types/prettier": "^1.15.2",
"@types/jest": "^24.0.9",
"@types/prettier": "^1.16.1",
"@types/rollup": "^0.54.0",
"@types/typescript": "^2.0.0",
"jest": "^23.6.0",
"prettier": "^1.15.3",
"rollup": "^1.1.0",
"jest": "^24.1.0",
"prettier": "^1.16.4",
"rollup": "^1.3.1",
"rollup-plugin-auto-external": "^2.0.0",
"rollup-plugin-buble": "^0.19.6",
"rollup-plugin-bundle-size": "^1.0.3",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-terser": "^4.0.2",
"rollup-plugin-typescript2": "^0.19.2",
"rollup-plugin-uglify": "^6.0.1",
"rollup-plugin-commonjs": "^9.2.1",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-terser": "^4.0.4",
"rollup-plugin-typescript2": "^0.19.3",
"rollup-plugin-uglify": "^6.0.2",
"size-limit": "^0.21.1",
"ts-jest": "^23.10.5",
"tslint": "^5.12.1",
"tslint-config-prettier": "^1.17.0",
"ts-jest": "^24.0.0",
"tslint": "^5.13.0",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.0.1",
"typescript": "3.2.4"
"typescript": "3.3.3333"
}
}
4 changes: 2 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ describe('design-system-utils methods', () => {
test('color', () => {
expect(ds1.color('primary')).toBe('#181830')
expect(ds1.color('secondary', 'light')).toBe('#fea04c')
expect(ds1.color('v2.secondary.light')).toBe('#fea04c')
expect(ds1.color('v2.secondary.deep.nested.light')).toBe('#fea04c')
expect(ds1.color('nested.secondary.light')).toBe('#fea04c')
expect(ds1.color('nested.secondary.deep.nested.light')).toBe('#fea04c')

// Errors
expect(() => ds1.color('text', 'dark')).toThrow(
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,11 @@ export default class DesignSystem<T extends System, K extends SystemOptions> {
throw new Error(MissingParent(location))
}

const isMultiPathHue = hue.split('.').length > 1;
const isMultiPathHue = hue.split('.').length > 1

const value: string | undefined = isMultiPathHue ?
this.get(hue, this.ds.colors.colorPalette) :
this.ds.colors.colorPalette[hue][variant]
const value: string | undefined = isMultiPathHue
? this.get(hue, this.ds.colors.colorPalette)
: this.ds.colors.colorPalette[hue][variant]

if (value === undefined) {
throw new Error(MissingKey(location, hue, variant))
Expand Down
10 changes: 5 additions & 5 deletions src/testData/ds1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ const DesignSystem1: MySystem = {
dark: '#d26401',
},

v2: {
nested: {
secondary: {
light: '#fea04c',
deep: {
nested: {
light: '#fea04c',
}
}
}
}
},
},
},
},
},

brand: {
Expand Down
Loading

0 comments on commit fd2f44e

Please sign in to comment.