@proseql/core 0.1.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/LICENSE +21 -0
- package/dist/errors/crud-errors.d.ts +98 -0
- package/dist/errors/crud-errors.d.ts.map +1 -0
- package/dist/errors/crud-errors.js +23 -0
- package/dist/errors/crud-errors.js.map +1 -0
- package/dist/errors/index.d.ts +16 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +12 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/migration-errors.d.ts +22 -0
- package/dist/errors/migration-errors.d.ts.map +1 -0
- package/dist/errors/migration-errors.js +14 -0
- package/dist/errors/migration-errors.js.map +1 -0
- package/dist/errors/plugin-errors.d.ts +15 -0
- package/dist/errors/plugin-errors.d.ts.map +1 -0
- package/dist/errors/plugin-errors.js +11 -0
- package/dist/errors/plugin-errors.js.map +1 -0
- package/dist/errors/query-errors.d.ts +31 -0
- package/dist/errors/query-errors.d.ts.map +1 -0
- package/dist/errors/query-errors.js +11 -0
- package/dist/errors/query-errors.js.map +1 -0
- package/dist/errors/storage-errors.d.ts +30 -0
- package/dist/errors/storage-errors.d.ts.map +1 -0
- package/dist/errors/storage-errors.js +11 -0
- package/dist/errors/storage-errors.js.map +1 -0
- package/dist/factories/crud-factory-with-relationships.d.ts +28 -0
- package/dist/factories/crud-factory-with-relationships.d.ts.map +1 -0
- package/dist/factories/crud-factory-with-relationships.js +8 -0
- package/dist/factories/crud-factory-with-relationships.js.map +1 -0
- package/dist/factories/crud-factory.d.ts +25 -0
- package/dist/factories/crud-factory.d.ts.map +1 -0
- package/dist/factories/crud-factory.js +8 -0
- package/dist/factories/crud-factory.js.map +1 -0
- package/dist/factories/database-effect.d.ts +241 -0
- package/dist/factories/database-effect.d.ts.map +1 -0
- package/dist/factories/database-effect.js +859 -0
- package/dist/factories/database-effect.js.map +1 -0
- package/dist/hooks/hook-runner.d.ts +60 -0
- package/dist/hooks/hook-runner.d.ts.map +1 -0
- package/dist/hooks/hook-runner.js +107 -0
- package/dist/hooks/hook-runner.js.map +1 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +110 -0
- package/dist/index.js.map +1 -0
- package/dist/indexes/index-lookup.d.ts +33 -0
- package/dist/indexes/index-lookup.d.ts.map +1 -0
- package/dist/indexes/index-lookup.js +180 -0
- package/dist/indexes/index-lookup.js.map +1 -0
- package/dist/indexes/index-manager.d.ts +118 -0
- package/dist/indexes/index-manager.d.ts.map +1 -0
- package/dist/indexes/index-manager.js +345 -0
- package/dist/indexes/index-manager.js.map +1 -0
- package/dist/indexes/search-index.d.ts +179 -0
- package/dist/indexes/search-index.d.ts.map +1 -0
- package/dist/indexes/search-index.js +405 -0
- package/dist/indexes/search-index.js.map +1 -0
- package/dist/migrations/migration-runner.d.ts +70 -0
- package/dist/migrations/migration-runner.d.ts.map +1 -0
- package/dist/migrations/migration-runner.js +271 -0
- package/dist/migrations/migration-runner.js.map +1 -0
- package/dist/migrations/migration-types.d.ts +63 -0
- package/dist/migrations/migration-types.d.ts.map +1 -0
- package/dist/migrations/migration-types.js +5 -0
- package/dist/migrations/migration-types.js.map +1 -0
- package/dist/operations/crud/create-with-relationships.d.ts +44 -0
- package/dist/operations/crud/create-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/create-with-relationships.js +483 -0
- package/dist/operations/crud/create-with-relationships.js.map +1 -0
- package/dist/operations/crud/create.d.ts +48 -0
- package/dist/operations/crud/create.d.ts.map +1 -0
- package/dist/operations/crud/create.js +333 -0
- package/dist/operations/crud/create.js.map +1 -0
- package/dist/operations/crud/delete-with-relationships.d.ts +63 -0
- package/dist/operations/crud/delete-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/delete-with-relationships.js +395 -0
- package/dist/operations/crud/delete-with-relationships.js.map +1 -0
- package/dist/operations/crud/delete.d.ts +58 -0
- package/dist/operations/crud/delete.d.ts.map +1 -0
- package/dist/operations/crud/delete.js +267 -0
- package/dist/operations/crud/delete.js.map +1 -0
- package/dist/operations/crud/unique-check.d.ts +114 -0
- package/dist/operations/crud/unique-check.d.ts.map +1 -0
- package/dist/operations/crud/unique-check.js +383 -0
- package/dist/operations/crud/unique-check.js.map +1 -0
- package/dist/operations/crud/update-with-relationships.d.ts +45 -0
- package/dist/operations/crud/update-with-relationships.d.ts.map +1 -0
- package/dist/operations/crud/update-with-relationships.js +516 -0
- package/dist/operations/crud/update-with-relationships.js.map +1 -0
- package/dist/operations/crud/update.d.ts +91 -0
- package/dist/operations/crud/update.d.ts.map +1 -0
- package/dist/operations/crud/update.js +505 -0
- package/dist/operations/crud/update.js.map +1 -0
- package/dist/operations/crud/upsert.d.ts +52 -0
- package/dist/operations/crud/upsert.d.ts.map +1 -0
- package/dist/operations/crud/upsert.js +386 -0
- package/dist/operations/crud/upsert.js.map +1 -0
- package/dist/operations/query/aggregate.d.ts +30 -0
- package/dist/operations/query/aggregate.d.ts.map +1 -0
- package/dist/operations/query/aggregate.js +227 -0
- package/dist/operations/query/aggregate.js.map +1 -0
- package/dist/operations/query/cursor-stream.d.ts +18 -0
- package/dist/operations/query/cursor-stream.d.ts.map +1 -0
- package/dist/operations/query/cursor-stream.js +199 -0
- package/dist/operations/query/cursor-stream.js.map +1 -0
- package/dist/operations/query/filter-stream.d.ts +12 -0
- package/dist/operations/query/filter-stream.d.ts.map +1 -0
- package/dist/operations/query/filter-stream.js +167 -0
- package/dist/operations/query/filter-stream.js.map +1 -0
- package/dist/operations/query/filter.d.ts +13 -0
- package/dist/operations/query/filter.d.ts.map +1 -0
- package/dist/operations/query/filter.js +267 -0
- package/dist/operations/query/filter.js.map +1 -0
- package/dist/operations/query/paginate-stream.d.ts +11 -0
- package/dist/operations/query/paginate-stream.d.ts.map +1 -0
- package/dist/operations/query/paginate-stream.js +22 -0
- package/dist/operations/query/paginate-stream.js.map +1 -0
- package/dist/operations/query/query-helpers.d.ts +14 -0
- package/dist/operations/query/query-helpers.d.ts.map +1 -0
- package/dist/operations/query/query-helpers.js +22 -0
- package/dist/operations/query/query-helpers.js.map +1 -0
- package/dist/operations/query/resolve-computed.d.ts +142 -0
- package/dist/operations/query/resolve-computed.d.ts.map +1 -0
- package/dist/operations/query/resolve-computed.js +197 -0
- package/dist/operations/query/resolve-computed.js.map +1 -0
- package/dist/operations/query/search.d.ts +110 -0
- package/dist/operations/query/search.d.ts.map +1 -0
- package/dist/operations/query/search.js +188 -0
- package/dist/operations/query/search.js.map +1 -0
- package/dist/operations/query/select-stream.d.ts +27 -0
- package/dist/operations/query/select-stream.d.ts.map +1 -0
- package/dist/operations/query/select-stream.js +88 -0
- package/dist/operations/query/select-stream.js.map +1 -0
- package/dist/operations/query/select.d.ts +54 -0
- package/dist/operations/query/select.d.ts.map +1 -0
- package/dist/operations/query/select.js +159 -0
- package/dist/operations/query/select.js.map +1 -0
- package/dist/operations/query/sort-stream.d.ts +46 -0
- package/dist/operations/query/sort-stream.d.ts.map +1 -0
- package/dist/operations/query/sort-stream.js +158 -0
- package/dist/operations/query/sort-stream.js.map +1 -0
- package/dist/operations/query/sort.d.ts +9 -0
- package/dist/operations/query/sort.d.ts.map +1 -0
- package/dist/operations/query/sort.js +58 -0
- package/dist/operations/query/sort.js.map +1 -0
- package/dist/operations/relationships/populate-stream.d.ts +29 -0
- package/dist/operations/relationships/populate-stream.d.ts.map +1 -0
- package/dist/operations/relationships/populate-stream.js +159 -0
- package/dist/operations/relationships/populate-stream.js.map +1 -0
- package/dist/operations/relationships/populate.d.ts +15 -0
- package/dist/operations/relationships/populate.d.ts.map +1 -0
- package/dist/operations/relationships/populate.js +228 -0
- package/dist/operations/relationships/populate.js.map +1 -0
- package/dist/plugins/plugin-hooks.d.ts +25 -0
- package/dist/plugins/plugin-hooks.d.ts.map +1 -0
- package/dist/plugins/plugin-hooks.js +64 -0
- package/dist/plugins/plugin-hooks.js.map +1 -0
- package/dist/plugins/plugin-registry.d.ts +26 -0
- package/dist/plugins/plugin-registry.d.ts.map +1 -0
- package/dist/plugins/plugin-registry.js +150 -0
- package/dist/plugins/plugin-registry.js.map +1 -0
- package/dist/plugins/plugin-types.d.ts +95 -0
- package/dist/plugins/plugin-types.d.ts.map +1 -0
- package/dist/plugins/plugin-types.js +6 -0
- package/dist/plugins/plugin-types.js.map +1 -0
- package/dist/plugins/plugin-validation.d.ts +49 -0
- package/dist/plugins/plugin-validation.d.ts.map +1 -0
- package/dist/plugins/plugin-validation.js +295 -0
- package/dist/plugins/plugin-validation.js.map +1 -0
- package/dist/reactive/change-event.d.ts +44 -0
- package/dist/reactive/change-event.d.ts.map +1 -0
- package/dist/reactive/change-event.js +49 -0
- package/dist/reactive/change-event.js.map +1 -0
- package/dist/reactive/change-pubsub.d.ts +32 -0
- package/dist/reactive/change-pubsub.d.ts.map +1 -0
- package/dist/reactive/change-pubsub.js +31 -0
- package/dist/reactive/change-pubsub.js.map +1 -0
- package/dist/reactive/evaluate-query.d.ts +62 -0
- package/dist/reactive/evaluate-query.d.ts.map +1 -0
- package/dist/reactive/evaluate-query.js +57 -0
- package/dist/reactive/evaluate-query.js.map +1 -0
- package/dist/reactive/watch-by-id.d.ts +53 -0
- package/dist/reactive/watch-by-id.d.ts.map +1 -0
- package/dist/reactive/watch-by-id.js +55 -0
- package/dist/reactive/watch-by-id.js.map +1 -0
- package/dist/reactive/watch.d.ts +78 -0
- package/dist/reactive/watch.d.ts.map +1 -0
- package/dist/reactive/watch.js +133 -0
- package/dist/reactive/watch.js.map +1 -0
- package/dist/serializers/codecs/hjson.d.ts +33 -0
- package/dist/serializers/codecs/hjson.d.ts.map +1 -0
- package/dist/serializers/codecs/hjson.js +40 -0
- package/dist/serializers/codecs/hjson.js.map +1 -0
- package/dist/serializers/codecs/json.d.ts +22 -0
- package/dist/serializers/codecs/json.d.ts.map +1 -0
- package/dist/serializers/codecs/json.js +28 -0
- package/dist/serializers/codecs/json.js.map +1 -0
- package/dist/serializers/codecs/json5.d.ts +26 -0
- package/dist/serializers/codecs/json5.d.ts.map +1 -0
- package/dist/serializers/codecs/json5.js +33 -0
- package/dist/serializers/codecs/json5.js.map +1 -0
- package/dist/serializers/codecs/jsonc.d.ts +29 -0
- package/dist/serializers/codecs/jsonc.d.ts.map +1 -0
- package/dist/serializers/codecs/jsonc.js +38 -0
- package/dist/serializers/codecs/jsonc.js.map +1 -0
- package/dist/serializers/codecs/jsonl.d.ts +17 -0
- package/dist/serializers/codecs/jsonl.d.ts.map +1 -0
- package/dist/serializers/codecs/jsonl.js +31 -0
- package/dist/serializers/codecs/jsonl.js.map +1 -0
- package/dist/serializers/codecs/prose.d.ts +419 -0
- package/dist/serializers/codecs/prose.d.ts.map +1 -0
- package/dist/serializers/codecs/prose.js +1060 -0
- package/dist/serializers/codecs/prose.js.map +1 -0
- package/dist/serializers/codecs/toml.d.ts +23 -0
- package/dist/serializers/codecs/toml.d.ts.map +1 -0
- package/dist/serializers/codecs/toml.js +66 -0
- package/dist/serializers/codecs/toml.js.map +1 -0
- package/dist/serializers/codecs/toon.d.ts +20 -0
- package/dist/serializers/codecs/toon.d.ts.map +1 -0
- package/dist/serializers/codecs/toon.js +33 -0
- package/dist/serializers/codecs/toon.js.map +1 -0
- package/dist/serializers/codecs/yaml.d.ts +24 -0
- package/dist/serializers/codecs/yaml.d.ts.map +1 -0
- package/dist/serializers/codecs/yaml.js +31 -0
- package/dist/serializers/codecs/yaml.js.map +1 -0
- package/dist/serializers/format-codec.d.ts +53 -0
- package/dist/serializers/format-codec.d.ts.map +1 -0
- package/dist/serializers/format-codec.js +148 -0
- package/dist/serializers/format-codec.js.map +1 -0
- package/dist/serializers/presets.d.ts +48 -0
- package/dist/serializers/presets.d.ts.map +1 -0
- package/dist/serializers/presets.js +72 -0
- package/dist/serializers/presets.js.map +1 -0
- package/dist/serializers/serializer-service.d.ts +11 -0
- package/dist/serializers/serializer-service.d.ts.map +1 -0
- package/dist/serializers/serializer-service.js +4 -0
- package/dist/serializers/serializer-service.js.map +1 -0
- package/dist/state/collection-state.d.ts +19 -0
- package/dist/state/collection-state.d.ts.map +1 -0
- package/dist/state/collection-state.js +15 -0
- package/dist/state/collection-state.js.map +1 -0
- package/dist/state/state-operations.d.ts +38 -0
- package/dist/state/state-operations.d.ts.map +1 -0
- package/dist/state/state-operations.js +65 -0
- package/dist/state/state-operations.js.map +1 -0
- package/dist/storage/in-memory-adapter-layer.d.ts +16 -0
- package/dist/storage/in-memory-adapter-layer.d.ts.map +1 -0
- package/dist/storage/in-memory-adapter-layer.js +81 -0
- package/dist/storage/in-memory-adapter-layer.js.map +1 -0
- package/dist/storage/persistence-effect.d.ts +244 -0
- package/dist/storage/persistence-effect.d.ts.map +1 -0
- package/dist/storage/persistence-effect.js +551 -0
- package/dist/storage/persistence-effect.js.map +1 -0
- package/dist/storage/storage-service.d.ts +22 -0
- package/dist/storage/storage-service.d.ts.map +1 -0
- package/dist/storage/storage-service.js +4 -0
- package/dist/storage/storage-service.js.map +1 -0
- package/dist/storage/transforms.d.ts +183 -0
- package/dist/storage/transforms.d.ts.map +1 -0
- package/dist/storage/transforms.js +263 -0
- package/dist/storage/transforms.js.map +1 -0
- package/dist/transactions/transaction.d.ts +87 -0
- package/dist/transactions/transaction.d.ts.map +1 -0
- package/dist/transactions/transaction.js +240 -0
- package/dist/transactions/transaction.js.map +1 -0
- package/dist/types/aggregate-types.d.ts +73 -0
- package/dist/types/aggregate-types.d.ts.map +1 -0
- package/dist/types/aggregate-types.js +14 -0
- package/dist/types/aggregate-types.js.map +1 -0
- package/dist/types/computed-types.d.ts +71 -0
- package/dist/types/computed-types.d.ts.map +1 -0
- package/dist/types/computed-types.js +8 -0
- package/dist/types/computed-types.js.map +1 -0
- package/dist/types/crud-relationship-types.d.ts +180 -0
- package/dist/types/crud-relationship-types.d.ts.map +1 -0
- package/dist/types/crud-relationship-types.js +17 -0
- package/dist/types/crud-relationship-types.js.map +1 -0
- package/dist/types/crud-types.d.ts +343 -0
- package/dist/types/crud-types.d.ts.map +1 -0
- package/dist/types/crud-types.js +43 -0
- package/dist/types/crud-types.js.map +1 -0
- package/dist/types/cursor-types.d.ts +52 -0
- package/dist/types/cursor-types.d.ts.map +1 -0
- package/dist/types/cursor-types.js +2 -0
- package/dist/types/cursor-types.js.map +1 -0
- package/dist/types/database-config-types.d.ts +196 -0
- package/dist/types/database-config-types.d.ts.map +1 -0
- package/dist/types/database-config-types.js +11 -0
- package/dist/types/database-config-types.js.map +1 -0
- package/dist/types/hook-types.d.ts +158 -0
- package/dist/types/hook-types.d.ts.map +1 -0
- package/dist/types/hook-types.js +6 -0
- package/dist/types/hook-types.js.map +1 -0
- package/dist/types/index-types.d.ts +42 -0
- package/dist/types/index-types.d.ts.map +1 -0
- package/dist/types/index-types.js +8 -0
- package/dist/types/index-types.js.map +1 -0
- package/dist/types/operators.d.ts +5 -0
- package/dist/types/operators.d.ts.map +1 -0
- package/dist/types/operators.js +297 -0
- package/dist/types/operators.js.map +1 -0
- package/dist/types/query-overloads.d.ts +54 -0
- package/dist/types/query-overloads.d.ts.map +1 -0
- package/dist/types/query-overloads.js +3 -0
- package/dist/types/query-overloads.js.map +1 -0
- package/dist/types/reactive-types.d.ts +75 -0
- package/dist/types/reactive-types.d.ts.map +1 -0
- package/dist/types/reactive-types.js +7 -0
- package/dist/types/reactive-types.js.map +1 -0
- package/dist/types/schema-types.d.ts +56 -0
- package/dist/types/schema-types.d.ts.map +1 -0
- package/dist/types/schema-types.js +8 -0
- package/dist/types/schema-types.js.map +1 -0
- package/dist/types/search-types.d.ts +82 -0
- package/dist/types/search-types.d.ts.map +1 -0
- package/dist/types/search-types.js +110 -0
- package/dist/types/search-types.js.map +1 -0
- package/dist/types/types.d.ts +286 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +2 -0
- package/dist/types/types.js.map +1 -0
- package/dist/utils/id-generator.d.ts +97 -0
- package/dist/utils/id-generator.d.ts.map +1 -0
- package/dist/utils/id-generator.js +247 -0
- package/dist/utils/id-generator.js.map +1 -0
- package/dist/utils/nested-path.d.ts +56 -0
- package/dist/utils/nested-path.d.ts.map +1 -0
- package/dist/utils/nested-path.js +119 -0
- package/dist/utils/nested-path.js.map +1 -0
- package/dist/utils/path.d.ts +16 -0
- package/dist/utils/path.d.ts.map +1 -0
- package/dist/utils/path.js +24 -0
- package/dist/utils/path.js.map +1 -0
- package/dist/validators/foreign-key.d.ts +49 -0
- package/dist/validators/foreign-key.d.ts.map +1 -0
- package/dist/validators/foreign-key.js +153 -0
- package/dist/validators/foreign-key.js.map +1 -0
- package/dist/validators/schema-validator.d.ts +19 -0
- package/dist/validators/schema-validator.d.ts.map +1 -0
- package/dist/validators/schema-validator.js +34 -0
- package/dist/validators/schema-validator.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { FormatCodec } from "../format-codec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the Hjson codec.
|
|
4
|
+
*/
|
|
5
|
+
export interface HjsonCodecOptions {
|
|
6
|
+
readonly indent?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates an Hjson (Human JSON) codec with configurable indentation.
|
|
10
|
+
*
|
|
11
|
+
* Hjson is a JSON superset designed for human editing. It allows:
|
|
12
|
+
* - Comments: `//`, block comments, and `#` hash comments
|
|
13
|
+
* - Unquoted keys and string values
|
|
14
|
+
* - Trailing commas
|
|
15
|
+
* - Multiline strings with `'''`
|
|
16
|
+
*
|
|
17
|
+
* On decode: comments are stripped during parsing.
|
|
18
|
+
* On encode: outputs human-friendly Hjson format (not standard JSON).
|
|
19
|
+
*
|
|
20
|
+
* @param options - Optional configuration for Hjson serialization
|
|
21
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
22
|
+
* @returns A FormatCodec for Hjson serialization
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const codec = hjsonCodec({ indent: 4 })
|
|
27
|
+
* const layer = makeSerializerLayer([codec])
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @see https://hjson.github.io for format specification
|
|
31
|
+
*/
|
|
32
|
+
export declare const hjsonCodec: (options?: HjsonCodecOptions) => FormatCodec;
|
|
33
|
+
//# sourceMappingURL=hjson.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hjson.d.ts","sourceRoot":"","sources":["../../../src/serializers/codecs/hjson.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,iBAAiB,KAAG,WAcxD,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { parse, stringify } from "hjson";
|
|
2
|
+
/**
|
|
3
|
+
* Creates an Hjson (Human JSON) codec with configurable indentation.
|
|
4
|
+
*
|
|
5
|
+
* Hjson is a JSON superset designed for human editing. It allows:
|
|
6
|
+
* - Comments: `//`, block comments, and `#` hash comments
|
|
7
|
+
* - Unquoted keys and string values
|
|
8
|
+
* - Trailing commas
|
|
9
|
+
* - Multiline strings with `'''`
|
|
10
|
+
*
|
|
11
|
+
* On decode: comments are stripped during parsing.
|
|
12
|
+
* On encode: outputs human-friendly Hjson format (not standard JSON).
|
|
13
|
+
*
|
|
14
|
+
* @param options - Optional configuration for Hjson serialization
|
|
15
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
16
|
+
* @returns A FormatCodec for Hjson serialization
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const codec = hjsonCodec({ indent: 4 })
|
|
21
|
+
* const layer = makeSerializerLayer([codec])
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see https://hjson.github.io for format specification
|
|
25
|
+
*/
|
|
26
|
+
export const hjsonCodec = (options) => {
|
|
27
|
+
const indent = options?.indent ?? 2;
|
|
28
|
+
return {
|
|
29
|
+
name: "hjson",
|
|
30
|
+
extensions: ["hjson"],
|
|
31
|
+
encode: (data, formatOptions) => {
|
|
32
|
+
const actualIndent = formatOptions?.indent ?? indent;
|
|
33
|
+
return stringify(data, { space: actualIndent });
|
|
34
|
+
},
|
|
35
|
+
decode: (raw) => {
|
|
36
|
+
return parse(raw);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=hjson.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hjson.js","sourceRoot":"","sources":["../../../src/serializers/codecs/hjson.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAe,EAAE;IACtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;IAEpC,OAAO;QACN,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,CAAC,IAAa,EAAE,aAA6B,EAAU,EAAE;YAChE,MAAM,YAAY,GAAG,aAAa,EAAE,MAAM,IAAI,MAAM,CAAC;YACrD,OAAO,SAAS,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,EAAE,CAAC,GAAW,EAAW,EAAE;YAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { FormatCodec } from "../format-codec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the JSON codec.
|
|
4
|
+
*/
|
|
5
|
+
export interface JsonCodecOptions {
|
|
6
|
+
readonly indent?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a JSON codec with configurable indentation.
|
|
10
|
+
*
|
|
11
|
+
* @param options - Optional configuration for JSON serialization
|
|
12
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
13
|
+
* @returns A FormatCodec for JSON serialization
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const codec = jsonCodec({ indent: 4 })
|
|
18
|
+
* const layer = makeSerializerLayer([codec])
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const jsonCodec: (options?: JsonCodecOptions) => FormatCodec;
|
|
22
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../../src/serializers/codecs/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,gBAAgB,KAAG,WActD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a JSON codec with configurable indentation.
|
|
3
|
+
*
|
|
4
|
+
* @param options - Optional configuration for JSON serialization
|
|
5
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
6
|
+
* @returns A FormatCodec for JSON serialization
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const codec = jsonCodec({ indent: 4 })
|
|
11
|
+
* const layer = makeSerializerLayer([codec])
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export const jsonCodec = (options) => {
|
|
15
|
+
const indent = options?.indent ?? 2;
|
|
16
|
+
return {
|
|
17
|
+
name: "json",
|
|
18
|
+
extensions: ["json"],
|
|
19
|
+
encode: (data, formatOptions) => {
|
|
20
|
+
const actualIndent = formatOptions?.indent ?? indent;
|
|
21
|
+
return JSON.stringify(data, null, actualIndent);
|
|
22
|
+
},
|
|
23
|
+
decode: (raw) => {
|
|
24
|
+
return JSON.parse(raw);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../../src/serializers/codecs/json.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,OAA0B,EAAe,EAAE;IACpE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;IAEpC,OAAO;QACN,IAAI,EAAE,MAAM;QACZ,UAAU,EAAE,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,CAAC,IAAa,EAAE,aAA6B,EAAU,EAAE;YAChE,MAAM,YAAY,GAAG,aAAa,EAAE,MAAM,IAAI,MAAM,CAAC;YACrD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,EAAE,CAAC,GAAW,EAAW,EAAE;YAChC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FormatCodec } from "../format-codec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the JSON5 codec.
|
|
4
|
+
*/
|
|
5
|
+
export interface Json5CodecOptions {
|
|
6
|
+
readonly indent?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a JSON5 codec with configurable indentation.
|
|
10
|
+
*
|
|
11
|
+
* JSON5 is a superset of JSON that allows comments, trailing commas,
|
|
12
|
+
* unquoted keys, and other human-friendly syntax on read. On write,
|
|
13
|
+
* output is formatted JSON5.
|
|
14
|
+
*
|
|
15
|
+
* @param options - Optional configuration for JSON5 serialization
|
|
16
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
17
|
+
* @returns A FormatCodec for JSON5 serialization
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const codec = json5Codec({ indent: 4 })
|
|
22
|
+
* const layer = makeSerializerLayer([codec])
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const json5Codec: (options?: Json5CodecOptions) => FormatCodec;
|
|
26
|
+
//# sourceMappingURL=json5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json5.d.ts","sourceRoot":"","sources":["../../../src/serializers/codecs/json5.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,iBAAiB,KAAG,WAcxD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { parse, stringify } from "json5";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JSON5 codec with configurable indentation.
|
|
4
|
+
*
|
|
5
|
+
* JSON5 is a superset of JSON that allows comments, trailing commas,
|
|
6
|
+
* unquoted keys, and other human-friendly syntax on read. On write,
|
|
7
|
+
* output is formatted JSON5.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Optional configuration for JSON5 serialization
|
|
10
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
11
|
+
* @returns A FormatCodec for JSON5 serialization
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const codec = json5Codec({ indent: 4 })
|
|
16
|
+
* const layer = makeSerializerLayer([codec])
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const json5Codec = (options) => {
|
|
20
|
+
const indent = options?.indent ?? 2;
|
|
21
|
+
return {
|
|
22
|
+
name: "json5",
|
|
23
|
+
extensions: ["json5"],
|
|
24
|
+
encode: (data, formatOptions) => {
|
|
25
|
+
const actualIndent = formatOptions?.indent ?? indent;
|
|
26
|
+
return stringify(data, null, actualIndent);
|
|
27
|
+
},
|
|
28
|
+
decode: (raw) => {
|
|
29
|
+
return parse(raw);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=json5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json5.js","sourceRoot":"","sources":["../../../src/serializers/codecs/json5.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUzC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAe,EAAE;IACtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;IAEpC,OAAO;QACN,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,CAAC,IAAa,EAAE,aAA6B,EAAU,EAAE;YAChE,MAAM,YAAY,GAAG,aAAa,EAAE,MAAM,IAAI,MAAM,CAAC;YACrD,OAAO,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QAC5C,CAAC;QACD,MAAM,EAAE,CAAC,GAAW,EAAW,EAAE;YAChC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FormatCodec } from "../format-codec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the JSONC codec.
|
|
4
|
+
*/
|
|
5
|
+
export interface JsoncCodecOptions {
|
|
6
|
+
readonly indent?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a JSONC (JSON with Comments) codec with configurable indentation.
|
|
10
|
+
*
|
|
11
|
+
* JSONC is a superset of JSON that allows line comments (//) and block
|
|
12
|
+
* comments. On read, comments are stripped using jsonc-parser. On write,
|
|
13
|
+
* standard JSON is output (comments are not preserved).
|
|
14
|
+
*
|
|
15
|
+
* This is the same behavior as VS Code's settings.json — comments in
|
|
16
|
+
* hand-edited .jsonc files do not survive a save cycle.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Optional configuration for JSONC serialization
|
|
19
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
20
|
+
* @returns A FormatCodec for JSONC serialization
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const codec = jsoncCodec({ indent: 4 })
|
|
25
|
+
* const layer = makeSerializerLayer([codec])
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare const jsoncCodec: (options?: JsoncCodecOptions) => FormatCodec;
|
|
29
|
+
//# sourceMappingURL=jsonc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../../src/serializers/codecs/jsonc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAiB,MAAM,oBAAoB,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,iBAAiB,KAAG,WAgBxD,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { parse } from "jsonc-parser";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JSONC (JSON with Comments) codec with configurable indentation.
|
|
4
|
+
*
|
|
5
|
+
* JSONC is a superset of JSON that allows line comments (//) and block
|
|
6
|
+
* comments. On read, comments are stripped using jsonc-parser. On write,
|
|
7
|
+
* standard JSON is output (comments are not preserved).
|
|
8
|
+
*
|
|
9
|
+
* This is the same behavior as VS Code's settings.json — comments in
|
|
10
|
+
* hand-edited .jsonc files do not survive a save cycle.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Optional configuration for JSONC serialization
|
|
13
|
+
* @param options.indent - Number of spaces for indentation (default: 2)
|
|
14
|
+
* @returns A FormatCodec for JSONC serialization
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const codec = jsoncCodec({ indent: 4 })
|
|
19
|
+
* const layer = makeSerializerLayer([codec])
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export const jsoncCodec = (options) => {
|
|
23
|
+
const indent = options?.indent ?? 2;
|
|
24
|
+
return {
|
|
25
|
+
name: "jsonc",
|
|
26
|
+
extensions: ["jsonc"],
|
|
27
|
+
encode: (data, formatOptions) => {
|
|
28
|
+
const actualIndent = formatOptions?.indent ?? indent;
|
|
29
|
+
return JSON.stringify(data, null, actualIndent);
|
|
30
|
+
},
|
|
31
|
+
decode: (raw) => {
|
|
32
|
+
// jsonc-parser's parse function handles comments and trailing commas
|
|
33
|
+
// It returns the parsed JavaScript value, stripping comments automatically
|
|
34
|
+
return parse(raw);
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=jsonc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonc.js","sourceRoot":"","sources":["../../../src/serializers/codecs/jsonc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAUrC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,OAA2B,EAAe,EAAE;IACtE,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC;IAEpC,OAAO;QACN,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,CAAC,IAAa,EAAE,aAA6B,EAAU,EAAE;YAChE,MAAM,YAAY,GAAG,aAAa,EAAE,MAAM,IAAI,MAAM,CAAC;YACrD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,EAAE,CAAC,GAAW,EAAW,EAAE;YAChC,qEAAqE;YACrE,2EAA2E;YAC3E,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormatCodec } from "../format-codec.js";
|
|
2
|
+
/**
|
|
3
|
+
* Creates a JSONL (JSON Lines / Newline Delimited JSON) codec.
|
|
4
|
+
*
|
|
5
|
+
* Each element of the array is serialized as a single JSON line.
|
|
6
|
+
* On decode, each non-empty line is parsed as a JSON value.
|
|
7
|
+
*
|
|
8
|
+
* @returns A FormatCodec for JSONL serialization
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const codec = jsonlCodec()
|
|
13
|
+
* const layer = makeSerializerLayer([codec])
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const jsonlCodec: () => FormatCodec;
|
|
17
|
+
//# sourceMappingURL=jsonl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl.d.ts","sourceRoot":"","sources":["../../../src/serializers/codecs/jsonl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU,QAAO,WAe7B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a JSONL (JSON Lines / Newline Delimited JSON) codec.
|
|
3
|
+
*
|
|
4
|
+
* Each element of the array is serialized as a single JSON line.
|
|
5
|
+
* On decode, each non-empty line is parsed as a JSON value.
|
|
6
|
+
*
|
|
7
|
+
* @returns A FormatCodec for JSONL serialization
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const codec = jsonlCodec()
|
|
12
|
+
* const layer = makeSerializerLayer([codec])
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export const jsonlCodec = () => {
|
|
16
|
+
return {
|
|
17
|
+
name: "jsonl",
|
|
18
|
+
extensions: ["jsonl", "ndjson"],
|
|
19
|
+
encode: (data) => {
|
|
20
|
+
if (!Array.isArray(data)) {
|
|
21
|
+
return JSON.stringify(data);
|
|
22
|
+
}
|
|
23
|
+
return data.map((item) => JSON.stringify(item)).join("\n");
|
|
24
|
+
},
|
|
25
|
+
decode: (raw) => {
|
|
26
|
+
const lines = raw.split("\n").filter((line) => line.trim() !== "");
|
|
27
|
+
return lines.map((line) => JSON.parse(line));
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=jsonl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonl.js","sourceRoot":"","sources":["../../../src/serializers/codecs/jsonl.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAgB,EAAE;IAC3C,OAAO;QACN,IAAI,EAAE,OAAO;QACb,UAAU,EAAE,CAAC,OAAO,EAAE,QAAQ,CAAC;QAC/B,MAAM,EAAE,CAAC,IAAa,EAAU,EAAE;YACjC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,CAAC;QACD,MAAM,EAAE,CAAC,GAAW,EAAW,EAAE;YAChC,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAC9C,CAAC;KACD,CAAC;AACH,CAAC,CAAC"}
|