@zodash/format
Advanced tools
Comparing version
@@ -1,1 +0,1 @@ | ||
export declare const format: (pattern: string, map: Record<string, any>) => string; | ||
export declare function format(pattern: string, map: Record<string, any>): string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.format = (pattern, map) => { | ||
function format(pattern, map) { | ||
return pattern.replace(/{([^}]+)}/g, (_, key) => { | ||
return typeof map[key] !== 'undefined' ? map[key] : ''; | ||
}); | ||
}; | ||
} | ||
exports.format = format; | ||
//# sourceMappingURL=format.js.map |
{ | ||
"name": "@zodash/format", | ||
"version": "1.0.1-alpha.0", | ||
"version": "1.0.1-alpha.4+2db5339", | ||
"description": "format string with object values", | ||
@@ -62,3 +62,4 @@ "keywords": [ | ||
"tsc": "tsc", | ||
"test": "jest -w 1" | ||
"test": "jest -w 1", | ||
"coverage": "codecov" | ||
}, | ||
@@ -68,3 +69,3 @@ "bugs": { | ||
}, | ||
"gitHead": "cd45e2c12f19c4018f9e811072850651ca232959" | ||
"gitHead": "2db5339cc443294e7d96b40b99de0bb3d0bc243f" | ||
} |
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2262
2.03%9
12.5%2
100%