@node-cli/utilities
Advanced tools
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import { merge, mergeWith, uniqueId } from \"lodash-es\";\n\n/**\n * Converts the first character of string to upper case\n * @param {string} string_ the string to convert\n * @returns {string} the converted string\n */\nexport const upperFirst = (string_: string): string =>\n\tstring_[0].toUpperCase() + string_.slice(1);\n\n/**\n * Converts the first character of string to lower case\n * @param {string} string_ the string to convert\n * @returns {string} the converted string\n */\nexport const lowerFirst = (string_: string): string =>\n\tstring_[0].toLowerCase() + string_.slice(1);\n\n/**\n * Generate a random number to append to an `id` string.\n *\n * NOTE: we are still using the good old lodash uniqueId when\n * the code is not in production, so that the results are a\n * little bit more consistent tests after test instead of\n * being completely random, so that they do not break\n * potential snapshot tests.\n *\n * @param {String} prefix - When a prefix is provided, the\n * function will return a random\n * number appended to the provided\n * prefix.\n *\n * @returns {String} - Returns a string with random numbers.\n */\nexport const uniqueID = (prefix: string = \"\"): string => {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\treturn uniqueId(prefix);\n\t}\n\t// Extract the decimal part\n\tconst randomNumber = `${Math.random()}`.split(\".\")[1];\n\treturn prefix || prefix !== \"\" ? `${prefix}${randomNumber}` : randomNumber;\n};\n\n/**\n * Wrapper method for lodash `merge()` and `mergeWith()` methods.\n *\n * Without the `customizer` function, this method recursively merges own and inherited\n * enumerable string keyed properties of source objects into the destination object.\n * Source properties that resolve to undefined are skipped if a destination value exists.\n * Array and plain object properties are merged recursively. Other objects and value\n * types are overridden by assignment. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * With the `customizer` function, the behavior is the same except that `customizer` is\n * invoked to produce the merged values of the destination and source properties.\n * If customizer returns undefined, merging is handled by the `fastMerge` instead.\n * The customizer is invoked with six arguments: `(objValue, srcValue, key, object,\n * source, stack)`\n * @param {object} objectA\n * @param {object} objectB\n * @param {function} customizer\n * @returns {object} !! WARNING: this method will mutate objectA\n */\nexport const fastMerge = (\n\tobjectA: any,\n\tobjectB: any,\n\tcustomizer?: any\n): object => {\n\treturn typeof customizer === \"function\"\n\t\t? mergeWith(objectA, objectB, customizer)\n\t\t: merge(objectA, objectB);\n};\n"],"names":["merge","mergeWith","uniqueId","upperFirst","string_","toUpperCase","slice","lowerFirst","toLowerCase","uniqueID","prefix","process","env","NODE_ENV","randomNumber","Math","random","split","fastMerge","objectA","objectB","customizer"],"mappings":"AAAA,SAASA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,aAAa,CAACC,UAC1BA,OAAO,CAAC,EAAE,CAACC,gBAAgBD,QAAQE,MAAM,GAAG;AAE7C;;;;CAIC,GACD,OAAO,MAAMC,aAAa,CAACH,UAC1BA,OAAO,CAAC,EAAE,CAACI,gBAAgBJ,QAAQE,MAAM,GAAG;AAE7C;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMG,WAAW,CAACC,SAAiB,EAAE;IAC3C,IAAIC,QAAQC,IAAIC,aAAa,cAAc;QAC1C,OAAOX,SAASQ;IACjB;IACA,2BAA2B;IAC3B,MAAMI,eAAe,CAAC,EAAEC,KAAKC,SAAS,CAAC,CAACC,MAAM,IAAI,CAAC,EAAE;IACrD,OAAOP,UAAUA,WAAW,KAAK,CAAC,EAAEA,OAAO,EAAEI,aAAa,CAAC,GAAGA;AAC/D,EAAE;AAEF;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMI,YAAY,CACxBC,SACAC,SACAC;IAEA,OAAO,OAAOA,eAAe,aAC1BpB,UAAUkB,SAASC,SAASC,cAC5BrB,MAAMmB,SAASC;AACnB,EAAE"} | ||
| {"version":3,"sources":["../src/utilities.ts"],"sourcesContent":["import { merge, mergeWith, uniqueId } from \"lodash-es\";\n\n/**\n * Converts the first character of string to upper case\n * @param {string} string_ the string to convert\n * @returns {string} the converted string\n */\nexport const upperFirst = (string_: string): string =>\n\tstring_[0].toUpperCase() + string_.slice(1);\n\n/**\n * Converts the first character of string to lower case\n * @param {string} string_ the string to convert\n * @returns {string} the converted string\n */\nexport const lowerFirst = (string_: string): string =>\n\tstring_[0].toLowerCase() + string_.slice(1);\n\n/**\n * Generate a random number to append to an `id` string.\n *\n * NOTE: we are still using the good old lodash uniqueId when\n * the code is not in production, so that the results are a\n * little bit more consistent tests after test instead of\n * being completely random, so that they do not break\n * potential snapshot tests.\n *\n * @param {String} prefix - When a prefix is provided, the\n * function will return a random\n * number appended to the provided\n * prefix.\n *\n * @returns {String} - Returns a string with random numbers.\n */\nexport const uniqueID = (prefix: string = \"\"): string => {\n\tif (process.env.NODE_ENV !== \"production\") {\n\t\treturn uniqueId(prefix);\n\t}\n\t// Extract the decimal part\n\tconst randomNumber = `${Math.random()}`.split(\".\")[1];\n\treturn prefix || prefix !== \"\" ? `${prefix}${randomNumber}` : randomNumber;\n};\n\n/**\n * Wrapper method for lodash `merge()` and `mergeWith()` methods.\n *\n * Without the `customizer` function, this method recursively merges own and inherited\n * enumerable string keyed properties of source objects into the destination object.\n * Source properties that resolve to undefined are skipped if a destination value exists.\n * Array and plain object properties are merged recursively. Other objects and value\n * types are overridden by assignment. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * With the `customizer` function, the behavior is the same except that `customizer` is\n * invoked to produce the merged values of the destination and source properties.\n * If customizer returns undefined, merging is handled by the `fastMerge` instead.\n * The customizer is invoked with six arguments: `(objValue, srcValue, key, object,\n * source, stack)`\n * @param {object} objectA\n * @param {object} objectB\n * @param {function} customizer\n * @returns {object} !! WARNING: this method will mutate objectA\n */\nexport const fastMerge = (\n\tobjectA: any,\n\tobjectB: any,\n\tcustomizer?: any,\n): object => {\n\treturn typeof customizer === \"function\"\n\t\t? mergeWith(objectA, objectB, customizer)\n\t\t: merge(objectA, objectB);\n};\n"],"names":["merge","mergeWith","uniqueId","upperFirst","string_","toUpperCase","slice","lowerFirst","toLowerCase","uniqueID","prefix","process","env","NODE_ENV","randomNumber","Math","random","split","fastMerge","objectA","objectB","customizer"],"mappings":"AAAA,SAASA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,YAAY;AAEvD;;;;CAIC,GACD,OAAO,MAAMC,aAAa,CAACC,UAC1BA,OAAO,CAAC,EAAE,CAACC,WAAW,KAAKD,QAAQE,KAAK,CAAC,GAAG;AAE7C;;;;CAIC,GACD,OAAO,MAAMC,aAAa,CAACH,UAC1BA,OAAO,CAAC,EAAE,CAACI,WAAW,KAAKJ,QAAQE,KAAK,CAAC,GAAG;AAE7C;;;;;;;;;;;;;;;CAeC,GACD,OAAO,MAAMG,WAAW,CAACC,SAAiB,EAAE;IAC3C,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QAC1C,OAAOX,SAASQ;IACjB;IACA,2BAA2B;IAC3B,MAAMI,eAAe,CAAC,EAAEC,KAAKC,MAAM,GAAG,CAAC,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;IACrD,OAAOP,UAAUA,WAAW,KAAK,CAAC,EAAEA,OAAO,EAAEI,aAAa,CAAC,GAAGA;AAC/D,EAAE;AAEF;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMI,YAAY,CACxBC,SACAC,SACAC;IAEA,OAAO,OAAOA,eAAe,aAC1BpB,UAAUkB,SAASC,SAASC,cAC5BrB,MAAMmB,SAASC;AACnB,EAAE"} |
+5
-5
| { | ||
| "name": "@node-cli/utilities", | ||
| "version": "1.0.0", | ||
| "version": "1.0.1", | ||
| "license": "MIT", | ||
@@ -18,5 +18,5 @@ "author": "Arno Versini", | ||
| "scripts": { | ||
| "build": "yarn run clean && yarn run build:types && yarn run build:js && yarn run build:barrel", | ||
| "build": "npm-run-all --serial clean build:types build:js build:barrel", | ||
| "build:barrel": "barrelsby --delete --directory dist --pattern \"**/*.d.ts\" --name \"index.d\"", | ||
| "build:js": "swc --source-maps --out-dir dist src", | ||
| "build:js": "swc --strip-leading-paths --source-maps --out-dir dist src", | ||
| "build:types": "tsc", | ||
@@ -27,3 +27,3 @@ "clean": "rimraf dist types coverage", | ||
| "test:coverage": "npm run test -- --coverage", | ||
| "watch": "swc --watch --out-dir dist src" | ||
| "watch": "swc --strip-leading-paths --watch --out-dir dist src" | ||
| }, | ||
@@ -33,3 +33,3 @@ "publishConfig": { | ||
| }, | ||
| "gitHead": "bbdae6c2e303b431aa3e49aa9a3c86365449f06f" | ||
| "gitHead": "4205e6c82a1dee6f83f5b9f45d0ea878490287eb" | ||
| } |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
14065
0.41%