Comparing version 0.0.6 to 0.0.7
@@ -222,3 +222,4 @@ "use strict"; | ||
function hasState(typedClass, name) { | ||
return typedClass && typedClass['-sb-states'] && typedClass['-sb-states'].indexOf(name) !== -1; | ||
var states = typedClass && typedClass['-sb-states']; | ||
return states ? states.indexOf(name) !== -1 : false; | ||
} | ||
@@ -225,0 +226,0 @@ function isImport(ast) { |
@@ -5,5 +5,5 @@ import { Import } from './import'; | ||
export interface TypedClass { | ||
"-sb-root": boolean; | ||
"-sb-states": string[]; | ||
"-sb-type": string; | ||
"-sb-root"?: boolean; | ||
"-sb-states"?: string[]; | ||
"-sb-type"?: string; | ||
} | ||
@@ -10,0 +10,0 @@ export interface Mixin { |
@@ -21,3 +21,5 @@ "use strict"; | ||
this.vars = {}; | ||
this.typedClasses = {}; | ||
this.typedClasses = { | ||
root: { "-sb-root": true } | ||
}; | ||
this.mixinSelectors = {}; | ||
@@ -143,3 +145,3 @@ this.imports = []; | ||
var typedClass = this.typedClasses[name]; | ||
var _import = typedClass ? this.getImportForSymbol(typedClass['-sb-type']) : null; | ||
var _import = typedClass ? this.getImportForSymbol(typedClass['-sb-type'] || "") : null; | ||
return _import ? resolver.resolveModule(_import.from) : this; | ||
@@ -146,0 +148,0 @@ }; |
@@ -53,3 +53,5 @@ "use strict"; | ||
chai_1.expect(sheet.classes).to.eql({}); | ||
chai_1.expect(sheet.typedClasses).to.eql({}); | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true } | ||
}); | ||
}); | ||
@@ -59,2 +61,3 @@ it('with typed class -sb-root true', function () { | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -68,2 +71,3 @@ "-sb-root": true | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -77,2 +81,3 @@ "-sb-root": true | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -98,2 +103,3 @@ "-sb-root": false | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -107,2 +113,3 @@ "-sb-states": ["stateA", "stateB"] | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -116,2 +123,3 @@ "-sb-states": [] | ||
chai_1.expect(sheet.typedClasses).to.eql({ | ||
root: { "-sb-root": true }, | ||
container: { | ||
@@ -118,0 +126,0 @@ "-sb-type": "Thing" |
{ | ||
"name": "stylable", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
@@ -205,3 +205,4 @@ import { PartialObject, Pojo } from './types'; | ||
function hasState(typedClass: TypedClass, name: string) { | ||
return typedClass && typedClass['-sb-states'] && typedClass['-sb-states'].indexOf(name) !== -1; | ||
const states = typedClass && typedClass['-sb-states']; | ||
return states ? states.indexOf(name) !== -1 : false; | ||
} | ||
@@ -208,0 +209,0 @@ |
@@ -17,5 +17,5 @@ import { Import } from './import'; | ||
export interface TypedClass { | ||
"-sb-root": boolean; | ||
"-sb-states": string[]; | ||
"-sb-type": string; | ||
"-sb-root"?: boolean; | ||
"-sb-states"?: string[]; | ||
"-sb-type"?: string; | ||
} | ||
@@ -43,3 +43,5 @@ | ||
this.vars = {}; | ||
this.typedClasses = {}; | ||
this.typedClasses = { | ||
root: { "-sb-root": true } | ||
}; | ||
this.mixinSelectors = {}; | ||
@@ -155,3 +157,3 @@ this.imports = []; | ||
const typedClass = this.typedClasses[name]; | ||
const _import = typedClass ? this.getImportForSymbol(typedClass['-sb-type']) : null; | ||
const _import = typedClass ? this.getImportForSymbol(typedClass['-sb-type'] || "") : null; | ||
return _import ? resolver.resolveModule(_import.from) : this; | ||
@@ -158,0 +160,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
262888
4600