Skip to content
Permalink
Browse files

Merge pull request #97 from mrcrille/fix-issue-97

Unable to resolve JSON files when using Webpack
  • Loading branch information...
rom1504 committed Aug 24, 2019
2 parents e69d2b2 + fb45c3d commit 13b93177f10d624d0f47f1e811e77befe3b10367
Showing with 18 additions and 18 deletions.
  1. +2 −2 src/datatypes/conditional.js
  2. +5 −5 src/datatypes/numeric.js
  3. +3 −3 src/datatypes/structures.js
  4. +8 −8 src/datatypes/utils.js
@@ -1,8 +1,8 @@
const { getField, getFieldInfo, tryDoc, PartialReadError } = require('../utils')

module.exports = {
'switch': [readSwitch, writeSwitch, sizeOfSwitch, require('../../ProtoDef/schemas/conditional')['switch']],
'option': [readOption, writeOption, sizeOfOption, require('../../ProtoDef/schemas/conditional')['option']]
'switch': [readSwitch, writeSwitch, sizeOfSwitch, require('../../ProtoDef/schemas/conditional.json')['switch']],
'option': [readOption, writeOption, sizeOfOption, require('../../ProtoDef/schemas/conditional.json')['option']]
}

function readSwitch (buffer, offset, { compareTo, fields, compareToValue, 'default': defVal }, rootNode) {
@@ -92,12 +92,12 @@ const nums = {
}

const types = Object.keys(nums).reduce((types, num) => {
types[num] = generateFunctions(nums[num][0], nums[num][1], nums[num][2], require('../../ProtoDef/schemas/numeric')[num])
types[num] = generateFunctions(nums[num][0], nums[num][1], nums[num][2], require('../../ProtoDef/schemas/numeric.json')[num])
return types
}, {})
types['i64'] = [readI64, writeI64, 8, require('../../ProtoDef/schemas/numeric')['i64']]
types['li64'] = [readLI64, writeLI64, 8, require('../../ProtoDef/schemas/numeric')['li64']]
types['u64'] = [readU64, writeU64, 8, require('../../ProtoDef/schemas/numeric')['u64']]
types['lu64'] = [readLU64, writeLU64, 8, require('../../ProtoDef/schemas/numeric')['lu64']]
types['i64'] = [readI64, writeI64, 8, require('../../ProtoDef/schemas/numeric.json')['i64']]
types['li64'] = [readLI64, writeLI64, 8, require('../../ProtoDef/schemas/numeric.json')['li64']]
types['u64'] = [readU64, writeU64, 8, require('../../ProtoDef/schemas/numeric.json')['u64']]
types['lu64'] = [readLU64, writeLU64, 8, require('../../ProtoDef/schemas/numeric.json')['lu64']]

module.exports = types
@@ -1,9 +1,9 @@
const { getField, getCount, sendCount, calcCount, tryDoc } = require('../utils')

module.exports = {
'array': [readArray, writeArray, sizeOfArray, require('../../ProtoDef/schemas/structures')['array']],
'count': [readCount, writeCount, sizeOfCount, require('../../ProtoDef/schemas/structures')['count']],
'container': [readContainer, writeContainer, sizeOfContainer, require('../../ProtoDef/schemas/structures')['container']]
'array': [readArray, writeArray, sizeOfArray, require('../../ProtoDef/schemas/structures.json')['array']],
'count': [readCount, writeCount, sizeOfCount, require('../../ProtoDef/schemas/structures.json')['count']],
'container': [readContainer, writeContainer, sizeOfContainer, require('../../ProtoDef/schemas/structures.json')['container']]
}

function readArray (buffer, offset, typeArgs, rootNode) {
@@ -3,14 +3,14 @@ const assert = require('assert')
const { getCount, sendCount, calcCount, PartialReadError } = require('../utils')

module.exports = {
'varint': [readVarInt, writeVarInt, sizeOfVarInt, require('../../ProtoDef/schemas/utils')['varint']],
'bool': [readBool, writeBool, 1, require('../../ProtoDef/schemas/utils')['bool']],
'pstring': [readPString, writePString, sizeOfPString, require('../../ProtoDef/schemas/utils')['pstring']],
'buffer': [readBuffer, writeBuffer, sizeOfBuffer, require('../../ProtoDef/schemas/utils')['buffer']],
'void': [readVoid, writeVoid, 0, require('../../ProtoDef/schemas/utils')['void']],
'bitfield': [readBitField, writeBitField, sizeOfBitField, require('../../ProtoDef/schemas/utils')['bitfield']],
'cstring': [readCString, writeCString, sizeOfCString, require('../../ProtoDef/schemas/utils')['cstring']],
'mapper': [readMapper, writeMapper, sizeOfMapper, require('../../ProtoDef/schemas/utils')['mapper']]
'varint': [readVarInt, writeVarInt, sizeOfVarInt, require('../../ProtoDef/schemas/utils.json')['varint']],
'bool': [readBool, writeBool, 1, require('../../ProtoDef/schemas/utils.json')['bool']],
'pstring': [readPString, writePString, sizeOfPString, require('../../ProtoDef/schemas/utils.json')['pstring']],
'buffer': [readBuffer, writeBuffer, sizeOfBuffer, require('../../ProtoDef/schemas/utils.json')['buffer']],
'void': [readVoid, writeVoid, 0, require('../../ProtoDef/schemas/utils.json')['void']],
'bitfield': [readBitField, writeBitField, sizeOfBitField, require('../../ProtoDef/schemas/utils.json')['bitfield']],
'cstring': [readCString, writeCString, sizeOfCString, require('../../ProtoDef/schemas/utils.json')['cstring']],
'mapper': [readMapper, writeMapper, sizeOfMapper, require('../../ProtoDef/schemas/utils.json')['mapper']]
}

function mapperEquality (a, b) {

0 comments on commit 13b9317

Please sign in to comment.
You can’t perform that action at this time.