Sha256: 9341a6f306395d5a459c9b6890f1f9d91a2501e054f3913c2997db2854e755be
Contents?: true
Size: 495 Bytes
Versions: 33
Compression:
Stored size: 495 Bytes
Contents
const getOptions = require('./common/get-options.js') const owner = require('./common/owner.js') const withOwner = async (path, fn, opts) => { const options = getOptions(opts, { copy: ['owner'], }) const { uid, gid } = await owner.validate(path, options.owner) const result = await fn({ uid, gid }) await Promise.all([ owner.update(path, uid, gid), typeof result === 'string' ? owner.update(result, uid, gid) : null, ]) return result } module.exports = withOwner
Version data entries
33 entries across 33 versions & 1 rubygems