properties-file
Advanced tools
Comparing version 2.1.10 to 2.1.11
@@ -10,3 +10,3 @@ import { KeyValueObject } from '../'; | ||
*/ | ||
export declare function getProperties(content: string): Properties; | ||
export declare const getProperties: (content: string) => Properties; | ||
/** | ||
@@ -19,2 +19,2 @@ * Converts the content of a `.properties` file to JSON. | ||
*/ | ||
export declare function propertiesToJson(content: string): KeyValueObject; | ||
export declare const propertiesToJson: (content: string) => KeyValueObject; |
@@ -14,3 +14,3 @@ "use strict"; | ||
*/ | ||
function getProperties(content) { | ||
var getProperties = function (content) { | ||
// Remove BOM character if present and create an array from lines. | ||
@@ -50,3 +50,3 @@ var lines = (content.codePointAt(0) === 0xfeff ? content.slice(1) : content).split(/\r?\n/); | ||
return properties; | ||
} | ||
}; | ||
exports.getProperties = getProperties; | ||
@@ -60,5 +60,3 @@ /** | ||
*/ | ||
function propertiesToJson(content) { | ||
return getProperties(content).toJson(); | ||
} | ||
var propertiesToJson = function (content) { return (0, exports.getProperties)(content).toJson(); }; | ||
exports.propertiesToJson = propertiesToJson; |
@@ -12,3 +12,3 @@ /// <reference types="node" /> | ||
*/ | ||
export declare function getProperties(filePath: string, encoding?: BufferEncoding): Properties; | ||
export declare const getProperties: (filePath: string, encoding?: BufferEncoding) => Properties; | ||
/** | ||
@@ -22,2 +22,2 @@ * Converts the content of a `.properties` file to JSON. | ||
*/ | ||
export declare function propertiesToJson(filePath: string, encoding?: BufferEncoding): KeyValueObject; | ||
export declare const propertiesToJson: (filePath: string, encoding?: BufferEncoding) => KeyValueObject; |
@@ -14,3 +14,3 @@ "use strict"; | ||
*/ | ||
function getProperties(filePath, encoding) { | ||
var getProperties = function (filePath, encoding) { | ||
if (!(0, node_fs_1.existsSync)(filePath)) { | ||
@@ -20,3 +20,3 @@ throw new Error("file not found at ".concat(filePath)); | ||
return (0, content_1.getProperties)((0, node_fs_1.readFileSync)(filePath, encoding !== null && encoding !== void 0 ? encoding : 'utf8')); | ||
} | ||
}; | ||
exports.getProperties = getProperties; | ||
@@ -31,5 +31,5 @@ /** | ||
*/ | ||
function propertiesToJson(filePath, encoding) { | ||
return getProperties(filePath, encoding).toJson(); | ||
} | ||
var propertiesToJson = function (filePath, encoding) { | ||
return (0, exports.getProperties)(filePath, encoding).toJson(); | ||
}; | ||
exports.propertiesToJson = propertiesToJson; |
@@ -10,2 +10,3 @@ /// <reference types="../properties-file" /> | ||
*/ | ||
export default function (content: string): string; | ||
declare const webpackLoader: (content: string) => string; | ||
export default webpackLoader; |
@@ -11,5 +11,5 @@ "use strict"; | ||
*/ | ||
function default_1(content) { | ||
var webpackLoader = function (content) { | ||
return "module.exports = ".concat(JSON.stringify((0, content_1.propertiesToJson)(content)), ";"); | ||
} | ||
exports.default = default_1; | ||
}; | ||
exports.default = webpackLoader; |
{ | ||
"name": "properties-file", | ||
"version": "2.1.10", | ||
"version": "2.1.11", | ||
"description": ".properties file parser, JSON converter and Webpack loader.", | ||
@@ -56,5 +56,5 @@ "author": "Avansai (https://avansai.com)", | ||
"@release-it/conventional-changelog": "^5.1.1", | ||
"@types/jest": "^29.1.2", | ||
"@typescript-eslint/eslint-plugin": "^5.40.0", | ||
"@typescript-eslint/parser": "^5.40.0", | ||
"@types/jest": "^29.2.0", | ||
"@typescript-eslint/eslint-plugin": "^5.40.1", | ||
"@typescript-eslint/parser": "^5.40.1", | ||
"dotenv-cli": "^6.0.0", | ||
@@ -64,8 +64,9 @@ "eslint": "^8.25.0", | ||
"eslint-import-resolver-node": "^0.3.6", | ||
"eslint-import-resolver-typescript": "^3.5.1", | ||
"eslint-import-resolver-typescript": "^3.5.2", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jest": "^27.1.2", | ||
"eslint-plugin-jest": "^27.1.3", | ||
"eslint-plugin-prefer-arrow-functions": "^3.1.4", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-unicorn": "^44.0.2", | ||
"jest": "^29.2.0", | ||
"jest": "^29.2.1", | ||
"prettier": "^2.7.1", | ||
@@ -72,0 +73,0 @@ "prettier-plugin-organize-imports": "^3.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40446
22
669