Buckets:
| const { test } = require('node:test') | |
| const { NullObject } = require('../lib/null-object') | |
| test('NullObject', t => { | |
| t.plan(2) | |
| const nullObject = new NullObject() | |
| t.assert.ok(nullObject instanceof NullObject) | |
| t.assert.ok(typeof nullObject === 'object') | |
| }) | |
| test('has no methods from generic Object class', t => { | |
| function getAllPropertyNames (obj) { | |
| const props = [] | |
| do { | |
| Object.getOwnPropertyNames(obj).forEach(function (prop) { | |
| if (props.indexOf(prop) === -1) { | |
| props.push(prop) | |
| } | |
| }) | |
| } while (obj = Object.getPrototypeOf(obj)) // eslint-disable-line | |
| return props | |
| } | |
| const propertyNames = getAllPropertyNames({}) | |
| t.plan(propertyNames.length + 1) | |
| const nullObject = new NullObject() | |
| for (const propertyName of propertyNames) { | |
| t.assert.ok(!(propertyName in nullObject), propertyName) | |
| } | |
| t.assert.equal(getAllPropertyNames(nullObject).length, 0) | |
| }) | |
Xet Storage Details
- Size:
- 947 Bytes
- Xet hash:
- 40cb349f0109b68126cce51f43c9fd60730ecea528a0290498c0f3fa4c613ce9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.