1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Oinktube/node_modules/level-supports/test/shape.js
2022-07-15 11:08:01 -03:00

22 lines
529 B
JavaScript

'use strict'
var hasOwnProperty = Object.prototype.hasOwnProperty
module.exports = function shape (t, manifest) {
t.ok(isObject(manifest), 'manifest is object')
t.ok(isObject(manifest.additionalMethods), 'additionalMethods is object')
for (var k in manifest) {
if (!hasOwnProperty.call(manifest, k)) continue
if (manifest[k]) {
t.ok(manifest[k], 'truthy: ' + k)
} else {
t.is(manifest[k], false, 'false: ' + k)
}
}
}
function isObject (o) {
return typeof o === 'object' && o !== null
}