rittenhop-dev/versions/5.94.2/node_modules/@stdlib/fs-exists/dist/index.js.map
2024-09-23 19:40:12 -04:00

8 lines
5.8 KiB
Plaintext

{
"version": 3,
"sources": ["../lib/async.js", "../lib/sync.js", "../lib/index.js"],
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n// MODULES //\n\nvar fs = require( 'fs' );\n\n\n// FUNCTIONS //\n\nvar fcn;\nif ( typeof fs.access === 'function' ) {\n\tfcn = fs.access;\n} else {\n\tfcn = fs.stat;\n}\n\n\n// MAIN //\n\n/**\n* Tests whether a path exists on the filesystem.\n*\n* @param {(string|Buffer)} path - path to test\n* @param {Function} clbk - callback to invoke after testing path existence\n*\n* @example\n* exists( __dirname, done );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* console.error( error );\n* }\n* if ( bool ) {\n* console.log( '...path exists.' );\n* } else {\n* console.log( '...path does not exist.' );\n* }\n* }\n*/\nfunction exists( path, clbk ) {\n\tfcn( path, done );\n\n\t/**\n\t* Callback invoked upon performing a filesystem call.\n\t*\n\t* @private\n\t* @param {(Error|null)} error - error object\n\t* @returns {void}\n\t*/\n\tfunction done( error ) {\n\t\tif ( clbk.length === 2 ) {\n\t\t\tif ( error ) {\n\t\t\t\treturn clbk( error, false );\n\t\t\t}\n\t\t\treturn clbk( null, true );\n\t\t}\n\t\tif ( error ) {\n\t\t\treturn clbk( false );\n\t\t}\n\t\treturn clbk( true );\n\t}\n}\n\n\n// EXPORTS //\n\nmodule.exports = exists;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n/* eslint-disable no-sync */\n\n'use strict';\n\n// MODULES //\n\nvar fs = require( 'fs' );\n\n\n// FUNCTIONS //\n\nvar fcn;\nif ( typeof fs.accessSync === 'function' ) {\n\tfcn = fs.accessSync;\n} else {\n\tfcn = fs.statSync;\n}\n\n\n// MAIN //\n\n/**\n* Synchronously tests whether a path exists on the filesystem.\n*\n* @param {(string|Buffer)} path - path to test\n* @returns {boolean} boolean indicating whether the path exists\n*\n* @example\n* var bool = existsSync( __dirname );\n* // returns <boolean>\n*/\nfunction existsSync( path ) {\n\ttry {\n\t\tfcn( path );\n\t} catch ( err ) { // eslint-disable-line no-unused-vars\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n\n// EXPORTS //\n\nmodule.exports = existsSync;\n", "/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/**\n* Test whether a path exists on the filesystem. For more information, see the [archive][1].\n*\n* [1]: https://github.com/nodejs/node-v0.x-archive/blob/d8baf8a2a4481940bfed0196308ae6189ca18eee/lib/fs.js#L222\n*\n* @module @stdlib/fs-exists\n*\n* @example\n* var exists = require( '@stdlib/fs-exists' );\n*\n* exists( __dirname, done );\n* exists( 'beepboop', done );\n*\n* function done( error, bool ) {\n* if ( error ) {\n* console.error( error.message );\n* } else {\n* console.log( bool );\n* }\n* }\n*\n* @example\n* var existsSync = require( '@stdlib/fs-exists' ).sync;\n*\n* console.log( existsSync( __dirname ) );\n* // => true\n*\n* console.log( existsSync( 'beepboop' ) );\n* // => false\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-nonenumerable-read-only-property' );\nvar exists = require( './async.js' );\nvar sync = require( './sync.js' );\n\n\n// MAIN //\n\nsetReadOnly( exists, 'sync', sync );\n\n\n// EXPORTS //\n\nmodule.exports = exists;\n"],
"mappings": "uGAAA,IAAAA,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAsBA,IAAIC,EAAK,QAAS,IAAK,EAKnBC,EACC,OAAOD,EAAG,QAAW,WACzBC,EAAMD,EAAG,OAETC,EAAMD,EAAG,KA0BV,SAASE,EAAQC,EAAMC,EAAO,CAC7BH,EAAKE,EAAME,CAAK,EAShB,SAASA,EAAMC,EAAQ,CACtB,OAAKF,EAAK,SAAW,EACfE,EACGF,EAAME,EAAO,EAAM,EAEpBF,EAAM,KAAM,EAAK,EAGjBA,EADH,CAAAE,CACe,CAGrB,CACD,CAKAP,EAAO,QAAUG,ICpFjB,IAAAK,EAAAC,EAAA,SAAAC,EAAAC,EAAA,cAwBA,IAAIC,EAAK,QAAS,IAAK,EAKnBC,EACC,OAAOD,EAAG,YAAe,WAC7BC,EAAMD,EAAG,WAETC,EAAMD,EAAG,SAgBV,SAASE,EAAYC,EAAO,CAC3B,GAAI,CACHF,EAAKE,CAAK,CACX,OAAUC,EAAM,CACf,MAAO,EACR,CACA,MAAO,EACR,CAKAL,EAAO,QAAUG,ICRjB,IAAIG,EAAc,QAAS,uDAAwD,EAC/EC,EAAS,IACTC,EAAO,IAKXF,EAAaC,EAAQ,OAAQC,CAAK,EAKlC,OAAO,QAAUD",
"names": ["require_async", "__commonJSMin", "exports", "module", "fs", "fcn", "exists", "path", "clbk", "done", "error", "require_sync", "__commonJSMin", "exports", "module", "fs", "fcn", "existsSync", "path", "err", "setReadOnly", "exists", "sync"]
}