profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/amitguptagwl/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Amit K Gupta amitguptagwl India http://amitkumargupta.work On a break from OSS for some time.

amitguptagwl/Java-Rule-Book 34

Basic concepts of Java to answer any question about how Java works

amitguptagwl/BigBit 19

A standard to store any size of numeric data in less space without precision loss.

amitguptagwl/fast-lorem-ipsum 8

Generate Lorem Ipsum text quickly

amitguptagwl/coderswall 3

Collection Of wallpapers to decorate and learn

amitguptagwl/matchit 3

Card game generator

amitguptagwl/Practical-Java 3

Collection of Example Java Code

amitguptagwl/awesome-indic-tools 2

Collection / List of opensource tools supports indic languages

amitguptagwl/awesome-portfolios 2

Collection of really awesome portfolios

amitguptagwl/lazy-game-designer 2

Interface for prototyping card and board games

startedNaturalIntelligence/strnum

started time in a day

push eventamitguptagwl/quick-proxy

Amit Gupta

commit sha 69937f2fb97a236279ac08b1f97c268d8c5aac28

feat: show response headers, add delay

view details

push time in 4 days

push eventamitguptagwl/quick-proxy

Amit Gupta

commit sha 647da24446c592ffe25fa334dc9460be2c96999b

fix: show response headers

view details

push time in 4 days

push eventamitguptagwl/quick-proxy

Amit Gupta

commit sha 5e01e40135aa0442f0c5ba4f4c8bf606dc5d3617

fix: route to proxy after req payload

view details

push time in 4 days

push eventamitguptagwl/cypress-err

Amit Gupta

commit sha 97f22d897b573386a3187f2dc1701271c2c03871

initial setup

view details

push time in 6 days

issue closedcypress-io/cypress

Webpack Compilation Error when module is not imported

Current behavior

Cypress throws Webpack Compilation Error when running following test file

const { fakeServer } = require("cypress/types/sinon")

describe('example to-do app', () => {
  it.only('displays two todo items by default', () => {
    fs.readFile("fileDoesn'tExist.js");
  });
});
Error: Webpack Compilation Error
./cypress/integration/1-getting-started/todo.spec.js
Module not found: Error: Can't resolve 'cypress/types/sinon' in '/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/1-getting-started'
resolve 'cypress/types/sinon' in '/home/amit/temp/cytorus_code/test-repository/test/cypress/integration/1-getting-started'
  Parsed request is a module
  using description file: /home/amit/temp/cytorus_code/test-repository/package.json (relative path: ./test/cypress/integration/1-getting-started)
    Field 'browser' doesn't contain a valid alias configuration
    Looked for and couldn't find the file at the following paths:

Desired behavior

I'm expecting it to report the error in particular test with line number, if possible.

Test code to reproduce

You can reproduce this error with following code anywhere in the test

const { fakeServer } = require("cypress/types/sinon")

describe('example to-do app', () => {
  it('throws Webpack Compilation Error', () => {
    fs.readFile("fileDoesn'tExist.js"); //sorry-cypress not working
  });
});

or

const { fakeServer } = require("cypress/types/sinon")

describe('example to-do app', () => {
  it('throws Webpack Compilation Error', () => {
     cy.then( () => {
       throw new Error("on my wish");
     })
  });
});

Cypress Version

8.0.0, 8.3.1

Other

No response

closed time in 6 days

amitguptagwl

issue commentcypress-io/cypress

Webpack Compilation Error when module is not imported

I found that this issue has been resolved in Cypress v8.4.1

amitguptagwl

comment created time in 6 days

create barnchamitguptagwl/cypress-err

branch : main

created branch time in 6 days

created repositoryamitguptagwl/cypress-err

This is just the dummy demo app to reproduce webpack compilation error while running Cypress

created time in 6 days

push eventamitguptagwl/quick-proxy

Amit Gupta

commit sha 1ca063419d5ffb3f4258e8d160b0fdff3fb82d68

update proxy to log request

view details

push time in 6 days

issue commentsorry-cypress/sorry-cypress

Cypress ESOCKETTIMEDOUT in case of error

Thanks a lot @agoldis it worked.

amitguptagwl

comment created time in 6 days

issue commentsorry-cypress/sorry-cypress

Cypress ESOCKETTIMEDOUT in case of error

@agoldis have you get the chance to check this?

amitguptagwl

comment created time in 8 days

issue commentcypress-io/cypress

Webpack Compilation Error when module is not imported

Sure I'll create a repo and share the link

amitguptagwl

comment created time in 8 days

push eventNaturalIntelligence/Stubmatic

snyk-bot

commit sha 25031874c9641e31e0d16e6540f5157f0e22225d

fix: package.json & package-lock.json to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JS-AXIOS-1579269

view details

push time in 12 days

push eventNaturalIntelligence/ThankYouBackers

Amit K Gupta

commit sha 030fb598d1eb96105430bfe98f2c56e5743d4728

Update README.md

view details

push time in 14 days

