fortune-json-api
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -362,10 +362,9 @@ 'use strict'; | ||
if (_settings.reservedKeys.attributes in record) for (var field in record[_settings.reservedKeys.attributes]) { | ||
var value = record[_settings.reservedKeys.attributes][field]; | ||
var fieldDefinition = fields[field] || {}; | ||
var fieldType = fieldDefinition[keys.type]; | ||
var fieldIsArray = fieldDefinition[keys.isArray]; | ||
var value = record[_settings.reservedKeys.attributes][field]; | ||
if (inflectKeys) field = _inflection2['default'].camelize((0, _helpers.under)(field), true); | ||
clone[field] = fieldIsArray ? value.map(cast(fieldType, options)) : castValue(value, fieldType, options); | ||
clone[field] = Array.isArray(value) ? value.map(cast(fieldType, options)) : castValue(value, fieldType, options); | ||
} | ||
@@ -476,7 +475,6 @@ | ||
var fieldType = fieldDefinition[keys.type]; | ||
var fieldIsArray = fieldDefinition[keys.isArray]; | ||
if (inflectKeys) field = _inflection2['default'].camelize((0, _helpers.under)(field), true); | ||
replace[field] = fieldIsArray ? value.map(cast(fieldType, options)) : castValue(value, fieldType, options); | ||
replace[field] = Array.isArray(value) ? value.map(cast(fieldType, options)) : castValue(value, fieldType, options); | ||
} | ||
@@ -483,0 +481,0 @@ |
@@ -311,10 +311,9 @@ import uriTemplates from 'uri-templates' | ||
for (let field in record[reservedKeys.attributes]) { | ||
const value = record[reservedKeys.attributes][field] | ||
const fieldDefinition = fields[field] || {} | ||
const fieldType = fieldDefinition[keys.type] | ||
const fieldIsArray = fieldDefinition[keys.isArray] | ||
const value = record[reservedKeys.attributes][field] | ||
if (inflectKeys) field = inflection.camelize(under(field), true) | ||
clone[field] = fieldIsArray ? | ||
clone[field] = Array.isArray(value) ? | ||
value.map(cast(fieldType, options)) : | ||
@@ -398,7 +397,6 @@ castValue(value, fieldType, options) | ||
const fieldType = fieldDefinition[keys.type] | ||
const fieldIsArray = fieldDefinition[keys.isArray] | ||
if (inflectKeys) field = inflection.camelize(under(field), true) | ||
replace[field] = fieldIsArray ? | ||
replace[field] = Array.isArray(value) ? | ||
value.map(cast(fieldType, options)) : | ||
@@ -405,0 +403,0 @@ castValue(value, fieldType, options) |
{ | ||
"name": "fortune-json-api", | ||
"description": "JSON API serializer for Fortune.", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "author": { |
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
107082
2341