Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/babel-cli/node_modules/output-file-sync/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /*!
* output-file-sync | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/output-file-sync
*/
'use strict';
var dirname = require('path').dirname;
var writeFileSync = require('graceful-fs').writeFileSync;
var inspect = require('util').inspect;
var objectAssign = require('object-assign');
var mkdirpSync = require('mkdirp').sync;
module.exports = function outputFileSync(filePath, data, options) {
if (typeof filePath !== 'string') {
throw new TypeError(
inspect(filePath) +
' is not a string. Expected a file path to write a file.'
);
}
if (filePath === '') {
throw new Error('Expected a file path to write a file, but received an empty string instead.');
}
options = options || {};
var mkdirpOptions;
if (typeof options === 'string') {
mkdirpOptions = null;
} else if (options.dirMode) {
mkdirpOptions = objectAssign({}, options, {mode: options.dirMode});
} else {
mkdirpOptions = options;
}
var writeFileOptions;
if (options.fileMode) {
writeFileOptions = objectAssign({}, options, {mode: options.fileMode});
} else {
writeFileOptions = options;
}
var createdDirPath = mkdirpSync(dirname(filePath), mkdirpOptions);
writeFileSync(filePath, data, writeFileOptions);
return createdDirPath;
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0076 ]-- |