shinkansen-transmission 2.5.2 → 2.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shinkansen-transmission",
3
- "version": "2.5.2",
3
+ "version": "2.5.3",
4
4
  "description": "Shinkansen Transmission",
5
5
  "keywords": [
6
6
  "Shinkansen",
@@ -44,7 +44,7 @@
44
44
  "@babel/preset-env": "^7.26.9",
45
45
  "@babel/register": "^7.25.9",
46
46
  "@sequencemedia/eslint-config-standard": "^0.2.42",
47
- "@sequencemedia/eslint-config-typescript": "^0.1.59",
47
+ "@sequencemedia/eslint-config-typescript": "^0.1.60",
48
48
  "@types/babel__register": "^7.17.3",
49
49
  "@types/chai": "^5.2.0",
50
50
  "@types/debug": "^4.1.12",
@@ -148,7 +148,7 @@ const getUriForRegExp = (uri) => uri.endsWith('/') ? uri : uri + '/'
148
148
  export function getSelectedItems (values = {}, uri = '#') {
149
149
  const u = normaliseUri(uri)
150
150
 
151
- if (u in values) { // if (Reflect.has(values, u)) {
151
+ if (u in values) {
152
152
  const v = values[u]
153
153
 
154
154
  if (isPrimitive(v)) {
@@ -209,7 +209,7 @@ export function isParentUri (parentUri = '#', uri = '#') {
209
209
  * @returns {TransmissionStringMetaType | TransmissionNumberMetaType | TransmissionArrayMetaType | TransmissionObjectMetaType | TransmissionBooleanMetaType | TransmissionNullMetaType | Record<string, never>}
210
210
  */
211
211
  export function getMetaProps (params = {}, uri = '#') {
212
- if (uri in params) { // if (Reflect.has(params, uri)) {
212
+ if (uri in params) {
213
213
  const {
214
214
  meta = {}
215
215
  } = params[uri]
@@ -225,7 +225,7 @@ export function getMetaProps (params = {}, uri = '#') {
225
225
  * @returns {boolean}
226
226
  */
227
227
  export function hasMetaDefaultValue (schema = {}) {
228
- if ('default' in schema) { // if (Reflect.has(schema, 'default') {
228
+ if ('default' in schema) {
229
229
  const defaultValue = schema.default
230
230
 
231
231
  return isPrimitive(defaultValue)
@@ -239,7 +239,7 @@ export function hasMetaDefaultValue (schema = {}) {
239
239
  * @returns {{ defaultValue: string } | {}}
240
240
  */
241
241
  export function getMetaDefaultValue (schema = {}) {
242
- if ('default' in schema) { // if (Reflect.has(schema, 'default') {
242
+ if ('default' in schema) {
243
243
  const defaultValue = schema.default
244
244
 
245
245
  return { defaultValue: String(defaultValue) }
@@ -277,7 +277,7 @@ export function hasMetaValue (values = {}, uri = '#', schema = {}) {
277
277
  * @returns {{ value: string } | {}}
278
278
  */
279
279
  export function getMetaValue (values = {}, uri = '#', schema = {}) {
280
- if (uri in values) { // if (Reflect.has(values, uri)) {
280
+ if (uri in values) {
281
281
  const value = values[uri]
282
282
 
283
283
  if (isPrimitive(value)) {
@@ -285,7 +285,7 @@ export function getMetaValue (values = {}, uri = '#', schema = {}) {
285
285
  }
286
286
  }
287
287
 
288
- if ('const' in schema) { // if (Reflect.has(schema, 'const')) {
288
+ if ('const' in schema) {
289
289
  const constValue = schema.const
290
290
 
291
291
  if (isPrimitive(constValue)) {
@@ -534,13 +534,13 @@ export function findIndexByEqual (array, value) {
534
534
  * @returns {boolean}
535
535
  */
536
536
  export function hasValue (values = {}, uri = '#', schema = {}) {
537
- if (uri in values) { // if (Reflect.has(values, uri)) {
537
+ if (uri in values) {
538
538
  const value = values[uri]
539
539
 
540
540
  return isPrimitive(value)
541
541
  }
542
542
 
543
- if ('const' in schema) { // if (Reflect.has(schema, 'const')) {
543
+ if ('const' in schema) {
544
544
  const constValue = schema.const
545
545
 
546
546
  return isPrimitive(constValue)
@@ -558,7 +558,7 @@ export function hasValue (values = {}, uri = '#', schema = {}) {
558
558
  * @returns {string}
559
559
  */
560
560
  export function getValue (values = {}, uri = '#', schema = {}) {
561
- if (uri in values) { // if (Reflect.has(values, uri)) {
561
+ if (uri in values) {
562
562
  const value = values[uri]
563
563
 
564
564
  if (isPrimitive(value)) {
@@ -566,7 +566,7 @@ export function getValue (values = {}, uri = '#', schema = {}) {
566
566
  }
567
567
  }
568
568
 
569
- if ('const' in schema) { // if (Reflect.has(schema, 'const')) {
569
+ if ('const' in schema) {
570
570
  const constValue = schema.const
571
571
 
572
572
  if (isPrimitive(constValue)) {
@@ -583,7 +583,7 @@ export function getValue (values = {}, uri = '#', schema = {}) {
583
583
  * @returns {TransmissionStringElementsType | TransmissionNumberElementsType | TransmissionArrayElementsType | TransmissionObjectElementsType | TransmissionBooleanElementsType | TransmissionNullElementsType | Record<string, never>}
584
584
  */
585
585
  export function getElementsProps (params = {}, uri = '#') {
586
- if (uri in params) { // if (Reflect.has(values, uri)) {
586
+ if (uri in params) {
587
587
  const {
588
588
  elements = {}
589
589
  } = params[uri]
@@ -600,7 +600,7 @@ export function getElementsProps (params = {}, uri = '#') {
600
600
  * @returns {EnumType | ObjectLiteralType}
601
601
  */
602
602
  export function getElementsFieldPropsForEnum (params = {}, uri = '#') {
603
- if (uri in params) { // if (Reflect.has(values, uri)) {
603
+ if (uri in params) {
604
604
  /**
605
605
  * @type {{ elements?: { enum?: EnumType | ObjectLiteralType } }}
606
606
  */
@@ -622,7 +622,7 @@ export function getElementsFieldPropsForEnum (params = {}, uri = '#') {
622
622
  * @returns {OneOfType | ObjectLiteralType}
623
623
  */
624
624
  export function getElementsFieldPropsForOneOf (params = {}, uri = '#') {
625
- if (uri in params) { // if (Reflect.has(values, uri)) {
625
+ if (uri in params) {
626
626
  /**
627
627
  * @type {{ elements?: { oneOf?: OneOfType | ObjectLiteralType } }}
628
628
  */
@@ -644,7 +644,7 @@ export function getElementsFieldPropsForOneOf (params = {}, uri = '#') {
644
644
  * @returns {AnyOfType | ObjectLiteralType}
645
645
  */
646
646
  export function getElementsFieldPropsForAnyOf (params = {}, uri = '#') {
647
- if (uri in params) { // if (Reflect.has(values, uri)) {
647
+ if (uri in params) {
648
648
  /**
649
649
  * @type {{ elements?: { anyOf?: AnyOfType | ObjectLiteralType } }}
650
650
  */
@@ -666,7 +666,7 @@ export function getElementsFieldPropsForAnyOf (params = {}, uri = '#') {
666
666
  * @returns {FieldType | ObjectLiteralType}
667
667
  */
668
668
  export function getElementsFieldPropsForAllOf (params = {}, uri = '#') {
669
- if (uri in params) { // if (Reflect.has(values, uri)) {
669
+ if (uri in params) {
670
670
  /**
671
671
  * @type {{ elements?: { field?: FieldType | ObjectLiteralType } }}
672
672
  */
@@ -688,7 +688,7 @@ export function getElementsFieldPropsForAllOf (params = {}, uri = '#') {
688
688
  * @returns {FieldType | ObjectLiteralType}
689
689
  */
690
690
  export function getElementsFieldProps (params = {}, uri = '#') {
691
- if (uri in params) { // if (Reflect.has(values, uri)) {
691
+ if (uri in params) {
692
692
  /**
693
693
  * @type {{ elements?: { field?: FieldType | ObjectLiteralType } }}
694
694
  */
@@ -711,7 +711,7 @@ export function getElementsFieldProps (params = {}, uri = '#') {
711
711
  * @returns {{ value: string } | {}}
712
712
  */
713
713
  export function getElementsFieldValue (values = {}, uri = '#', schema = {}) {
714
- if (uri in values) { // (Reflect.has(values, uri)) {
714
+ if (uri in values) {
715
715
  const value = values[uri]
716
716
 
717
717
  if (isPrimitive(value)) {
@@ -912,7 +912,7 @@ export function getMaxItems ({ maxItems } = {}) {
912
912
  * @returns {{ hasUniqueItems: boolean } | {}}
913
913
  */
914
914
  export function getHasUniqueItems (schema = {}) {
915
- if ('uniqueItems' in schema) { // if (Reflect.has(schema, 'uniqueItems') {
915
+ if ('uniqueItems' in schema) {
916
916
  const value = schema.uniqueItems
917
917
 
918
918
  return (typeof value === 'boolean') ? { hasUniqueItems: value } : {}
@@ -966,7 +966,7 @@ export function getMaxProperties ({ maxProperties } = {}) {
966
966
  * @returns {{ isExclusiveMin: boolean } | {}}
967
967
  */
968
968
  export function getIsExclusiveMin (schema = {}) {
969
- if ('exclusiveMinimum' in schema) { // if (Reflect.has(schema, 'exclusiveMinimum') {
969
+ if ('exclusiveMinimum' in schema) {
970
970
  const value = schema.exclusiveMinimum
971
971
 
972
972
  return (typeof value === 'boolean') ? { isExclusiveMin: value } : {}
@@ -980,7 +980,7 @@ export function getIsExclusiveMin (schema = {}) {
980
980
  * @returns {{ isExclusiveMax: boolean } | {}}
981
981
  */
982
982
  export function getIsExclusiveMax (schema = {}) {
983
- if ('exclusiveMaximum' in schema) { // if (Reflect.has(schema, 'exclusiveMaximum') {
983
+ if ('exclusiveMaximum' in schema) {
984
984
  const value = schema.exclusiveMaximum
985
985
 
986
986
  return (typeof value === 'boolean') ? { isExclusiveMax: value } : {}