tr-currency 19.0.1 → 21.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: "19.0.1", ngImport: i0, type: TrCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
53
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: TrCurrencyPipe, isStandalone: true, name: "trCurrency" }); }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: TrCurrencyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
53
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.0.0", ngImport: i0, type: TrCurrencyPipe, isStandalone: true, name: "trCurrency" }); }
54
54
  }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: TrCurrencyPipe, decorators: [{
55
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.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}","/*\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"],"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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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}","/*\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\nex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IAAA,EAAA,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,25 +1,25 @@
1
1
  {
2
2
  "name": "tr-currency",
3
- "version": "19.0.1",
3
+ "version": "21.0.0",
4
4
  "peerDependencies": {
5
- "@angular/common": "^19.0.0",
6
- "@angular/core": "^19.0.0"
5
+ "@angular/common": "^21.0.0",
6
+ "@angular/core": "^21.0.0"
7
7
  },
8
8
  "dependencies": {
9
- "tslib": "^2.3.0"
9
+ "tslib": "^2.8.1"
10
10
  },
11
11
  "sideEffects": false,
12
12
  "repository": {
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
  }
@@ -1,7 +1,10 @@
1
+ import * as i0 from '@angular/core';
1
2
  import { PipeTransform } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- export declare class TrCurrencyPipe implements PipeTransform {
3
+
4
+ declare class TrCurrencyPipe implements PipeTransform {
4
5
  transform(value: number, symbol?: string, isCurrencyFront?: boolean, fraction?: number): string;
5
6
  static ɵfac: i0.ɵɵFactoryDeclaration<TrCurrencyPipe, never>;
6
7
  static ɵpipe: i0.ɵɵPipeDeclaration<TrCurrencyPipe, "trCurrency", true>;
7
8
  }
9
+
10
+ export { TrCurrencyPipe };
package/index.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="tr-currency" />
5
- export * from './public-api';
package/public-api.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from './lib/tr-currency.pipe';