defaultRoute -> defaultResource

This commit is contained in:
Lachlan Kermode
2018-12-07 13:02:50 +00:00
parent 8a5bce0842
commit 41e2ba8299
8 changed files with 46 additions and 36 deletions

View File

@@ -48,7 +48,14 @@ class Fetcher {
*/
this.blueprints = this._indexDbForBlueprints()
.then(allUrls => {
const supportedUrls = allUrls.filter(url => url.startsWith(this.id))
const allParts = allUrls.reduce((acc, url) => {
if (url.startsWith(this.id)) {
const parts = url.split('/')
acc.push([ parts[1], parts[2] ])
return acc
}
}, [])
console.log(allParts)
return {}
})

View File

@@ -1,5 +1,6 @@
import path from 'path'
import fs from 'fs'
import R from 'ramda'
export const defaultBlueprint = {
name: null,
@@ -8,13 +9,17 @@ export const defaultBlueprint = {
resources: {}
}
export const defaultRoute = {
export const defaultResource = {
options: {
fragment: true
},
data: []
}
export function buildDesaturated (tab, resource) {
const bp = R.clone(defaultBlueprint)
}
// import all default exports from 'blueprinters' folder
const allBps = {}
const REL_PATH_TO_BPS = '../blueprinters'
@@ -28,5 +33,5 @@ fs.readdirSync(normalizedPath).forEach(file => {
// each file in blueprinters folder available for granular import from here.
module.exports = Object.assign({
defaultBlueprint,
defaultRoute
defaultResource
}, allBps)