push eventNaturalIntelligence/ThankYouBackers

Amit K Gupta

commit sha 7bcb1e8f2f666505766d4dea0eed88483de54dea

Update README.md

view details

push time in 14 days

push eventNaturalIntelligence/ThankYouBackers

Amit K Gupta

commit sha 3f38f7d8f7bdfa29f4622f7b330a48e0be722b5c

Update README.md

view details

push time in 14 days

create barnchNaturalIntelligence/ThankYouBackers

branch : main

created branch time in 14 days

created repositoryNaturalIntelligence/ThankYouBackers

I would like to thank you all who donated to NaturalIntelligence opensource organization

created time in 14 days

issue commentNaturalIntelligence/fast-xml-parser

Unwanted parse to number for strings or changed strings

@swaterkamp Please update to FXP v3.20.0. Use following code as a fix

const result = parser.parse(xmlData, {
    ignoreAttributes: false,
    parseAttributeValue: true,
    numParseOptions: {
        leadingZeros: true,
        skipLike: /\.[0-9]*0/
    }
});
swaterkamp

comment created time in 14 days

issue closedNaturalIntelligence/fast-xml-parser

Unwanted parse to number for strings or changed strings

  • [X] Are you running the latest version? 3.17.4
  • [X] Have you included sample input, output, error, and expected output? (Summarized in "Examples" for better readability)
  • [X] Have you checked if you are using correct configuration?
  • [X] Did you try online tool?

Description

When parsing specific tag values we need those to be a simple string. Instead, fast-xml-parser transforms those to a number, or, if it keeps it as string, still removes some characters from that string.

Our settings are:

const PARSER_OPTIONS = {
  attributeNamePrefix: '_',
  ignoreAttributes: false,
  ignoreNameSpace: true,
  textNodeName: '__text',
  parseTrueNumberOnly: true,
  attrValueProcessor: attr => parseXmlEncodedString(attr),
  tagValueProcessor: value => parseXmlEncodedString(value)
  },
};

where parseXmlEncodedString() simply unescapes some characters from the parsed result.

The line that breaks the parsing for us is https://github.com/NaturalIntelligence/fast-xml-parser/blob/827d7c4fa69813d27aabb80adfb81dae867e93ea/src/xmlstr2xmlnode.js#L110

If this was simply removed, all our needs would be met, but I guess it would break something for other users.

Here are some examples of what we receive as output given a specific input: <!-- Please provide following data to avoid long communication and fast resolution. -->

Examples

"212.130" -> 212.13 "212.000" -> 212 "212." -> "212." "000.000" -> "000" ".0" -> "" "003.10" -> "003.1" "0123.0" -> "0123"

In all cases we would just like to have the original string.

Would you like to work on this issue? <!-- choose one by changing [ ] to [x] -->

  • [x] Yes, if you could kindly list us what needs to be done in your opinion
  • [ ] No

Thank you for providing this parser, it is an essential part for our software and we would be happy to help improve it :)

Bookmark this repository for further updates.

closed time in 14 days

swaterkamp

issue closedNaturalIntelligence/fast-xml-parser

Is there any risk that this library is vulnerable to XXE?

See https://en.wikipedia.org/wiki/XML_external_entity_attack and https://owasp.org/www-project-top-ten/2017/A4_2017-XML_External_Entities_(XXE).html

I can't find anything in the documentation one way or another.

closed time in 14 days

plumdog

issue closedNaturalIntelligence/fast-xml-parser

Incorrect parsing of numbers in e-notation (scientific notation)

  • [x] Are you running the latest version?
  • [x] Have you included sample input, output, error, and expected output?
  • [x] Have you checked if you are using correct configuration?
  • [x] Did you try online tool?

Description

Numbers in e-notation without an decimal separator, such as 1e2, 1e-2, are parsed incorrectly.

As I understand the code, the decision to parse value into float is made only by the presence of an '.', which is not enough in my opinion.

This is a rather serious problem, because of it the data is distorted by orders of magnitude.

Input

<?xml version="1.0"?>
<n>1e2</n>
<n>1e-2</n>
<n>1.0e2</n>
<n>1.0e-2</n>

Code

require("fast-xml-parser").parse("<n>1e2</n><n>1e-2</n><n>1.0e2</n><n>1.0e-2</n>")

Output

{ "n": [1, 1, 100, 0.01 ]}

expected data

{ "n": [ 100, 0.01, 100, 0.01 ] }

Would you like to work on this issue? <!-- choose one by changing [ ] to [x] -->

  • [ ] Yes
  • [x] No

Bookmark this repository for further updates.

closed time in 14 days

peko

issue commentNaturalIntelligence/fast-xml-parser

Incorrect parsing of numbers in e-notation (scientific notation)

From FXP v3.20.0, a new property numParseOptions is introduced, check configuration to get desire result.

peko

comment created time in 14 days

issue closedNaturalIntelligence/fast-xml-parser

