Sha256: 5bb0322e3cb793d039688ee1bfe95a35b49c4e2567aa3d662deaca94566c2edd

Contents?: true

Size: 1.29 KB

Versions: 41

Compression:

Stored size: 1.29 KB

Contents

{"version":3,"sources":["../src/getDirectory.ts"],"names":["getDirectory","filepath","filePathIsDirectory","directory","path","dirname","getDirectorySync"],"mappings":";;;;;;;;AAAA;;AACA;;;;AAEA,eAAeA,YAAf,CAA4BC,QAA5B,EAA+D;AAC7D,QAAMC,mBAAmB,GAAG,MAAM,2BAAYD,QAAZ,CAAlC;;AAEA,MAAIC,mBAAmB,KAAK,IAA5B,EAAkC;AAChC,WAAOD,QAAP;AACD;;AAED,QAAME,SAAS,GAAGC,cAAKC,OAAL,CAAaJ,QAAb,CAAlB;;AAEA,SAAOE,SAAP;AACD;;AAED,SAASG,gBAAT,CAA0BL,QAA1B,EAAoD;AAClD,QAAMC,mBAAmB,GAAG,+BAAgBD,QAAhB,CAA5B;;AAEA,MAAIC,mBAAmB,KAAK,IAA5B,EAAkC;AAChC,WAAOD,QAAP;AACD;;AAED,QAAME,SAAS,GAAGC,cAAKC,OAAL,CAAaJ,QAAb,CAAlB;;AAEA,SAAOE,SAAP;AACD","sourcesContent":["import path from 'path';\nimport { isDirectory, isDirectorySync } from 'path-type';\n\nasync function getDirectory(filepath: string): Promise<string> {\n  const filePathIsDirectory = await isDirectory(filepath);\n\n  if (filePathIsDirectory === true) {\n    return filepath;\n  }\n\n  const directory = path.dirname(filepath);\n\n  return directory;\n}\n\nfunction getDirectorySync(filepath: string): string {\n  const filePathIsDirectory = isDirectorySync(filepath);\n\n  if (filePathIsDirectory === true) {\n    return filepath;\n  }\n\n  const directory = path.dirname(filepath);\n\n  return directory;\n}\n\nexport { getDirectory, getDirectorySync };\n"],"file":"getDirectory.js"}

Version data entries

41 entries across 40 versions & 7 rubygems

Version Path
trusty-cms-6.3.1 node_modules/cosmiconfig/dist/getDirectory.js.map
optimacms-0.1.61 spec/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.7 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.6 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.5 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.4 node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.16.1 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.15.2 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.3 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.2 node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.18.4 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.18.1 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.14.0 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/babel-plugin-macros/node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.1 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-4.3.5 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-5.0.0 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-4.3.4 node_modules/cosmiconfig/dist/getDirectory.js.map
trusty-cms-4.3.3 node_modules/cosmiconfig/dist/getDirectory.js.map