Socket
Socket
Sign inDemoInstall

clef-parse

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

dist/convert-case.d.ts

6

dist/index.d.ts
export declare const Path: unique symbol;
export declare type Hint = typeof String | typeof Boolean | typeof Number | typeof Path;
export type Hint = typeof String | typeof Boolean | typeof Number | typeof Path;
export declare function parseArgv(argv?: Array<string>, hints?: {
[key: string]: Hint | undefined | null;
}, { isAbsolute, resolvePath, getCwd, }?: {
isAbsolute?: (somePath: string) => boolean;
resolvePath?: (...parts: Array<string>) => string;
getCwd?: () => string;
}): {

@@ -6,0 +10,0 @@ options: any;

29

dist/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -27,3 +8,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

const path_1 = __importDefault(require("path"));
const changeCase = __importStar(require("change-case"));
const convert_case_1 = require("./convert-case");
exports.Path = Symbol("Path");

@@ -44,3 +25,3 @@ function bestGuess(nextValue) {

}
function parseArgv(argv = process.argv.slice(2), hints = {}) {
function parseArgv(argv = process.argv.slice(2), hints = {}, { isAbsolute = path_1.default.isAbsolute, resolvePath = path_1.default.resolve, getCwd = process.cwd, } = {}) {
const options = {};

@@ -70,3 +51,3 @@ const positionalArgs = [];

}
propertyName = changeCase.camelCase(item.replace(/^--/, ""));
propertyName = (0, convert_case_1.convertToCamelCase)(item.replace(/^--/, ""));
}

@@ -105,5 +86,5 @@ let propertyValue;

argv.shift();
propertyValue = path_1.default.isAbsolute(nextValue)
propertyValue = isAbsolute(nextValue)
? nextValue
: path_1.default.resolve(process.cwd(), nextValue);
: resolvePath(getCwd(), nextValue);
break;

@@ -110,0 +91,0 @@ }

{
"name": "clef-parse",
"version": "0.2.0",
"version": "0.3.0",
"description": "Simple, lightweight argv parser. Powers the cleffa and clefairy packages",

@@ -8,3 +8,3 @@ "main": "dist/index.js",

"scripts": {
"build": "rm -rf dist/* && tsc",
"build": "rm -rf dist/* && tsc --skipLibCheck",
"test": "vitest"

@@ -22,3 +22,3 @@ },

],
"author": "Lily Scott <me@suchipi.com>",
"author": "Lily Skye <me@suchipi.com>",
"license": "MIT",

@@ -34,6 +34,3 @@ "devDependencies": {

"url": "https://github.com/suchipi/clef-parse.git"
},
"dependencies": {
"change-case": "^4.1.2"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc