tr-currency 20.0.0 → 22.0.0

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.
@@ -49,10 +49,10 @@ class TrCurrencyPipe {
49
49
  }
50
50
  return newMoney;
51
51
  }
52
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: TrCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
53
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: TrCurrencyPipe, isStandalone: true, name: "trCurrency" }); }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: TrCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
53
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.0", ngImport: i0, type: TrCurrencyPipe, isStandalone: true, name: "trCurrency" }); }
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: TrCurrencyPipe, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: TrCurrencyPipe, decorators: [{
56
56
  type: Pipe,
57
57
  args: [{
58
58
  name: 'trCurrency',
@@ -1 +1 @@
1
- {"version":3,"file":"tr-currency.mjs","sources":["../../../projects/my-lib/src/lib/tr-currency.pipe.ts","../../../projects/my-lib/src/public-api.ts","../../../projects/my-lib/src/tr-currency.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'trCurrency',\r\n standalone: true\r\n})\r\nexport class TrCurrencyPipe implements PipeTransform {\r\n\r\n transform(value: number, symbol: string = \"\", isCurrencyFront: boolean = true, fraction: number = 2): string {\r\n if (fraction < 0) fraction = 0;\r\n \r\n if (value === undefined || value === null || isNaN(Number(value))) {\r\n if (fraction === 0) {\r\n return isCurrencyFront ? `${symbol}0` : `0 ${symbol}`;\r\n } else {\r\n return isCurrencyFront ? `${symbol}0,${'0'.repeat(fraction)}` : `0,${'0'.repeat(fraction)} ${symbol}`;\r\n }\r\n }\r\n \r\n value = Number(value);\r\n\r\n let isValueNegative = false;\r\n if (value < 0) {\r\n isValueNegative = true;\r\n value = Math.abs(value);\r\n }\r\n\r\n value = parseFloat(value.toFixed(fraction));\r\n\r\n let money = value.toString().split(\".\");\r\n let newMoney = \"\";\r\n let lira = money[0];\r\n let penny = money.length > 1 ? money[1] : \"\";\r\n \r\n if (penny.length < fraction) {\r\n penny += \"0\".repeat(fraction - penny.length);\r\n }\r\n\r\n let count = 0;\r\n for (let i = lira.length; i > 0; i--) {\r\n if (count === 3 && count < lira.length) {\r\n newMoney = lira[i - 1] + \".\" + newMoney;\r\n count = 1;\r\n } else {\r\n newMoney = lira[i - 1] + newMoney;\r\n count++;\r\n }\r\n }\r\n\r\n if (!isCurrencyFront) {\r\n newMoney = fraction === 0 ? `${newMoney} ${symbol}` : `${newMoney},${penny} ${symbol}`;\r\n } else {\r\n newMoney = fraction === 0 ? `${symbol}${newMoney}` : `${symbol}${newMoney},${penny}`;\r\n }\r\n\r\n if (isValueNegative) {\r\n newMoney = `-${newMoney}`;\r\n }\r\n\r\n return newMoney;\r\n }\r\n}","/*\n * Public API Surface of my-lib\n */\n\nexport * from './lib/tr-currency.pipe';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAMa,cAAc,CAAA;IAEzB,SAAS,CAAC,KAAa,EAAE,MAAiB,GAAA,EAAE,EAAE,eAA2B,GAAA,IAAI,EAAE,QAAA,GAAmB,CAAC,EAAA;QACjG,IAAI,QAAQ,GAAG,CAAC;YAAE,QAAQ,GAAG,CAAC;AAE9B,QAAA,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI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public-api.ts","../../../projects/my-lib/src/tr-currency.ts"],"sourcesContent":["import { Pipe, PipeTransform } from '@angular/core';\r\n\r\n@Pipe({\r\n name: 'trCurrency',\r\n standalone: true\r\n})\r\nexport class TrCurrencyPipe implements PipeTransform {\r\n\r\n transform(value: number, symbol: string = \"\", isCurrencyFront: boolean = true, fraction: number = 2): string {\r\n if (fraction < 0) fraction = 0;\r\n \r\n if (value === undefined || value === null || isNaN(Number(value))) {\r\n if (fraction === 0) {\r\n return isCurrencyFront ? `${symbol}0` : `0 ${symbol}`;\r\n } else {\r\n return isCurrencyFront ? `${symbol}0,${'0'.repeat(fraction)}` : `0,${'0'.repeat(fraction)} ${symbol}`;\r\n }\r\n }\r\n \r\n value = Number(value);\r\n\r\n let isValueNegative = false;\r\n if (value < 0) {\r\n isValueNegative = true;\r\n value = Math.abs(value);\r\n }\r\n\r\n value = parseFloat(value.toFixed(fraction));\r\n\r\n let money = value.toString().split(\".\");\r\n let newMoney = \"\";\r\n let lira = money[0];\r\n let penny = money.length > 1 ? money[1] : \"\";\r\n \r\n if (penny.length < fraction) {\r\n penny += \"0\".repeat(fraction - penny.length);\r\n }\r\n\r\n let count = 0;\r\n for (let i = lira.length; i > 0; i--) {\r\n if (count === 3 && count < lira.length) {\r\n newMoney = lira[i - 1] + \".\" + newMoney;\r\n count = 1;\r\n } else {\r\n newMoney = lira[i - 1] + newMoney;\r\n count++;\r\n }\r\n }\r\n\r\n if (!isCurrencyFront) {\r\n newMoney = fraction === 0 ? `${newMoney} ${symbol}` : `${newMoney},${penny} ${symbol}`;\r\n } else {\r\n newMoney = fraction === 0 ? `${symbol}${newMoney}` : `${symbol}${newMoney},${penny}`;\r\n }\r\n\r\n if (isValueNegative) {\r\n newMoney = `-${newMoney}`;\r\n }\r\n\r\n return newMoney;\r\n }\r\n}","/*\r\n * Public API Surface of my-lib\r\n */\r\n\r\nexport * from './lib/tr-currency.pipe';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n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IAAA,EAAA,YAAA,EAAA,CAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAJ1B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;AACJ,oBAAA,IAAI,EAAE,YAAY;AAClB,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACLD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "tr-currency",
3
- "version": "20.0.0",
3
+ "version": "22.0.0",
4
4
  "peerDependencies": {
5
- "@angular/common": "^20.0.0",
6
- "@angular/core": "^20.0.0"
5
+ "@angular/common": "^22.0.0",
6
+ "@angular/core": "^22.0.0"
7
7
  },
8
8
  "dependencies": {
9
9
  "tslib": "^2.8.1"
@@ -13,14 +13,15 @@
13
13
  "url": "https://github.com/TanerSaydam/npm-tr-currency"
14
14
  },
15
15
  "module": "fesm2022/tr-currency.mjs",
16
- "typings": "index.d.ts",
16
+ "typings": "types/tr-currency.d.ts",
17
17
  "exports": {
18
18
  "./package.json": {
19
19
  "default": "./package.json"
20
20
  },
21
21
  ".": {
22
- "types": "./index.d.ts",
22
+ "types": "./types/tr-currency.d.ts",
23
23
  "default": "./fesm2022/tr-currency.mjs"
24
24
  }
25
- }
25
+ },
26
+ "type": "module"
26
27
  }
File without changes