aneka 0.13.1 → 0.14.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.
package/CHANGES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-06-01
4
+
5
+ - [0.14.0] Add ```getCallerFilename```
6
+
3
7
  ## 2026-03-10
4
8
 
5
9
  - [0.13.0] Add ```textToArray```
package/index.js CHANGED
@@ -31,6 +31,7 @@ import fillObject from './src/fill-object.js'
31
31
  import parseKvString from './src/parse-kv-string.js'
32
32
  import without from './src/without.js'
33
33
  import textToArray from './src/text-to-array.js'
34
+ import getCallerFilename from './src/get-caller-filename.js'
34
35
 
35
36
  export {
36
37
  arrangeArray,
@@ -43,6 +44,7 @@ export {
43
44
  filterDuplicate,
44
45
  filterIndex,
45
46
  generateId,
47
+ getCallerFilename,
46
48
  getIndex,
47
49
  getKeyByValue,
48
50
  includes,
@@ -80,6 +82,7 @@ export default {
80
82
  filterDuplicate,
81
83
  filterIndex,
82
84
  generateId,
85
+ getCallerFilename,
83
86
  getIndex,
84
87
  getKeyByValue,
85
88
  includes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aneka",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "Some usefull function helper for daily use",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -0,0 +1,20 @@
1
+ function getCallerFilename () {
2
+ const originalFunc = Error.prepareStackTrace
3
+ let callerfile
4
+
5
+ try {
6
+ const err = new Error()
7
+ Error.prepareStackTrace = (_, stack) => stack
8
+ const currentfile = err.stack.shift().getFileName()
9
+
10
+ while (err.stack.length) {
11
+ callerfile = err.stack.shift().getFileName()
12
+ if (currentfile !== callerfile) break
13
+ }
14
+ } catch (e) {}
15
+
16
+ Error.prepareStackTrace = originalFunc
17
+ return callerfile
18
+ }
19
+
20
+ export default getCallerFilename