moimikey / iso3166-1 Goto Github PK
View Code? Open in Web Editor NEW🇺🇸 The smallest, fastest, node module for ISO 3166-1 alpha 2/3 helper lookup/parser. Browserify/Webpack friendly.
License: MIT License
🇺🇸 The smallest, fastest, node module for ISO 3166-1 alpha 2/3 helper lookup/parser. Browserify/Webpack friendly.
License: MIT License
See dominictarr/event-stream#115
Versions of event-stream above 3.3.4 contain malcious code.
In your package's lock file the version is set to 3.3.4 which is not affected -> current dist is fine.
However, please also restrict version in package.json to exactly 3.3.4 too.
There's a potential use case for converting .to2()
or .to3()
and chained with .is2()
and .is3()
respectively. not an imperative addition, but has potential as an enhancement.
noticed uglifyjs verbose output:
util.error: Use console.error instead
WARN: Dropping unused function argument exports [-:1629,33]
util.error: Use console.error instead
WARN: Dropping unused function argument index [-:1785,53]
util.error: Use console.error instead
WARN: Dropping unused function argument name [-:1973,28]
util.error: Use console.error instead
WARN: Dropping unused function argument dir [-:1979,26]
...
https://github.com/moimikey/iso3166-1/blob/master/build/iso3166-1.global.min.js
https://github.com/moimikey/iso3166-1/blob/master/build/iso3166-1.min.js
Hola! I'm not sure if this is something that can be fixed in this module, but IE11 seems to have some some issues with fromString
method of `buffer. Trying to look for a fix and I'll open a PR if I find one but maybe you have some ideas as well?
similar to
Hey,
First of all, thanks for your great library. I've seen that the browserified build (iso3166-1.global.js) differs from the version in src/.
The file »src/iso3166-1/index.j2« includes the following function, which i miss inside the build.
var is3 = function is3(alpha3) {
return ISOCodes.some(function(row) {
return row.alpha3 === alpha3
})
}
Is it possible to rebuild the project and commit the build files?
That would be great!
I could also create a PR for that!?
Thanks!
René
var locale = require('locale2');
var iso31661 = require('iso3166-1');
var alpha2 = iso31661.lookup(locale).alpha3;
var alpha3 = iso31661.lookup(locale).alpha2;
> var iso3166 = require('iso3166-1')
Error: Cannot find module 'zlib-browserify'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/james/Code/BlueMix/stack-overflow/node_modules/iso3166-1/src/index.js:2:14)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Trying the basic example in my app, it works fine with to3()
but fails with to2()
.
Cannot read property 'alpha2' of undefined
TypeError: Cannot read property 'alpha2' of undefined
at Object.b [as to2] (/Users/vadorequest/dev/loan-advisor/node_modules/iso3166-1/dist/iso3166-1.js:3:11181)
at Object../hoc/withData.js (/Users/vadorequest/dev/loan-advisor/hoc/withData.js:16:5)
at __webpack_require__ (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/webpack/bootstrap b368674930c3372dd65a:21:1)
at Object../pages/school/index.js (/Users/vadorequest/dev/loan-advisor/pages/school/index.js:18:1)
at __webpack_require__ (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/webpack/bootstrap b368674930c3372dd65a:21:1)
at Object.2 (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/school.js:3556:18)
at __webpack_require__ (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/webpack/bootstrap b368674930c3372dd65a:21:1)
at module.exports../components/Bloc.js.Object.defineProperty.value (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/webpack/bootstrap b368674930c3372dd65a:68:1)
at Object.<anonymous> (/Users/vadorequest/dev/loan-advisor/.next/dist/bundles/pages/school.js:73:10)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
With the following source code:
import locale2 from 'locale2';
import iso3166 from 'iso3166-1';
console.log(locale2)
console.log(iso3166.fromLocale(locale2))
console.log(iso3166.fromLocale(locale2).to2())
Tested on both Chrome latest and Firefox, same result
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.