@saulx/utils
Advanced tools
Comparing version 1.1.2 to 1.2.0
@@ -6,4 +6,5 @@ import deepCopy from './deepCopy'; | ||
import toEnvVar from './envVar'; | ||
import readStream from './readStream'; | ||
export * from './hash'; | ||
export * from './deepMerge'; | ||
export { deepCopy, isObject, wait, deepEqual, toEnvVar }; | ||
export { deepCopy, readStream, isObject, wait, deepEqual, toEnvVar }; |
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.toEnvVar = exports.deepEqual = exports.wait = exports.isObject = exports.deepCopy = void 0; | ||
exports.toEnvVar = exports.deepEqual = exports.wait = exports.isObject = exports.readStream = exports.deepCopy = void 0; | ||
const deepCopy_1 = __importDefault(require("./deepCopy")); | ||
@@ -28,4 +28,6 @@ exports.deepCopy = deepCopy_1.default; | ||
exports.toEnvVar = envVar_1.default; | ||
const readStream_1 = __importDefault(require("./readStream")); | ||
exports.readStream = readStream_1.default; | ||
__exportStar(require("./hash"), exports); | ||
__exportStar(require("./deepMerge"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@saulx/utils", | ||
"main": "./dist/index.js", | ||
"version": "1.1.2", | ||
"version": "1.2.0", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "build": "tsc", |
@@ -11,2 +11,4 @@ import deepCopy from './deepCopy' | ||
import readStream from './readStream' | ||
export * from './hash' | ||
@@ -16,2 +18,2 @@ | ||
export { deepCopy, isObject, wait, deepEqual, toEnvVar } | ||
export { deepCopy, readStream, isObject, wait, deepEqual, toEnvVar } |
@@ -12,3 +12,4 @@ import test from 'ava' | ||
deepEqual, | ||
toEnvVar | ||
toEnvVar, | ||
readStream | ||
} from '../src' | ||
@@ -555,1 +556,67 @@ | ||
}) | ||
test('deepEqual 3', async t => { | ||
const bla = { | ||
id: 213906207, | ||
privateIp: '10.114.0.20', | ||
publicIp: '167.99.139.137', | ||
name: 'fra1-my-special-app-for-testing-super-secret-5c44610-0', | ||
tags: { | ||
app: 'my_special_app_for_testing_super_secret', | ||
env: 'production', | ||
net: 'private', | ||
project: 'supersecretspecialtestproject', | ||
org: 'saulx' | ||
}, | ||
specs: { | ||
memory: '1gb', | ||
image: 'ubuntu-nodejs', | ||
region: 'fra1', | ||
cpus: 4, | ||
cloudProvider: 'do', | ||
sizeName: 's-4vcpu-8gb' | ||
}, | ||
price: 5 | ||
} | ||
const blarf = { | ||
id: 213906207, | ||
privateIp: '10.114.0.20', | ||
publicIp: '167.99.139.137', | ||
name: 'fra1-my-special-app-for-testing-super-secret-5c44610-0', | ||
tags: { | ||
app: 'my_special_app_for_testing_super_secret', | ||
env: 'production', | ||
net: 'private', | ||
project: 'supersecretspecialtestproject', | ||
org: 'saulx' | ||
}, | ||
specs: { | ||
memory: '8gb', | ||
cpus: 4, | ||
image: 'ubuntu-nodejs', | ||
region: 'fra1', | ||
cloudProvider: 'do', | ||
sizeName: 's-4vcpu-8gb' | ||
}, | ||
price: 40 | ||
} | ||
t.false(deepEqual(bla, blarf)) | ||
}) | ||
test.cb('readStream', t => { | ||
const { PassThrough, Writable } = require('stream') | ||
const pass = new PassThrough() | ||
const writable = new Writable() | ||
readStream(pass).then(v => { | ||
console.log('done!', v.toString()) | ||
t.end() | ||
}) | ||
pass.pipe(writable) | ||
pass.unpipe(writable) | ||
// readableFlowing is now false. | ||
pass.resume() | ||
setTimeout(() => { | ||
pass.end('x') | ||
}, 100) | ||
}) |
Sorry, the diff of this file is not supported yet
64300
47
1595