@unchainedshop/core-currencies 3.1.1 → 3.1.5
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/lib/db/CurrenciesCollection.d.ts.map +1 -1
- package/lib/module/configureCurrenciesModule.d.ts.map +1 -1
- package/package.json +4 -5
- package/src/module/buildFindSelector.test.ts +17 -13
- package/jest.config.js +0 -17
- package/lib/db/CurrenciesSchema.d.ts +0 -3
- package/lib/db/CurrenciesSchema.d.ts.map +0 -1
- package/lib/db/CurrenciesSchema.js +0 -10
- package/lib/db/CurrenciesSchema.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrenciesCollection.d.ts","sourceRoot":"","sources":["../../src/db/CurrenciesCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAElF,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"CurrenciesCollection.d.ts","sourceRoot":"","sources":["../../src/db/CurrenciesCollection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAkB,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAElF,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,eAAe,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAU,IAAI,OAAO,CAAC,EAAE,0CAuBxD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureCurrenciesModule.d.ts","sourceRoot":"","sources":["../../src/module/configureCurrenciesModule.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAiB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAwB,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9F,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"configureCurrenciesModule.d.ts","sourceRoot":"","sources":["../../src/module/configureCurrenciesModule.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,WAAW,EACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAiB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAAwB,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAI9F,eAAO,MAAM,iBAAiB,GAAI,oDAI/B,aAAa;eACe,IAAI;aAAW,IAAI;sBAAoB,MAAM;YAAU,GAAG;CAOxF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,QAAQ,WAAW,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;6CASnF;QACD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAG,OAAO,CAAC,QAAQ,CAAC;wDASlB,aAAa,GAAG;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;KAC1B,KAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;mBAUP,aAAa;qCAKK;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE;kBAUzC,QAAQ;yBAaD,MAAM,OAAO,OAAO,CAAC,QAAQ,CAAC;yBAY9B,MAAM;EAapC,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unchainedshop/core-currencies",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"main": "lib/currencies-index.js",
|
|
5
5
|
"types": "lib/currencies-index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"build": "tsc -b",
|
|
10
10
|
"prepublishOnly": "npm run clean && npm run build",
|
|
11
11
|
"watch": "tsc -w",
|
|
12
|
-
"test": "
|
|
13
|
-
"test:watch": "
|
|
12
|
+
"test": "tsx --test",
|
|
13
|
+
"test:watch": "tsx --test --watch"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^22.13.4",
|
|
39
|
-
"
|
|
40
|
-
"ts-jest": "^29.2.5",
|
|
39
|
+
"tsx": "^4.19.2",
|
|
41
40
|
"typescript": "^5.7.3"
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -1,32 +1,36 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
1
3
|
import { buildFindSelector } from './configureCurrenciesModule.js';
|
|
2
4
|
|
|
3
5
|
describe('buildFindSelector', () => {
|
|
4
6
|
it('should return correct filter object', () => {
|
|
5
|
-
|
|
7
|
+
assert.deepStrictEqual(
|
|
6
8
|
buildFindSelector({
|
|
7
9
|
contractAddress: '0xf12EC0F79a8855d093DeCe22b24c0603f5b8E34A',
|
|
8
10
|
includeInactive: true,
|
|
9
11
|
queryString: 'hello world',
|
|
10
12
|
}),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
{
|
|
14
|
+
deleted: null,
|
|
15
|
+
contractAddress: '0xf12EC0F79a8855d093DeCe22b24c0603f5b8E34A',
|
|
16
|
+
$text: { $search: 'hello world' },
|
|
17
|
+
},
|
|
18
|
+
);
|
|
19
|
+
assert.deepStrictEqual(
|
|
17
20
|
buildFindSelector({
|
|
18
21
|
contractAddress: '0xf12EC0F79a8855d093DeCe22b24c0603f5b8E34A',
|
|
19
22
|
includeInactive: true,
|
|
20
23
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
{
|
|
25
|
+
deleted: null,
|
|
26
|
+
contractAddress: '0xf12EC0F79a8855d093DeCe22b24c0603f5b8E34A',
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
assert.deepStrictEqual(buildFindSelector({ includeInactive: true, queryString: 'hello world' }), {
|
|
26
30
|
deleted: null,
|
|
27
31
|
$text: { $search: 'hello world' },
|
|
28
32
|
});
|
|
29
|
-
|
|
33
|
+
assert.deepStrictEqual(buildFindSelector({ queryString: 'hello world' }), {
|
|
30
34
|
deleted: null,
|
|
31
35
|
isActive: true,
|
|
32
36
|
$text: { $search: 'hello world' },
|
package/jest.config.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
|
|
2
|
-
export default {
|
|
3
|
-
preset: 'ts-jest/presets/default-esm', // or other ESM presets
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
extensionsToTreatAsEsm: ['.ts'],
|
|
6
|
-
transform: {
|
|
7
|
-
'^.+\\.tsx?$': [
|
|
8
|
-
'ts-jest',
|
|
9
|
-
{
|
|
10
|
-
useESM: true,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
},
|
|
14
|
-
moduleNameMapper: {
|
|
15
|
-
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrenciesSchema.d.ts","sourceRoot":"","sources":["../../src/db/CurrenciesSchema.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,eAAO,MAAM,gBAAgB,cAS5B,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Schemas } from '@unchainedshop/utils';
|
|
2
|
-
import SimpleSchema from 'simpl-schema';
|
|
3
|
-
export const CurrenciesSchema = new SimpleSchema({
|
|
4
|
-
isoCode: { type: String, required: true },
|
|
5
|
-
isActive: Boolean,
|
|
6
|
-
contractAddress: { type: String, required: false },
|
|
7
|
-
decimals: { type: Number, required: false },
|
|
8
|
-
...Schemas.timestampFields,
|
|
9
|
-
}, { requiredByDefault: false });
|
|
10
|
-
//# sourceMappingURL=CurrenciesSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CurrenciesSchema.js","sourceRoot":"","sources":["../../src/db/CurrenciesSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,YAAY,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,YAAY,CAC9C;IACE,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE;IACzC,QAAQ,EAAE,OAAO;IACjB,eAAe,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAClD,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;IAC3C,GAAG,OAAO,CAAC,eAAe;CAC3B,EACD,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAC7B,CAAC"}
|