@teambit/semantics.entities.semantic-schema
Advanced tools
Comparing version 0.0.56 to 0.0.57
@@ -10,3 +10,4 @@ import { SchemaLocation, SchemaNode } from '../schema-node'; | ||
readonly defaultValue?: string; | ||
constructor(location: SchemaLocation, type: string, name?: string, defaultValue?: string); | ||
readonly isSpread?: boolean; | ||
constructor(location: SchemaLocation, type: string, name?: string, defaultValue?: string, isSpread?: boolean); | ||
toString(): string; | ||
@@ -16,4 +17,5 @@ toObject(): { | ||
defaultValue: string; | ||
isSpread: boolean; | ||
}; | ||
static fromObject(obj: Record<string, any>): InferenceTypeSchema; | ||
} |
@@ -9,3 +9,3 @@ "use strict"; | ||
class InferenceTypeSchema extends schema_node_1.SchemaNode { | ||
constructor(location, type, name, defaultValue) { | ||
constructor(location, type, name, defaultValue, isSpread) { | ||
super(); | ||
@@ -16,2 +16,3 @@ this.location = location; | ||
this.defaultValue = defaultValue; | ||
this.isSpread = isSpread; | ||
} | ||
@@ -25,3 +26,3 @@ toString() { | ||
toObject() { | ||
return Object.assign(Object.assign({}, super.toObject()), { type: this.type, defaultValue: this.defaultValue }); | ||
return Object.assign(Object.assign({}, super.toObject()), { type: this.type, defaultValue: this.defaultValue, isSpread: this.isSpread }); | ||
} | ||
@@ -33,3 +34,4 @@ static fromObject(obj) { | ||
const defaultValue = obj.defaultValue; | ||
return new InferenceTypeSchema(location, type, name, defaultValue); | ||
const isSpread = obj.isSpread; | ||
return new InferenceTypeSchema(location, type, name, defaultValue, isSpread); | ||
} | ||
@@ -36,0 +38,0 @@ } |
{ | ||
"name": "@teambit/semantics.entities.semantic-schema", | ||
"version": "0.0.56", | ||
"version": "0.0.57", | ||
"homepage": "https://bit.cloud/teambit/semantics/entities/semantic-schema", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
"name": "entities/semantic-schema", | ||
"version": "0.0.56" | ||
"version": "0.0.57" | ||
}, | ||
@@ -12,0 +12,0 @@ "dependencies": { |
@@ -11,3 +11,4 @@ import { SchemaLocation, SchemaNode } from '../schema-node'; | ||
readonly name?: string, | ||
readonly defaultValue?: string | ||
readonly defaultValue?: string, | ||
readonly isSpread?: boolean | ||
) { | ||
@@ -29,2 +30,3 @@ super(); | ||
defaultValue: this.defaultValue, | ||
isSpread: this.isSpread, | ||
}; | ||
@@ -38,4 +40,5 @@ } | ||
const defaultValue = obj.defaultValue; | ||
return new InferenceTypeSchema(location, type, name, defaultValue); | ||
const isSpread = obj.isSpread; | ||
return new InferenceTypeSchema(location, type, name, defaultValue, isSpread); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
244801
4986