@nymphjs/sorter 1.0.0-beta.3 → 1.0.0-beta.31

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/CHANGELOG.md CHANGED
@@ -3,6 +3,120 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-beta.31](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.30...v1.0.0-beta.31) (2023-05-12)
7
+
8
+ **Note:** Version bump only for package @nymphjs/sorter
9
+
10
+ # [1.0.0-beta.30](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.29...v1.0.0-beta.30) (2023-05-12)
11
+
12
+ **Note:** Version bump only for package @nymphjs/sorter
13
+
14
+ # [1.0.0-beta.29](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.28...v1.0.0-beta.29) (2023-05-08)
15
+
16
+ **Note:** Version bump only for package @nymphjs/sorter
17
+
18
+ # [1.0.0-beta.28](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.27...v1.0.0-beta.28) (2023-05-05)
19
+
20
+ **Note:** Version bump only for package @nymphjs/sorter
21
+
22
+ # [1.0.0-beta.27](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.26...v1.0.0-beta.27) (2023-05-04)
23
+
24
+ **Note:** Version bump only for package @nymphjs/sorter
25
+
26
+ # [1.0.0-beta.26](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.25...v1.0.0-beta.26) (2023-05-04)
27
+
28
+ ### Features
29
+
30
+ - update packages and migrate to mysql2 ([72ad611](https://github.com/sciactive/nymphjs/commit/72ad611bd2bf7bf85c3ba8a3486503d9b50c49d6))
31
+
32
+ # [1.0.0-beta.25](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.24...v1.0.0-beta.25) (2023-05-04)
33
+
34
+ **Note:** Version bump only for package @nymphjs/sorter
35
+
36
+ # [1.0.0-beta.24](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.23...v1.0.0-beta.24) (2023-05-02)
37
+
38
+ **Note:** Version bump only for package @nymphjs/sorter
39
+
40
+ # [1.0.0-beta.23](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.22...v1.0.0-beta.23) (2023-05-02)
41
+
42
+ **Note:** Version bump only for package @nymphjs/sorter
43
+
44
+ # [1.0.0-beta.22](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2023-05-01)
45
+
46
+ **Note:** Version bump only for package @nymphjs/sorter
47
+
48
+ # [1.0.0-beta.21](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2023-05-01)
49
+
50
+ **Note:** Version bump only for package @nymphjs/sorter
51
+
52
+ # [1.0.0-beta.20](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2023-04-30)
53
+
54
+ **Note:** Version bump only for package @nymphjs/sorter
55
+
56
+ # [1.0.0-beta.19](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2023-04-29)
57
+
58
+ **Note:** Version bump only for package @nymphjs/sorter
59
+
60
+ # [1.0.0-beta.18](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2023-04-27)
61
+
62
+ **Note:** Version bump only for package @nymphjs/sorter
63
+
64
+ # [1.0.0-beta.17](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2023-04-24)
65
+
66
+ **Note:** Version bump only for package @nymphjs/sorter
67
+
68
+ # [1.0.0-beta.16](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2023-03-31)
69
+
70
+ **Note:** Version bump only for package @nymphjs/sorter
71
+
72
+ # [1.0.0-beta.15](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2023-03-23)
73
+
74
+ **Note:** Version bump only for package @nymphjs/sorter
75
+
76
+ # [1.0.0-beta.14](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2023-03-17)
77
+
78
+ **Note:** Version bump only for package @nymphjs/sorter
79
+
80
+ # [1.0.0-beta.13](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2023-03-16)
81
+
82
+ **Note:** Version bump only for package @nymphjs/sorter
83
+
84
+ # [1.0.0-beta.12](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2023-03-04)
85
+
86
+ **Note:** Version bump only for package @nymphjs/sorter
87
+
88
+ # [1.0.0-beta.11](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2023-02-27)
89
+
90
+ **Note:** Version bump only for package @nymphjs/sorter
91
+
92
+ # [1.0.0-beta.10](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2023-01-19)
93
+
94
+ **Note:** Version bump only for package @nymphjs/sorter
95
+
96
+ # [1.0.0-beta.9](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2023-01-09)
97
+
98
+ **Note:** Version bump only for package @nymphjs/sorter
99
+
100
+ # [1.0.0-beta.8](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.7...v1.0.0-beta.8) (2023-01-09)
101
+
102
+ **Note:** Version bump only for package @nymphjs/sorter
103
+
104
+ # [1.0.0-beta.7](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.6...v1.0.0-beta.7) (2023-01-05)
105
+
106
+ **Note:** Version bump only for package @nymphjs/sorter
107
+
108
+ # [1.0.0-beta.6](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.5...v1.0.0-beta.6) (2023-01-05)
109
+
110
+ **Note:** Version bump only for package @nymphjs/sorter
111
+
112
+ # [1.0.0-beta.5](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-11-24)
113
+
114
+ **Note:** Version bump only for package @nymphjs/sorter
115
+
116
+ # [1.0.0-beta.4](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-11-23)
117
+
118
+ **Note:** Version bump only for package @nymphjs/sorter
119
+
6
120
  # [1.0.0-beta.3](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-11-21)
7
121
 
8
122
  **Note:** Version bump only for package @nymphjs/sorter
package/README.md CHANGED
@@ -18,7 +18,7 @@ Here's an overview:
18
18
  import { Nymph } from '@nymphjs/nymph';
19
19
  // or
20
20
  import { Nymph } from '@nymphjs/client';
21
- import Page from 'Page';
21
+ import PageClass from 'Page';
22
22
 
23
23
  import { Sorter } from '@nymphjs/sorter';
24
24
 
@@ -26,7 +26,7 @@ const nymphOptions = {
26
26
  // the options for your Nymph instance.
27
27
  };
28
28
  const nymph = new Nymph(nymphOptions);
29
- nymph.addEntityClass(Page);
29
+ const Page = nymph.addEntityClass(PageClass);
30
30
 
31
31
  let pages = await nymph.getEntities({ class: Page });
32
32
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,mBAAqBD,IAE7BD,EAAK,mBAAqBC,IAR5B,CASGK,MAAM,I,sCCRTC,OAAOC,eAAeN,EAAS,aAAc,CAAEO,OAAO,IA6ItDP,EAAA,QA5IA,MACIQ,YAAYC,GACRL,KAAKM,aAAe,KACpBN,KAAKO,WAAa,KAClBP,KAAKQ,SAAW,IAAIC,KAAKC,SACzBV,KAAKW,gBAAaC,EAClBZ,KAAKK,MAAQA,EAEjBQ,mBAAmBC,EAAGC,GAClB,MAAMC,EAAOhB,KAAKM,aACZW,EAASjB,KAAKO,WACpB,GAAc,MAA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eH,EAAyBE,GAC5C,QAAqB/D,IAAjBgE,EACH,OAAOA,EAAahF,QAGrB,IAAIC,EAAS4E,EAAyBE,GAAY,CAGjD/E,QAAS,IAOV,OAHAiF,EAAoBF,GAAUR,KAAKtE,EAAOD,QAASC,EAAQA,EAAOD,QAAS8E,GAGpE7E,EAAOD,QClBW8E,CAAoB,M","sources":["webpack://@nymphjs/sorter/webpack/universalModuleDefinition","webpack://@nymphjs/sorter/./lib/Sorter.js","webpack://@nymphjs/sorter/./lib/index.js","webpack://@nymphjs/sorter/webpack/bootstrap","webpack://@nymphjs/sorter/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@nymphjs/sorter\"] = factory();\n\telse\n\t\troot[\"@nymphjs/sorter\"] = factory();\n})(this, () => {\nreturn ","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Sorter {\n constructor(array) {\n this.sortProperty = null;\n this.sortParent = null;\n this.collator = new Intl.Collator();\n this.comparator = undefined;\n this.array = array;\n }\n _arraySortProperty(a, b) {\n const prop = this.sortProperty;\n const parent = this.sortParent;\n if (parent != null &&\n a[parent] instanceof Object &&\n b[parent] instanceof Object) {\n const aParentProp = a[parent][prop];\n const bParentProp = b[parent][prop];\n if (typeof aParentProp !== 'undefined' ||\n typeof bParentProp !== 'undefined') {\n if (this.comparator != null) {\n const result = this.comparator(aParentProp, bParentProp);\n if (result !== 0) {\n return result;\n }\n }\n else if (typeof aParentProp === 'string' &&\n typeof bParentProp === 'string') {\n const result = this.collator.compare(aParentProp, bParentProp);\n if (result !== 0) {\n return result;\n }\n }\n else if (aParentProp > bParentProp) {\n return 1;\n }\n else if (aParentProp < bParentProp) {\n return -1;\n }\n }\n }\n const aProp = a[prop];\n const bProp = b[prop];\n if (this.comparator != null) {\n return this.comparator(aProp, bProp);\n }\n else if (typeof aProp === 'string' && typeof bProp === 'string') {\n return this.collator.compare(aProp, bProp);\n }\n else if (aProp > bProp) {\n return 1;\n }\n else if (aProp < bProp) {\n return -1;\n }\n return 0;\n }\n hsort(property, parentProperty, sortOptions) {\n this.sort(property, sortOptions);\n if (typeof parentProperty === 'undefined' || parentProperty === null) {\n return this.array;\n }\n let newArray = [];\n let changed;\n while (this.array.length) {\n changed = false;\n for (let key = 0; key < this.array.length; key++) {\n if (!(parentProperty in this.array[key]) ||\n this.array[key][parentProperty] == null ||\n typeof this.array[key][parentProperty].$inArray !== 'function' ||\n !this.array[key][parentProperty].$inArray([\n ...newArray,\n ...this.array,\n ])) {\n newArray.push(this.array[key]);\n this.array.splice(key, 1);\n changed = true;\n break;\n }\n else if (typeof this.array[key][parentProperty].$arraySearch === 'function') {\n const pkey = this.array[key][parentProperty].$arraySearch(newArray);\n if (pkey !== -1) {\n const ancestry = [this.array[key][parentProperty].guid];\n let newKey = pkey;\n while (newKey + 1 < newArray.length &&\n parentProperty in newArray[newKey + 1] &&\n newArray[newKey + 1][parentProperty] != null &&\n ancestry.indexOf(newArray[newKey + 1][parentProperty].guid) !== -1) {\n ancestry.push(newArray[newKey + 1].guid);\n newKey += 1;\n }\n newKey += 1;\n if (newKey < newArray.length) {\n newArray.splice(newKey, 0, this.array[key]);\n }\n else {\n newArray.push(this.array[key]);\n }\n this.array.splice(key, 1);\n changed = true;\n break;\n }\n }\n }\n if (!changed) {\n if (this.array.length) {\n newArray = newArray.concat(this.array);\n this.array.splice(0, this.array.length);\n }\n }\n }\n this.array.splice(0, 0, ...newArray);\n return this.array;\n }\n psort(property, parentProperty, { caseSensitive = false, reverse = false, collatorOptions = undefined, comparator = undefined, } = {}) {\n this.sortProperty = property;\n this.sortParent = parentProperty;\n this.collator = new Intl.Collator(undefined, collatorOptions || {\n sensitivity: caseSensitive ? 'case' : 'base',\n caseFirst: 'false',\n });\n this.comparator = comparator;\n this.array.sort(this._arraySortProperty.bind(this));\n if (reverse) {\n this.array.reverse();\n }\n return this.array;\n }\n sort(property, { caseSensitive = false, reverse = false, collatorOptions = undefined, comparator = undefined, } = {}) {\n this.sortProperty = property;\n this.sortParent = null;\n this.collator = new Intl.Collator(undefined, collatorOptions || {\n sensitivity: caseSensitive ? 'case' : 'base',\n });\n this.comparator = comparator;\n this.array.sort(this._arraySortProperty.bind(this));\n if (reverse) {\n this.array.reverse();\n }\n return this.array;\n }\n}\nexports.default = Sorter;\n//# sourceMappingURL=Sorter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sorter = void 0;\n__exportStar(require(\"./Sorter\"), exports);\nconst Sorter_1 = __importDefault(require(\"./Sorter\"));\nexports.Sorter = Sorter_1.default;\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(568);\n"],"names":["root","factory","exports","module","define","amd","this","Object","defineProperty","value","constructor","array","sortProperty","sortParent","collator","Intl","Collator","comparator","undefined","_arraySortProperty","a","b","prop","parent","aParentProp","bParentProp","result","compare","aProp","bProp","hsort","property","parentProperty","sortOptions","sort","changed","newArray","length","key","$inArray","push","splice","$arraySearch","pkey","ancestry","guid","newKey","indexOf","concat","psort","caseSensitive","reverse","collatorOptions","sensitivity","caseFirst","bind","__createBinding","create","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","p","prototype","hasOwnProperty","call","__importDefault","mod","Sorter","Sorter_1","default","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
1
+ {"version":3,"file":"index.js","mappings":"CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAQ,mBAAqBD,IAE7BD,EAAK,mBAAqBC,GAC3B,CATD,CASGK,MAAM,I,sCCRTC,OAAOC,eAAeN,EAAS,aAAc,CAAEO,OAAO,IA6ItDP,EAAA,QA5IA,MACIQ,YAAYC,GACRL,KAAKM,aAAe,KACpBN,KAAKO,WAAa,KAClBP,KAAKQ,SAAW,IAAIC,KAAKC,SACzBV,KAAKW,gBAAaC,EAClBZ,KAAKK,MAAQA,CACjB,CACAQ,mBAAmBC,EAAGC,GAClB,MAAMC,EAAOhB,KAAKM,aACZW,EAASjB,KAAKO,WACpB,GAAc,MAAVU,GACAH,EAAEG,aAAmBhB,QACrBc,EAAEE,aAAmBhB,OAAQ,CAC7B,M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OAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqB/D,IAAjBgE,EACH,OAAOA,EAAahF,QAGrB,IAAIC,EAAS4E,EAAyBE,GAAY,CAGjD/E,QAAS,CAAC,GAOX,OAHAiF,EAAoBF,GAAUR,KAAKtE,EAAOD,QAASC,EAAQA,EAAOD,QAAS8E,GAGpE7E,EAAOD,OACf,CCnB0B8E,CAAoB,I","sources":["webpack://@nymphjs/sorter/webpack/universalModuleDefinition","webpack://@nymphjs/sorter/./lib/Sorter.js","webpack://@nymphjs/sorter/./lib/index.js","webpack://@nymphjs/sorter/webpack/bootstrap","webpack://@nymphjs/sorter/webpack/startup"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"@nymphjs/sorter\"] = factory();\n\telse\n\t\troot[\"@nymphjs/sorter\"] = factory();\n})(this, () => {\nreturn ","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Sorter {\n constructor(array) {\n this.sortProperty = null;\n this.sortParent = null;\n this.collator = new Intl.Collator();\n this.comparator = undefined;\n this.array = array;\n }\n _arraySortProperty(a, b) {\n const prop = this.sortProperty;\n const parent = this.sortParent;\n if (parent != null &&\n a[parent] instanceof Object &&\n b[parent] instanceof Object) {\n const aParentProp = a[parent][prop];\n const bParentProp = b[parent][prop];\n if (typeof aParentProp !== 'undefined' ||\n typeof bParentProp !== 'undefined') {\n if (this.comparator != null) {\n const result = this.comparator(aParentProp, bParentProp);\n if (result !== 0) {\n return result;\n }\n }\n else if (typeof aParentProp === 'string' &&\n typeof bParentProp === 'string') {\n const result = this.collator.compare(aParentProp, bParentProp);\n if (result !== 0) {\n return result;\n }\n }\n else if (aParentProp > bParentProp) {\n return 1;\n }\n else if (aParentProp < bParentProp) {\n return -1;\n }\n }\n }\n const aProp = a[prop];\n const bProp = b[prop];\n if (this.comparator != null) {\n return this.comparator(aProp, bProp);\n }\n else if (typeof aProp === 'string' && typeof bProp === 'string') {\n return this.collator.compare(aProp, bProp);\n }\n else if (aProp > bProp) {\n return 1;\n }\n else if (aProp < bProp) {\n return -1;\n }\n return 0;\n }\n hsort(property, parentProperty, sortOptions) {\n this.sort(property, sortOptions);\n if (typeof parentProperty === 'undefined' || parentProperty === null) {\n return this.array;\n }\n let newArray = [];\n let changed;\n while (this.array.length) {\n changed = false;\n for (let key = 0; key < this.array.length; key++) {\n if (!(parentProperty in this.array[key]) ||\n this.array[key][parentProperty] == null ||\n typeof this.array[key][parentProperty].$inArray !== 'function' ||\n !this.array[key][parentProperty].$inArray([\n ...newArray,\n ...this.array,\n ])) {\n newArray.push(this.array[key]);\n this.array.splice(key, 1);\n changed = true;\n break;\n }\n else if (typeof this.array[key][parentProperty].$arraySearch === 'function') {\n const pkey = this.array[key][parentProperty].$arraySearch(newArray);\n if (pkey !== -1) {\n const ancestry = [this.array[key][parentProperty].guid];\n let newKey = pkey;\n while (newKey + 1 < newArray.length &&\n parentProperty in newArray[newKey + 1] &&\n newArray[newKey + 1][parentProperty] != null &&\n ancestry.indexOf(newArray[newKey + 1][parentProperty].guid) !== -1) {\n ancestry.push(newArray[newKey + 1].guid);\n newKey += 1;\n }\n newKey += 1;\n if (newKey < newArray.length) {\n newArray.splice(newKey, 0, this.array[key]);\n }\n else {\n newArray.push(this.array[key]);\n }\n this.array.splice(key, 1);\n changed = true;\n break;\n }\n }\n }\n if (!changed) {\n if (this.array.length) {\n newArray = newArray.concat(this.array);\n this.array.splice(0, this.array.length);\n }\n }\n }\n this.array.splice(0, 0, ...newArray);\n return this.array;\n }\n psort(property, parentProperty, { caseSensitive = false, reverse = false, collatorOptions = undefined, comparator = undefined, } = {}) {\n this.sortProperty = property;\n this.sortParent = parentProperty;\n this.collator = new Intl.Collator(undefined, collatorOptions || {\n sensitivity: caseSensitive ? 'case' : 'base',\n caseFirst: 'false',\n });\n this.comparator = comparator;\n this.array.sort(this._arraySortProperty.bind(this));\n if (reverse) {\n this.array.reverse();\n }\n return this.array;\n }\n sort(property, { caseSensitive = false, reverse = false, collatorOptions = undefined, comparator = undefined, } = {}) {\n this.sortProperty = property;\n this.sortParent = null;\n this.collator = new Intl.Collator(undefined, collatorOptions || {\n sensitivity: caseSensitive ? 'case' : 'base',\n });\n this.comparator = comparator;\n this.array.sort(this._arraySortProperty.bind(this));\n if (reverse) {\n this.array.reverse();\n }\n return this.array;\n }\n}\nexports.default = Sorter;\n//# sourceMappingURL=Sorter.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sorter = void 0;\n__exportStar(require(\"./Sorter\"), exports);\nconst Sorter_1 = __importDefault(require(\"./Sorter\"));\nexports.Sorter = Sorter_1.default;\n//# sourceMappingURL=index.js.map","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n// This entry module is referenced by other modules so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(568);\n"],"names":["root","factory","exports","module","define","amd","this","Object","defineProperty","value","constructor","array","sortProperty","sortParent","collator","Intl","Collator","comparator","undefined","_arraySortProperty","a","b","prop","parent","aParentProp","bParentProp","result","compare","aProp","bProp","hsort","property","parentProperty","sortOptions","sort","changed","newArray","length","key","$inArray","push","splice","$arraySearch","pkey","ancestry","guid","newKey","indexOf","concat","psort","caseSensitive","reverse","collatorOptions","sensitivity","caseFirst","bind","__createBinding","create","o","m","k","k2","desc","getOwnPropertyDescriptor","__esModule","writable","configurable","enumerable","get","__exportStar","p","prototype","hasOwnProperty","call","__importDefault","mod","Sorter","Sorter_1","default","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__"],"sourceRoot":""}
@@ -19,6 +19,6 @@ class TestModel {
19
19
  return -1;
20
20
  }
21
21
  }
22
- exports.TestModel = TestModel;
23
22
  TestModel.class = 'TestModel';
23
+ exports.TestModel = TestModel;
24
24
  //# sourceMappingURL=testArtifacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"testArtifacts.js","sourceRoot":"","sources":["../src/testArtifacts.ts"],"names":[],"mappings":";;;AAAA,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,MAAa,SAAS;IAQpB;QACE,IAAI,CAAC,IAAI,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,KAAkB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,YAAY,CAAC,KAAkB;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;gBAC3C,OAAO,CAAC,CAAC;aACV;SACF;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;;AAxBH,8BAyBC;AAxBQ,eAAK,GAAG,WAAW,CAAC"}
1
+ {"version":3,"file":"testArtifacts.js","sourceRoot":"","sources":["../src/testArtifacts.ts"],"names":[],"mappings":";;;AAAA,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,MAAa,SAAS;IAQpB;QACE,IAAI,CAAC,IAAI,GAAG,OAAO,GAAG,OAAO,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,QAAQ,CAAC,KAAkB;QACzB,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,YAAY,CAAC,KAAkB;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,EAAE;gBAC3C,OAAO,CAAC,CAAC;aACV;SACF;QACD,OAAO,CAAC,CAAC,CAAC;IACZ,CAAC;;AAvBM,eAAK,GAAG,WAAW,CAAC;AADhB,8BAAS"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/sorter",
3
- "version": "1.0.0-beta.3",
3
+ "version": "1.0.0-beta.31",
4
4
  "description": "NymphJS - Sorter",
5
5
  "browser": "dist/index.js",
6
6
  "main": "lib/index.js",
@@ -36,16 +36,16 @@
36
36
  },
37
37
  "license": "Apache-2.0",
38
38
  "devDependencies": {
39
- "@tsconfig/recommended": "^1.0.1",
40
- "@types/jest": "^29.2.3",
41
- "@types/lodash": "^4.14.189",
42
- "jest": "^29.3.1",
39
+ "@tsconfig/recommended": "^1.0.2",
40
+ "@types/jest": "^29.5.1",
41
+ "@types/lodash": "^4.14.194",
42
+ "jest": "^29.5.0",
43
43
  "lodash": "^4.17.21",
44
- "ts-jest": "^29.0.3",
45
- "ts-loader": "^9.4.1",
46
- "typescript": "^4.9.3",
47
- "webpack": "^5.75.0",
48
- "webpack-cli": "^4.10.0"
44
+ "ts-jest": "^29.1.0",
45
+ "ts-loader": "^9.4.2",
46
+ "typescript": "^5.0.4",
47
+ "webpack": "^5.82.0",
48
+ "webpack-cli": "^5.0.2"
49
49
  },
50
- "gitHead": "7270586be5b2b03fa42d98791a91d0f51c5fd299"
50
+ "gitHead": "6d8e60ce1cb96582d53bb37116eb17849c214150"
51
51
  }