Comparing version 2.0.1 to 2.0.2
@@ -1,1 +0,2 @@ | ||
export declare function template(name: string, params?: {}): Promise<any>; | ||
import * as allTemplates from './templates'; | ||
export declare function template(name: keyof typeof allTemplates, params?: any): Promise<string>; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (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; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.template = void 0; | ||
const fs_1 = __importDefault(require("fs")); | ||
const path_1 = __importDefault(require("path")); | ||
const handlebars_1 = __importDefault(require("handlebars")); | ||
// import { fileURLToPath } from 'url' | ||
// const __filename = fileURLToPath(import.meta.url) | ||
// const __dirname = path.dirname(__filename) | ||
const templates = new Map(); | ||
const allTemplates = __importStar(require("./templates")); | ||
async function template(name, params = {}) { | ||
if (!templates.has(name)) { | ||
const templateSrc = await fs_1.default.promises.readFile(path_1.default.join(__dirname, '..', 'templates', `${name}.xml`), 'utf8'); | ||
templates.set(name, handlebars_1.default.compile(templateSrc)); | ||
} | ||
return templates.get(name)(params); | ||
return allTemplates[name](params); | ||
} | ||
exports.template = template; |
{ | ||
"name": "bir1", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "GUS REGON api client", | ||
@@ -19,4 +19,3 @@ "keywords": [ | ||
"files": [ | ||
"dist", | ||
"templates" | ||
"dist" | ||
], | ||
@@ -31,3 +30,2 @@ "scripts": { | ||
"got": "^11.8.2", | ||
"handlebars": "^4.7.8", | ||
"xml2js": "^0.6.2" | ||
@@ -34,0 +32,0 @@ }, |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15120
3
24
302
1
- Removedhandlebars@^4.7.8
- Removedhandlebars@4.7.8(transitive)
- Removedminimist@1.2.8(transitive)
- Removedneo-async@2.6.2(transitive)
- Removedsource-map@0.6.1(transitive)
- Removeduglify-js@3.19.3(transitive)
- Removedwordwrap@1.0.0(transitive)