Socket
Socket
Sign inDemoInstall

globalize

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globalize - npm Package Compare versions

Comparing version 1.4.0-alpha.2 to 1.4.0-alpha.3

examples/app-npm-webpack-2/.npmignore

6

dist/globalize-runtime.js
/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -218,6 +218,2 @@ */

// Get number at two extra significant figure precision.
number = number.toPrecision( precision + 2 );
// Then, round it to the required significant figure precision.
roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) );

@@ -224,0 +220,0 @@ roundOrder -= precision;

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize Runtime v1.4.0-alpha.2
* Globalize Runtime v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize Runtime v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize Runtime v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/*!
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/

@@ -13,0 +13,0 @@ (function( root, factory ) {

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -232,6 +232,2 @@ */

// Get number at two extra significant figure precision.
number = number.toPrecision( precision + 2 );
// Then, round it to the required significant figure precision.
roundOrder = Math.ceil( Math.log( Math.abs( number ) ) / Math.log( 10 ) );

@@ -238,0 +234,0 @@ roundOrder -= precision;

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/**
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,6 +10,6 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/
/*!
* Globalize v1.4.0-alpha.2 2018-03-09T13:51Z Released under the MIT license
* Globalize v1.4.0-alpha.3 2018-06-22T12:51Z Released under the MIT license
* http://git.io/TrdQbw

@@ -16,0 +16,0 @@ */

/*!
* Globalize v1.4.0-alpha.2
* Globalize v1.4.0-alpha.3
*

@@ -10,3 +10,3 @@ * http://github.com/jquery/globalize

*
* Date: 2018-03-09T13:51Z
* Date: 2018-06-22T12:51Z
*/

@@ -13,0 +13,0 @@

@@ -82,2 +82,1 @@ var Globalize = require( "globalize" );

}, 1000);

@@ -6,14 +6,13 @@ {

"globalize": "^1.3.0",
"globalize-webpack-plugin": "0.4.x",
"html-webpack-plugin": "^1.1.0",
"globalize-webpack-plugin": "^2.1.0",
"html-webpack-plugin": "^2.30.1",
"iana-tz-data": "^2017.1.0",
"nopt": "^3.0.3",
"webpack": "^1.9.0",
"webpack-dev-server": "^1.9.0"
"webpack": "^3.11.0",
"webpack-dev-server": "^2.11.1"
},
"scripts": {
"start": "webpack-dev-server --config webpack-config.js --hot --progress --colors --inline",
"build": "webpack --production --config webpack-config.js"
"build": "NODE_ENV=production webpack --config webpack-config.js"
},
"cldr-data-urls-filter": "(core|dates|numbers|units)"
}
var webpack = require( "webpack" );
var path = require("path");
var CommonsChunkPlugin = require( "webpack/lib/optimize/CommonsChunkPlugin" );
var HtmlWebpackPlugin = require( "html-webpack-plugin" );
var GlobalizePlugin = require( "globalize-webpack-plugin" );
var nopt = require( "nopt" );
var options = nopt({
production: Boolean
});
var production = process.env.NODE_ENV === "production";
var globalizeCompiledDataRegex = new RegExp( /^(globalize\-compiled\-data)\-\S+$/ );
function subLocaleNames( name ) {
return name.replace( globalizeCompiledDataRegex, "$1" );
}
module.exports = {
entry: options.production ? {
entry: {
main: "./app/index.js",
vendor: [
"globalize",
"globalize/dist/globalize-runtime/number",
"globalize/dist/globalize-runtime/currency",
"globalize/dist/globalize-runtime/date",
"globalize/dist/globalize-runtime/message",
"globalize/dist/globalize-runtime/plural",
"globalize/dist/globalize-runtime/relative-time",
"globalize/dist/globalize-runtime/unit"
]
} : "./app/index.js",
debug: !options.production,
},
output: {
path: options.production ? "./dist" : "./tmp",
publicPath: options.production ? "" : "http://localhost:8080/",
filename: options.production ? "app.[hash].js" : "app.js"
path: path.join( __dirname, production ? "./dist" : "./tmp" ),
publicPath: production ? "" : "http://localhost:8080/",
chunkFilename: "[name].[chunkhash].js",
filename: production ? "[name].[chunkhash].js" : "app.js"
},
resolve: {
extensions: [ "", ".js" ]
extensions: [ "*", ".js" ]
},
plugins: [
new HtmlWebpackPlugin({
production: options.production,
template: "./index-template.html"
template: "./index-template.html",
// filter to a single compiled globalize language
// change 'en' to language of choice or remove inject all languages
// NOTE: last language will be set language
chunks: [ "vendor", "globalize-compiled-data-en", "main" ],
chunksSortMode: function ( c1, c2 ) {
var orderedChunks = [ "vendor", "globalize-compiled-data", "main" ];
var o1 = orderedChunks.indexOf( subLocaleNames( c1.names[ 0 ]));
var o2 = orderedChunks.indexOf( subLocaleNames( c2.names[ 0 ]));
return o1 - o2;
},
}),
new GlobalizePlugin({
production: options.production,
production: production,
developmentLocale: "en",
supportedLocales: [ "ar", "de", "en", "es", "pt", "ru", "zh" ],
messages: "messages/[locale].json",
output: "i18n/[locale].[hash].js"
output: "i18n/[locale].[chunkhash].js"
})
].concat( options.production ? [
new webpack.optimize.DedupePlugin(),
new CommonsChunkPlugin( "vendor", "vendor.[hash].js" ),
].concat( production ? [
new CommonsChunkPlugin({
name: "vendor",
minChunks: function(module) {
return (
module.context && module.context.indexOf("node_modules") !== -1
);
}
}),
new webpack.optimize.UglifyJsPlugin({

@@ -50,0 +58,0 @@ compress: {

var like, number;
// Set default locale as "en".
Globalize.locale( "en" );
// Use Globalize to format dates.

@@ -7,0 +4,0 @@ document.getElementById( "date" ).textContent = Globalize.formatDate( new Date(), {

@@ -22,3 +22,3 @@ # Hello World (plain javascript)

1. Click at [Globalize releases tab](https://github.com/rxaviers/globalize/releases).
1. Click at [Globalize releases tab](https://github.com/globalizejs/globalize/releases).
1. Download the latest package.

@@ -25,0 +25,0 @@ 1. Unzip it.

{
"name": "globalize",
"version": "1.4.0-alpha.2",
"version": "1.4.0-alpha.3",
"description": "A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -260,3 +260,3 @@ # Globalize

- [Application example using webpack and npm](examples/app-npm-webpack/): easy to get started, automated CLDR loading and precompilation for production, but requires npm and webpack knowledge.
- [Application example using globalize-express middleware with any express web app](https://github.com/devangnegandhi/globalize-express/tree/master/example): easy to incorporate globalize as a middleware within your express web add. (also checkout [globalize-express](https://github.com/devangnegandhi/globalize))
- [Application example using globalize-express middleware with any express web app](https://github.com/devangnegandhi/globalize-express/tree/master/example): easy to incorporate globalize as a middleware within your Express web app. (also checkout [globalize-express](https://github.com/devangnegandhi/globalize))

@@ -263,0 +263,0 @@ If you're using a different tool than the one above, but you're comfortable using JavaScript modules (such as ES6 modules, CommonJS, or AMD) and package managers like npm or bower, you may want to check out the following examples. Note you'll need to compile your code for production yourself.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc