Published
Edited
Oct 30, 2020
1 fork
Importers
1 star
Insert cell
Insert cell
mem = {
const p_defer_1 = await modules_without_dependencies['p-defer'];
const mapAgeCleaner = await modules_without_dependencies['map-age-cleaner'];
const mimicFn = await modules_without_dependencies['mimic-fn'];
return await modules_without_dependencies['mem'];
}
Insert cell
Insert cell
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell
modules_without_dependencies = ({
'mimic-fn': await fetch("https://unpkg.com/mimic-fn@3.0.0/index.js")
.then(d => d.text())
.then(t => t.replace('const mimicFn', 'export const mimicFn'))
.then(t => t.substring(0, t.indexOf(`module.exports`)))
.then(imp)
.then(m => m.mimicFn),
'map-age-cleaner': await fetch(
"https://unpkg.com/map-age-cleaner@0.1.3/dist/index.js"
)
.then(d => d.text())
.then(t =>
t.replace('function mapAgeCleaner', 'export function mapAgeCleaner')
)
.then(t =>
t.replace(
`Object.defineProperty(exports, "__esModule", { value: true });`,
''
)
)
.then(t =>
t.replace(`const p_defer_1 = __importDefault(require("p-defer"));`, '')
)
.then(t => t.substring(0, t.indexOf(`exports.default`)))
.then(imp) // be careful: if I understand correctly, p_defer_1 must have been defined at this point
.then(m => m.mapAgeCleaner),
'p-defer': await fetch("https://unpkg.com/p-defer@3.0.0/index.js")
.then(d => d.text())
.then(t => t.replace('const pDefer', 'export const pDefer'))
.then(t => t.substring(0, t.indexOf(`module.exports`)))
.then(imp)
.then(m => m.pDefer),
mem: await fetch("https://unpkg.com/mem@6.1.0/index.js")
.then(d => d.text())
.then(t => t.replace('const mem', 'export const mem'))
.then(t => t.replace(`const mimicFn = require('mimic-fn');`, ''))
.then(t =>
t.replace(`const mapAgeCleaner = require('map-age-cleaner');`, '')
)
.then(t => t.substring(0, t.indexOf(`module.exports`)))
.then(imp) // be careful: if I understand correctly, mimicFn and mapAgeCleaner must have been defined at this point
.then(m => m.mem)
})
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more