@syncular/core 0.0.1-72 → 0.0.1-83
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.js +3 -3
- package/dist/utils/id.d.ts +2 -0
- package/dist/utils/id.d.ts.map +1 -0
- package/dist/utils/id.js +8 -0
- package/dist/utils/id.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/object.d.ts +2 -0
- package/dist/utils/object.d.ts.map +1 -0
- package/dist/utils/object.js +4 -0
- package/dist/utils/object.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/utils.test.ts +27 -0
- package/src/index.ts +2 -0
- package/src/utils/id.ts +7 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/object.ts +3 -0
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,SAAS,CAAC;AAExB,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,UAAU,CAAC;AAEzB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAE7B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,cAAc,SAAS,CAAC;AAExB,cAAc,YAAY,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,UAAU,CAAC;AAEzB,cAAc,SAAS,CAAC;AAExB,cAAc,WAAW,CAAC;AAE1B,cAAc,UAAU,CAAC;AAEzB,cAAc,cAAc,CAAC;AAE7B,cAAc,SAAS,CAAC;AAExB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,21 +10,23 @@
|
|
|
10
10
|
* - Zod schemas for runtime validation and OpenAPI
|
|
11
11
|
*/
|
|
12
12
|
// Blob transport/storage types and utilities (protocol types come from ./schemas)
|
|
13
|
-
export * from './blobs';
|
|
13
|
+
export * from './blobs.js';
|
|
14
14
|
// Conflict detection utilities
|
|
15
|
-
export * from './conflict';
|
|
15
|
+
export * from './conflict.js';
|
|
16
16
|
// Kysely plugin utilities
|
|
17
|
-
export * from './kysely-serialize';
|
|
17
|
+
export * from './kysely-serialize.js';
|
|
18
18
|
// Logging utilities
|
|
19
|
-
export * from './logger';
|
|
19
|
+
export * from './logger.js';
|
|
20
20
|
// Proxy protocol types
|
|
21
|
-
export * from './proxy';
|
|
21
|
+
export * from './proxy/index.js';
|
|
22
22
|
// Schemas (Zod)
|
|
23
|
-
export * from './schemas';
|
|
23
|
+
export * from './schemas/index.js';
|
|
24
24
|
// Scope types, patterns, and utilities
|
|
25
|
-
export * from './scopes';
|
|
25
|
+
export * from './scopes/index.js';
|
|
26
26
|
// Data transformation hooks
|
|
27
|
-
export * from './transforms';
|
|
27
|
+
export * from './transforms.js';
|
|
28
28
|
// Transport and conflict types (protocol types come from ./schemas)
|
|
29
|
-
export * from './types';
|
|
29
|
+
export * from './types.js';
|
|
30
|
+
// Shared runtime utilities
|
|
31
|
+
export * from './utils/index.js';
|
|
30
32
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,kFAAkF;AAClF,cAAc,SAAS,CAAC;AACxB,+BAA+B;AAC/B,cAAc,YAAY,CAAC;AAC3B,0BAA0B;AAC1B,cAAc,oBAAoB,CAAC;AACnC,oBAAoB;AACpB,cAAc,UAAU,CAAC;AACzB,uBAAuB;AACvB,cAAc,SAAS,CAAC;AACxB,gBAAgB;AAChB,cAAc,WAAW,CAAC;AAC1B,uCAAuC;AACvC,cAAc,UAAU,CAAC;AACzB,4BAA4B;AAC5B,cAAc,cAAc,CAAC;AAC7B,oEAAoE;AACpE,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,kFAAkF;AAClF,cAAc,SAAS,CAAC;AACxB,+BAA+B;AAC/B,cAAc,YAAY,CAAC;AAC3B,0BAA0B;AAC1B,cAAc,oBAAoB,CAAC;AACnC,oBAAoB;AACpB,cAAc,UAAU,CAAC;AACzB,uBAAuB;AACvB,cAAc,SAAS,CAAC;AACxB,gBAAgB;AAChB,cAAc,WAAW,CAAC;AAC1B,uCAAuC;AACvC,cAAc,UAAU,CAAC;AACzB,4BAA4B;AAC5B,cAAc,cAAc,CAAC;AAC7B,oEAAoE;AACpE,cAAc,SAAS,CAAC;AACxB,2BAA2B;AAC3B,cAAc,SAAS,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,IAAI,MAAM,CAMjC"}
|
package/dist/utils/id.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function randomId() {
|
|
2
|
+
const cryptoObj = globalThis.crypto;
|
|
3
|
+
if (cryptoObj && typeof cryptoObj.randomUUID === 'function') {
|
|
4
|
+
return cryptoObj.randomUUID();
|
|
5
|
+
}
|
|
6
|
+
return `${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../src/utils/id.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,GAAW;IACjC,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC;IACpC,IAAI,SAAS,IAAI,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;QAC5D,OAAO,SAAS,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAAA,CAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAEzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object.js","sourceRoot":"","sources":["../../src/utils/object.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,QAAQ,CAAC,KAAc,EAAoC;IACzE,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAAA,CAC7E"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { describe, expect, it } from 'bun:test';
|
|
2
|
+
import { isRecord, randomId } from '../utils';
|
|
3
|
+
|
|
4
|
+
describe('isRecord', () => {
|
|
5
|
+
it('returns true for plain objects', () => {
|
|
6
|
+
expect(isRecord({ a: 1 })).toBe(true);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
it('returns false for null and arrays', () => {
|
|
10
|
+
expect(isRecord(null)).toBe(false);
|
|
11
|
+
expect(isRecord([])).toBe(false);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
describe('randomId', () => {
|
|
16
|
+
it('returns a non-empty string id', () => {
|
|
17
|
+
const id = randomId();
|
|
18
|
+
expect(typeof id).toBe('string');
|
|
19
|
+
expect(id.length > 0).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('generates different ids across sequential calls', () => {
|
|
23
|
+
const first = randomId();
|
|
24
|
+
const second = randomId();
|
|
25
|
+
expect(first).not.toBe(second);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/index.ts
CHANGED
package/src/utils/id.ts
ADDED