nfets 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
File without changes
@@ -0,0 +1,28 @@
1
+ // packages/core/src/infrastructure/decimaljs.ts
2
+ import { Decimal as DecimalJs } from "decimal.js";
3
+
4
+ class Decimal extends DecimalJs {
5
+ }
6
+ // packages/core/src/infrastructure/xml2js-builder.ts
7
+ import * as Xml2js from "xml2js";
8
+ import {
9
+ defaultParserOptions
10
+ } from "src/domain/entities/xml-builder";
11
+
12
+ class Xml2JsBuilder {
13
+ xml2js;
14
+ constructor(xml2js = Xml2js) {
15
+ this.xml2js = xml2js;
16
+ }
17
+ parse(xml, options) {
18
+ options ??= defaultParserOptions;
19
+ return new Promise((resolve, reject) => new this.xml2js.Parser(options).parseString(xml, (err, result) => err ? reject(err) : resolve(result)));
20
+ }
21
+ build(object, options) {
22
+ return Promise.resolve(new this.xml2js.Builder(options).buildObject(object));
23
+ }
24
+ }
25
+ export {
26
+ Xml2JsBuilder,
27
+ Decimal
28
+ };
@@ -0,0 +1,9 @@
1
+ // packages/nfe/src/index.ts
2
+ import { Decimal } from "@nfets/core";
3
+ var nfe = () => {
4
+ console.log("success!", new Decimal(0.2).add(0.1).toNumber());
5
+ };
6
+ nfe();
7
+ export {
8
+ nfe
9
+ };
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "nfets",
3
+ "version": "0.0.2",
4
+ "description": "typescript libraries for Brazilian's SEFAZ standards",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "clean": "rimraf packages/{core,nfe,transmission}/{tsconfig.tsbuildinfo,dist}",
9
+ "build": "bun clean && bun --filter @nfets/core build && bun --filter @nfets/transmission build && bun --filter @nfets/nfe build",
10
+ "lint": "eslint -c eslint.config.mjs",
11
+ "test": "bun --filter * test"
12
+ },
13
+ "license": "ISC",
14
+ "workspaces": [
15
+ "packages/*"
16
+ ],
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "dependencies": {
24
+ "rimraf": "^6.0.1"
25
+ },
26
+ "devDependencies": {
27
+ "@eslint/js": "^9.18.0",
28
+ "@types/bun": "^1.1.18",
29
+ "@types/jest": "^29.5.14",
30
+ "@types/node": "^22.10.7",
31
+ "@typescript-eslint/parser": "^8.21.0",
32
+ "eslint-plugin-prettier": "^5.2.3",
33
+ "globals": "^15.14.0",
34
+ "jest": "^29.7.0",
35
+ "tsc-alias": "^1.8.10",
36
+ "typescript-eslint": "^8.21.0"
37
+ },
38
+ "peerDependencies": {
39
+ "typescript": "^5.0.0"
40
+ }
41
+ }