url-safe-bitpacking 0.1.12 → 0.1.13

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/README.md CHANGED
@@ -11,16 +11,13 @@ Package for creating definitions of parametric models that can be stored as comp
11
11
  | updating model entries | ✓ | ✓ | |
12
12
  | re-using data from old model on change in definition | ½ | ¼ | |
13
13
  | flattening and reading of the objects | ✓ | ✓ | ¿ |
14
+ | arrays (both bit-level as arrays of objects) | ½ | ¼ | |
14
15
 
15
16
  ## concept
16
17
 
17
- The goal of this library is to offer a flexible, minimal and, variable object definition that can be stored in the browser URL. The main imagined use-case is parametric models that have nested and variable sub-object definitions.
18
+ The goal of this library is to offer a flexible, minimal and, variable object definition that can be stored in the browser URL. The main imagined use-case is parametric models that have nested and variable sub-object definitions. The library heavily relies on the bitpacking of custom bitwidth numeric values. Because of that, the biggest trade-off for this library is legibility. Without the related object definition, it would be impossible to reconstruct the state. The big advantage though is the ability to store rather many variables in a very condensed URL, allowing to store all information in rather short urls which then can be used for qr code generation.
18
19
 
19
- The library heavily relies on the bitpacking of custom bitwidth numeric values. Because of that, the biggest trade-off for this library is legibility. Without the related object definition, it would be impossible to reconstruct the state.
20
-
21
- The big advantage though is the ability to store rather many variables in a very condensed URL, allowing to store all information in rather short urls which then can be used for qr code generation.
22
-
23
- ## data types
20
+ ## bit-level data types
24
21
 
25
22
  Currently, there are 4 data types implemented (+1 special case for safety). All data entries have a name that will behave as an attribute name in the object.
26
23
 
@@ -64,11 +61,11 @@ There is also a Version object which is a special case of the enum data type and
64
61
  DataEntryFactory.createVersion(0, 8, 'version');
65
62
  ```
66
63
 
67
- ## attribute map
64
+ ## nested attribute definitions
68
65
 
69
- On a macro level there are two types of data. Either Single Level array objects or Double Nested array objects.
66
+ More often than not in parametric models, certain data belongs together. It can also happen that the specific state of some values will have an impact on other ones being present (or which ranges are allowed). To be able to deal with this there is the option to nest data. I tried to come with an as concise yet versatile way of defining the object definitions.
70
67
 
71
- Single-level nested objects are arrays in which the entries it contains describe themselves. The Double Nested arrays describe objects that will have a variable size, that depends on the linked data entry that is selected is set in state.
68
+ ### single nes
72
69
 
73
70
  For the Double Nested arrays there are currently two variations: either an Optional type, which only accepts two values of which is an empty array and will be toggle on/off in relation to a certain boolean data entry.
74
71
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { DataType } from './enums';
2
2
  export { DataEntryFactory } from './factory';
3
- export { SingleLevelContentType, NestedContentDataType, NestedContentType, DoubleLevelContentType, NonEmptyValidEntryArrayType, OptionalEntryDataType, EnumEntryDataType, PrecisionRangeType, SignificandMaxBits, FloatData, IntegerMaxBits, IntData, VersionRangeType, VersionData, BooleanData, DataEntry, DataEntryArray, } from './types';
4
- export { createParserObject, getStateValue, getBase64String } from './objectmap';
3
+ export { SingleLevelContentType, NestedContentDataType, NestedContentType, DoubleLevelContentType, NonEmptyValidEntryArrayType, OptionalEntryDataType, EnumEntryDataType, PrecisionRangeType, SignificandMaxBits, FloatData, IntegerMaxBits, IntData, VersionRangeType, VersionData, BooleanData, DataEntry, DataEntryArray, StateDataType, StateValueType, EnumSemantics, } from './types';
4
+ export { createParserObject, getStateValue, getBase64String, getDataEntryArray } from './objectmap';
5
5
  export { parseBase64ToBits } from './parsers';
6
6
  export { interpolateEntryAt, getRelativeValue } from './utils';
package/dist/index.js CHANGED
@@ -547,6 +547,7 @@ export {
547
547
  interpolateEntryAt,
548
548
  getStateValue,
549
549
  getRelativeValue,
550
+ getDataEntryArray,
550
551
  getBase64String,
551
552
  createParserObject,
552
553
  SignificandMaxBits,
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "dist/*"
7
7
  ],
8
8
  "type": "module",
9
- "version": "0.1.12",
9
+ "version": "0.1.13",
10
10
  "author": "Jonas Ward",
11
11
  "description": "Library for creating web safe base64 objects with custom bith widths and dynamic values.",
12
12
  "scripts": {