@teambit/objects 0.0.479 → 0.0.480
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _chai() {
|
|
4
|
+
const data = require("chai");
|
|
5
|
+
_chai = function () {
|
|
6
|
+
return data;
|
|
7
|
+
};
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
function _laneHistory() {
|
|
11
|
+
const data = require("./lane-history");
|
|
12
|
+
_laneHistory = function () {
|
|
13
|
+
return data;
|
|
14
|
+
};
|
|
15
|
+
return data;
|
|
16
|
+
}
|
|
17
|
+
const makeItem = date => ({
|
|
18
|
+
log: {
|
|
19
|
+
date,
|
|
20
|
+
username: 'tester'
|
|
21
|
+
},
|
|
22
|
+
components: []
|
|
23
|
+
});
|
|
24
|
+
describe('LaneHistory', () => {
|
|
25
|
+
describe('getHistoryIds', () => {
|
|
26
|
+
it('returns ids sorted by date even when insertion order is not chronological', () => {
|
|
27
|
+
const laneHistory = _laneHistory().LaneHistory.parse(JSON.stringify({
|
|
28
|
+
name: 'tmp4',
|
|
29
|
+
scope: 'my-scope',
|
|
30
|
+
laneHash: 'abc',
|
|
31
|
+
history: {
|
|
32
|
+
'newer-local': makeItem('1746369091000'),
|
|
33
|
+
// 5/4/2026, 12:51 PM
|
|
34
|
+
'older-remote-1': makeItem('1746127977000'),
|
|
35
|
+
// 5/1/2026, 3:32 PM
|
|
36
|
+
'older-remote-2': makeItem('1746127986000'),
|
|
37
|
+
// 5/1/2026, 3:33 PM
|
|
38
|
+
'between-remote': makeItem('1746358729000') // 5/4/2026, 9:58 AM
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
(0, _chai().expect)(laneHistory.getHistoryIds()).to.deep.equal(['older-remote-1', 'older-remote-2', 'between-remote', 'newer-local']);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=lane-history.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_chai","data","require","_laneHistory","makeItem","date","log","username","components","describe","it","laneHistory","LaneHistory","parse","JSON","stringify","name","scope","laneHash","history","expect","getHistoryIds","to","deep","equal"],"sources":["lane-history.spec.ts"],"sourcesContent":["import { expect } from 'chai';\n\nimport { LaneHistory } from './lane-history';\n\nconst makeItem = (date: string) => ({\n log: { date, username: 'tester' },\n components: [],\n});\n\ndescribe('LaneHistory', () => {\n describe('getHistoryIds', () => {\n it('returns ids sorted by date even when insertion order is not chronological', () => {\n const laneHistory = LaneHistory.parse(\n JSON.stringify({\n name: 'tmp4',\n scope: 'my-scope',\n laneHash: 'abc',\n history: {\n 'newer-local': makeItem('1746369091000'), // 5/4/2026, 12:51 PM\n 'older-remote-1': makeItem('1746127977000'), // 5/1/2026, 3:32 PM\n 'older-remote-2': makeItem('1746127986000'), // 5/1/2026, 3:33 PM\n 'between-remote': makeItem('1746358729000'), // 5/4/2026, 9:58 AM\n },\n })\n );\n\n expect(laneHistory.getHistoryIds()).to.deep.equal([\n 'older-remote-1',\n 'older-remote-2',\n 'between-remote',\n 'newer-local',\n ]);\n });\n });\n});\n"],"mappings":";;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,aAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAMG,QAAQ,GAAIC,IAAY,KAAM;EAClCC,GAAG,EAAE;IAAED,IAAI;IAAEE,QAAQ,EAAE;EAAS,CAAC;EACjCC,UAAU,EAAE;AACd,CAAC,CAAC;AAEFC,QAAQ,CAAC,aAAa,EAAE,MAAM;EAC5BA,QAAQ,CAAC,eAAe,EAAE,MAAM;IAC9BC,EAAE,CAAC,2EAA2E,EAAE,MAAM;MACpF,MAAMC,WAAW,GAAGC,0BAAW,CAACC,KAAK,CACnCC,IAAI,CAACC,SAAS,CAAC;QACbC,IAAI,EAAE,MAAM;QACZC,KAAK,EAAE,UAAU;QACjBC,QAAQ,EAAE,KAAK;QACfC,OAAO,EAAE;UACP,aAAa,EAAEf,QAAQ,CAAC,eAAe,CAAC;UAAE;UAC1C,gBAAgB,EAAEA,QAAQ,CAAC,eAAe,CAAC;UAAE;UAC7C,gBAAgB,EAAEA,QAAQ,CAAC,eAAe,CAAC;UAAE;UAC7C,gBAAgB,EAAEA,QAAQ,CAAC,eAAe,CAAC,CAAE;QAC/C;MACF,CAAC,CACH,CAAC;MAED,IAAAgB,cAAM,EAACT,WAAW,CAACU,aAAa,CAAC,CAAC,CAAC,CAACC,EAAE,CAACC,IAAI,CAACC,KAAK,CAAC,CAChD,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,aAAa,CACd,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { expect } from 'chai';
|
|
2
|
+
|
|
3
|
+
import { LaneHistory } from './lane-history';
|
|
4
|
+
|
|
5
|
+
const makeItem = (date: string) => ({
|
|
6
|
+
log: { date, username: 'tester' },
|
|
7
|
+
components: [],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
describe('LaneHistory', () => {
|
|
11
|
+
describe('getHistoryIds', () => {
|
|
12
|
+
it('returns ids sorted by date even when insertion order is not chronological', () => {
|
|
13
|
+
const laneHistory = LaneHistory.parse(
|
|
14
|
+
JSON.stringify({
|
|
15
|
+
name: 'tmp4',
|
|
16
|
+
scope: 'my-scope',
|
|
17
|
+
laneHash: 'abc',
|
|
18
|
+
history: {
|
|
19
|
+
'newer-local': makeItem('1746369091000'), // 5/4/2026, 12:51 PM
|
|
20
|
+
'older-remote-1': makeItem('1746127977000'), // 5/1/2026, 3:32 PM
|
|
21
|
+
'older-remote-2': makeItem('1746127986000'), // 5/1/2026, 3:33 PM
|
|
22
|
+
'between-remote': makeItem('1746358729000'), // 5/4/2026, 9:58 AM
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
expect(laneHistory.getHistoryIds()).to.deep.equal([
|
|
28
|
+
'older-remote-1',
|
|
29
|
+
'older-remote-2',
|
|
30
|
+
'between-remote',
|
|
31
|
+
'newer-local',
|
|
32
|
+
]);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teambit/objects",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.480",
|
|
4
4
|
"homepage": "https://bit.cloud/teambit/scope/objects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"componentId": {
|
|
7
7
|
"scope": "teambit.scope",
|
|
8
8
|
"name": "objects",
|
|
9
|
-
"version": "0.0.
|
|
9
|
+
"version": "0.0.480"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@pnpm/dependency-path": "1001.1.10",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@teambit/toolbox.promise.map-pool": "0.0.14",
|
|
51
51
|
"@teambit/harmony.modules.in-memory-cache": "0.0.30",
|
|
52
52
|
"@teambit/toolbox.fs.remove-empty-dir": "0.0.13",
|
|
53
|
-
"@teambit/graph": "1.0.
|
|
53
|
+
"@teambit/graph": "1.0.973"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/semver": "7.5.8",
|
|
File without changes
|