parseTrueNumberOnly = true does only work if the element to parse has but one leading zero

  • [x] Are you running the latest version?
  • [ ] Have you included sample input, output, error, and expected output?
  • [x] Have you checked if you are using correct configuration?
  • [ ] Did you try online tool?

Description

When parsing xml-files with the option "parseTrueNumberOnly: true" everything works fine if the data only contains tags with but one leading zero. Whenever there are tags with more than one leading zero all leading zeros are ignored. (See the tag "xCADNummer" of the following xml-Data.)

Input

 <ttBDE_ExportRow>
    <Firma>03</Firma>
    <Auftrag>42002867-117-1</Auftrag>
    <RueckMeldeNr>26849540</RueckMeldeNr>
    <xEtage>1L5</xEtage>
    <xRaum>05-14</xRaum>
    <xWaldnerPos>F00070601</xWaldnerPos>
    <xCADNummer>0006</xCADNummer>
    <Baugruppe>P117-1</Baugruppe>
    <BaugruppeBez>Materialanker</BaugruppeBez>
    <BaugruppeBez/>
    <BaugruppeBez/>
    <BaugruppeBez/>
    <Produktionsmenge>1.000</Produktionsmenge>
    <ArtikelGruppe>999999</ArtikelGruppe>
    <ArtikelGruppeBez>Standardgruppen</ArtikelGruppeBez>
    <Position>85</Position>
    <Artikel>81017202</Artikel>
    <ArtikelBez>Medienzelle WT PST</ArtikelBez>
    <ArtikelBez>Tischtiefe 900 Zellenhöhe1790</ArtikelBez>
    <ArtikelBez/>
    <ArtikelBez>Ersatz für 81006532  QM1262</ArtikelBez>
    <ArtikelArt>7</ArtikelArt>
    <Bedarfsmenge>1.000</Bedarfsmenge>
    <MengeKurzBez>St</MengeKurzBez>
    <MengeBez>Stück</MengeBez>
    <AktPos>340</AktPos>
    <BasisRessource>315600</BasisRessource>
    <IdentStk>233404203</IdentStk>
    <IdentAkt>91238023</IdentAkt>
    <LagerOrt/>
    <LagerPlatz/>
    <StartTermin>2021-04-20</StartTermin>
    <EndTermin>2021-04-20</EndTermin>
    <Stueckzeit>0.00</Stueckzeit>
    <BRes_AltResGr>315600</BRes_AltResGr>
  </ttBDE_ExportRow>

Code

const importRow = async function (rowJson, columns, importMap) {
					const rowToImport = {};
					try {
						columns.recordset.forEach(async function (item) {
							const getMapObjectVal = async function (mapObject) {
								let retVal = [];
								for (let key in mapObject) {
									retVal = [key, mapObject[key]];
								}
								return retVal;
							};
							if (Object.prototype.hasOwnProperty.call(importMap, item.COLUMN_NAME)) {
								if (importMap[item.COLUMN_NAME] === Object(importMap[item.COLUMN_NAME])) {
									const rowVal = await getMapObjectVal(importMap[item.COLUMN_NAME]);
									rowToImport[item.COLUMN_NAME] = rowJson[rowVal[0]][rowVal[1]];
								} else {
									rowToImport[item.COLUMN_NAME] = item.DATA_TYPE === 'int' ? parseInt(rowJson[importMap[item.COLUMN_NAME]]) : rowJson[importMap[item.COLUMN_NAME]];
								}
							} else {
								if (Object.prototype.hasOwnProperty.call(rowJson, item.COLUMN_NAME)) rowToImport[item.COLUMN_NAME] = rowJson[item.COLUMN_NAME];
							}
						});
						return rowToImport;
					} catch (error) {
						throw new Error(error);
					}
				};

Output

the content of the tag "xCADNummer" is written without leading zeros into the database although the field-type is character.

expected data

the content of the tag "xCADNummer" should be written with all leading zeros into the database ( it should be 0006 according to the xml-data.

Would you like to work on this issue? <!-- choose one by changing [ ] to [x] -->

  • [ ] Yes
  • [ ] No

Bookmark this repository for further updates.

closed time in 14 days

Reggae13

issue commentNaturalIntelligence/fast-xml-parser

parseTrueNumberOnly = true does only work if the element to parse has but one leading zero

From FXP v3.20.0, a new property numParseOptions is introduced, check configuration to get desire result.

Reggae13

comment created time in 14 days

created tagNaturalIntelligence/fast-xml-parser

tagv3.20.0

Validate XML, Parse XML to JS/JSON and vise versa, or parse XML to Nimn rapidly without C/C++ based libraries and no callback

created time in 14 days

push eventNaturalIntelligence/fast-xml-parser

Amit Gupta

commit sha 10bbdeeb6b8ab48eaefc89d63f13724702d52fb1

Use strnum npm package to parse string to number

view details

push time in 14 days

push eventNaturalIntelligence/strnum

Amit Gupta

commit sha a0bf6e5f9843c3aeca5af200114f90d4e819d7df

feat: trim

view details

push time in 14 days