@ipp/cli
Version:
An image build orchestrator for the modern web
25 lines (24 loc) • 668 B
JavaScript
;
/**
* Image Processing Pipeline - Copyright (c) Marcus Cemes
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.pathMetadata = void 0;
const path_1 = require("path");
function pathMetadata(path) {
const parsed = (0, path_1.parse)(path);
return {
base: parsed.base,
ext: parsed.ext,
dir: slash(parsed.dir),
name: parsed.name,
path: slash(path),
};
}
exports.pathMetadata = pathMetadata;
function slash(text) {
return text.replace(/\\/g, "/");
}