Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
handle/don't wrap Domain objects
Browse files Browse the repository at this point in the history
  • Loading branch information
letmaik committed Apr 5, 2016
1 parent 9a19748 commit 81e42a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import * as arrays from './arrays.js'
import {shallowcopy, mergeInto} from './util.js'
import {isISODateAxis, isLongitudeAxis, getLongitudeWrapper} from './referencing.js'

const COVERAGE = 'Coverage'
const COVERAGECOLLECTION = COVERAGE + 'Collection'

// Note: We currently can't handle Hydra data in non-default graphs due to lack of support in JSON-LD framing.

/**
Expand All @@ -23,10 +26,13 @@ export function wrap (data, options) {
if (typeof options.loader !== 'function') {
throw new Error('options.loader must be a function')
}
if (data.coverages) {
if (data.type === COVERAGECOLLECTION) {
return wrapCollection(data, options)
} else {
} else if (data.type === COVERAGE) {
return wrapCoverage(data, options)
} else {
// Domain or other unknown type
return data
}
}

Expand Down

0 comments on commit 81e42a0

Please sign in to comment.