fulcrum-core
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -15,10 +15,12 @@ 'use strict'; | ||
constructor(attributes) { | ||
this.streetNumber = attributes.sub_thoroughfare; | ||
this.streetName = attributes.thoroughfare; | ||
this.suite = attributes.suite; | ||
this.city = attributes.locality; | ||
this.county = attributes.sub_admin_area; | ||
this.state = attributes.admin_area; | ||
this.postalCode = attributes.postal_code; | ||
this.country = attributes.country; | ||
if (attributes) { | ||
this.streetNumber = attributes.sub_thoroughfare; | ||
this.streetName = attributes.thoroughfare; | ||
this.suite = attributes.suite; | ||
this.city = attributes.locality; | ||
this.county = attributes.sub_admin_area; | ||
this.state = attributes.admin_area; | ||
this.postalCode = attributes.postal_code; | ||
this.country = attributes.country; | ||
} | ||
} | ||
@@ -25,0 +27,0 @@ |
@@ -32,11 +32,13 @@ 'use strict'; | ||
for (let choice of attributes.choice_values) { | ||
if (_textUtils2.default.isPresent(choice)) { | ||
this._choiceValues.push(choice); | ||
if (attributes) { | ||
for (let choice of attributes.choice_values) { | ||
if (_textUtils2.default.isPresent(choice)) { | ||
this._choiceValues.push(choice); | ||
} | ||
} | ||
} | ||
for (let choice of attributes.other_values) { | ||
if (_textUtils2.default.isPresent(choice)) { | ||
this._otherValues.push(choice); | ||
for (let choice of attributes.other_values) { | ||
if (_textUtils2.default.isPresent(choice)) { | ||
this._otherValues.push(choice); | ||
} | ||
} | ||
@@ -43,0 +45,0 @@ } |
@@ -17,4 +17,6 @@ 'use strict'; | ||
this._identifier = attributes.signature_id; | ||
this._timestamp = attributes.timestamp; | ||
if (attributes) { | ||
this._identifier = attributes.signature_id; | ||
this._timestamp = attributes.timestamp; | ||
} | ||
} | ||
@@ -21,0 +23,0 @@ |
{ | ||
"name": "fulcrum-core", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Fulcrum Core", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/fulcrumapp/fulcrum-core", |
@@ -5,10 +5,12 @@ import TextUtils from '../utils/text-utils'; | ||
constructor(attributes) { | ||
this.streetNumber = attributes.sub_thoroughfare; | ||
this.streetName = attributes.thoroughfare; | ||
this.suite = attributes.suite; | ||
this.city = attributes.locality; | ||
this.county = attributes.sub_admin_area; | ||
this.state = attributes.admin_area; | ||
this.postalCode = attributes.postal_code; | ||
this.country = attributes.country; | ||
if (attributes) { | ||
this.streetNumber = attributes.sub_thoroughfare; | ||
this.streetName = attributes.thoroughfare; | ||
this.suite = attributes.suite; | ||
this.city = attributes.locality; | ||
this.county = attributes.sub_admin_area; | ||
this.state = attributes.admin_area; | ||
this.postalCode = attributes.postal_code; | ||
this.country = attributes.country; | ||
} | ||
} | ||
@@ -15,0 +17,0 @@ |
@@ -16,11 +16,13 @@ import FormValue from './form-value'; | ||
for (let choice of attributes.choice_values) { | ||
if (TextUtils.isPresent(choice)) { | ||
this._choiceValues.push(choice); | ||
if (attributes) { | ||
for (let choice of attributes.choice_values) { | ||
if (TextUtils.isPresent(choice)) { | ||
this._choiceValues.push(choice); | ||
} | ||
} | ||
} | ||
for (let choice of attributes.other_values) { | ||
if (TextUtils.isPresent(choice)) { | ||
this._otherValues.push(choice); | ||
for (let choice of attributes.other_values) { | ||
if (TextUtils.isPresent(choice)) { | ||
this._otherValues.push(choice); | ||
} | ||
} | ||
@@ -27,0 +29,0 @@ } |
@@ -7,4 +7,6 @@ import FormValue from './form-value'; | ||
this._identifier = attributes.signature_id; | ||
this._timestamp = attributes.timestamp; | ||
if (attributes) { | ||
this._identifier = attributes.signature_id; | ||
this._timestamp = attributes.timestamp; | ||
} | ||
} | ||
@@ -11,0 +13,0 @@ |
@@ -22,2 +22,9 @@ import setup from '../helper'; | ||
it('creates an empty value', () => { | ||
const value = new AddressValue(record.form.find('address')); | ||
value.should.be.instanceof(AddressValue); | ||
value.isEmpty.should.eql(true); | ||
}); | ||
it('finds a date value in the record by key', () => { | ||
@@ -24,0 +31,0 @@ const value = record.formValues.find('address'); |
@@ -69,2 +69,9 @@ import setup from '../helper'; | ||
it('supports creating a value from null', () => { | ||
const value = new ClassificationValue(record.form.find('os')); | ||
value.should.be.instanceof(ClassificationValue); | ||
value.isEmpty.should.eql(true); | ||
}); | ||
it('finds a single choice value in the record', () => { | ||
@@ -71,0 +78,0 @@ const value = record.formValues.find('os'); |
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
398551
7160