Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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.3.0-alpha.4 to 1.3.0-alpha.5

6

dist/globalize-runtime.js
/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

@@ -46,2 +46,3 @@ */

var createErrorUnsupportedFeature = Globalize._createErrorUnsupportedFeature,
looseMatching = Globalize._looseMatching,
regexpEscape = Globalize._regexpEscape,

@@ -366,2 +367,3 @@ removeLiteralQuotes = Globalize._removeLiteralQuotes,

* - "+HH:mm;-HH:mm": -03:00
* - "+HH:mm:ss;-HH:mm:ss": -03:00:00
*/

@@ -397,3 +399,8 @@ var dateTimezoneHourFormat = function( date, format, timeSeparator, formatNumber ) {

.replace( /mm/, function() {
return formatNumber[ 2 ]( absOffset % 60 );
return formatNumber[ 2 ]( Math.floor( absOffset % 60 ) );
})
// Update minutes offset and return.
.replace( /ss/, function() {
return formatNumber[ 2 ]( Math.floor( absOffset % 1 * 60 ) );
});

@@ -432,3 +439,3 @@ };

properties.pattern.replace( datePatternRe, function( current ) {
var dateField, type, value,
var aux, dateField, type, value,
chr = current.charAt( 0 ),

@@ -653,2 +660,6 @@ length = current.length;

if ( current === "v" ) {
length = 1;
}
/* falls through */

@@ -662,5 +673,14 @@ case "O":

} else {
// If O..OOO and timezone offset has non-zero minutes, show minutes.
if ( length < 4 ) {
aux = date.getTimezoneOffset();
aux = properties.hourFormat[ aux % 60 - aux % 1 === 0 ? 0 : 1 ];
} else {
aux = properties.hourFormat;
}
value = dateTimezoneHourFormat(
date,
length < 4 ? "+H;-H" : properties.tzLongHourFormat,
aux,
timeSeparator,

@@ -684,6 +704,28 @@ numberFormatters

// x: hourFormat("+HH;-HH")
// xx or xxxx: hourFormat("+HHmm;-HHmm")
// xxx or xxxxx: hourFormat("+HH:mm;-HH:mm")
value = length === 1 ? "+HH;-HH" : ( length % 2 ? "+HH:mm;-HH:mm" : "+HHmm;-HHmm" );
// x: hourFormat("+HH[mm];-HH[mm]")
// xx: hourFormat("+HHmm;-HHmm")
// xxx: hourFormat("+HH:mm;-HH:mm")
// xxxx: hourFormat("+HHmm[ss];-HHmm[ss]")
// xxxxx: hourFormat("+HH:mm[:ss];-HH:mm[:ss]")
aux = date.getTimezoneOffset();
// If x and timezone offset has non-zero minutes, use xx (i.e., show minutes).
if ( length === 1 && aux % 60 - aux % 1 !== 0 ) {
length += 1;
}
// If (xxxx or xxxxx) and timezone offset has zero seconds, use xx or xxx
// respectively (i.e., don't show optional seconds).
if ( ( length === 4 || length === 5 ) && aux % 1 === 0 ) {
length -= 2;
}
value = [
"+HH;-HH",
"+HHmm;-HHmm",
"+HH:mm;-HH:mm",
"+HHmmss;-HHmmss",
"+HH:mm:ss;-HH:mm:ss"
][ length - 1 ];
value = dateTimezoneHourFormat( date, value, ":" );

@@ -1120,6 +1162,8 @@ break;

/**
* tokenizer( value, pattern, properties )
* tokenizer( value, numberParser, properties )
*
* @value [String] string date.
*
* @numberParser [Function]
*
* @properties [Object] output returned by date/tokenizer-properties.

@@ -1165,4 +1209,6 @@ *

value = looseMatching( value );
valid = properties.pattern.match( datePatternRe ).every(function( current ) {
var chr, length, numeric, tokenRe,
var aux, chr, length, numeric, tokenRe,
token = {};

@@ -1269,12 +1315,17 @@

function lookup( path ) {
var i, re,
data = properties[ path.join( "/" ) ];
var array = properties[ path.join( "/" ) ];
for ( i in data ) {
re = new RegExp( "^" + data[ i ] );
if ( re.test( value ) ) {
token.value = i;
return tokenRe = new RegExp( data[ i ] );
if ( !array ) {
return null;
}
// array of pairs [key, value] sorted by desc value length.
array.some(function( item ) {
var valueRe = item[ 1 ];
if ( valueRe.test( value ) ) {
token.value = item[ 0 ];
tokenRe = item[ 1 ];
return true;
}
}
});
return null;

@@ -1520,4 +1571,4 @@ }

}
if ( current === "v" ) {
length = 1;
if ( chr === "V" && length === 2 ) {
break;
}

@@ -1534,8 +1585,13 @@

} else {
tokenRe = hourFormatRe(
length < 4 ? "+H;-H" : properties[ "timeZoneNames/hourFormat" ],
properties[ "timeZoneNames/gmtFormat" ],
timeSeparator
);
if ( !hourFormatParse( tokenRe, numberParser ) ) {
aux = properties[ "timeZoneNames/hourFormat" ].some(function( hourFormat ) {
tokenRe = hourFormatRe(
hourFormat,
properties[ "timeZoneNames/gmtFormat" ],
timeSeparator
);
if ( hourFormatParse( tokenRe, numberParser ) ) {
return true;
}
});
if ( !aux ) {
return null;

@@ -1597,2 +1653,6 @@ }

if ( numeric && isNaN( token.value ) ) {
return false;
}
tokens.push( token );

@@ -1599,0 +1659,0 @@ return true;

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

@@ -443,2 +443,19 @@ */

/**
* Loose Matching:
* - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI
* formatting.
* - Map all characters in [:Zs:] to U+0020 SPACE;
* - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS;
*/
var looseMatching = function( value ) {
return value
.replace( regexpCfG, "" )
.replace( regexpDashG, "-" )
.replace( regexpZsG, " " );
};
/**
* parse( value, properties )

@@ -475,11 +492,3 @@ *

// Loose Matching:
// - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI
// formatting.
// - Map all characters in [:Zs:] to U+0020 SPACE;
// - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS;
value = value
.replace( regexpCfG, "" )
.replace( regexpDashG, "-" )
.replace( regexpZsG, " " );
value = looseMatching( value );

@@ -692,2 +701,3 @@ function parse( type ) {

Globalize._createErrorUnsupportedFeature = createErrorUnsupportedFeature;
Globalize._looseMatching = looseMatching;
Globalize._numberFormat = numberFormat;

@@ -694,0 +704,0 @@ Globalize._numberFormatterFn = numberFormatterFn;

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize Runtime v1.3.0-alpha.4
* Globalize Runtime v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize Runtime v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize Runtime v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/*!
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/

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

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

@@ -946,2 +946,19 @@ */

/**
* Loose Matching:
* - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI
* formatting.
* - Map all characters in [:Zs:] to U+0020 SPACE;
* - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS;
*/
var looseMatching = function( value ) {
return value
.replace( regexpCfG, "" )
.replace( regexpDashG, "-" )
.replace( regexpZsG, " " );
};
/**
* parse( value, properties )

@@ -978,11 +995,3 @@ *

// Loose Matching:
// - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI
// formatting.
// - Map all characters in [:Zs:] to U+0020 SPACE;
// - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS;
value = value
.replace( regexpCfG, "" )
.replace( regexpDashG, "-" )
.replace( regexpZsG, " " );
value = looseMatching( value );

@@ -1163,14 +1172,2 @@ function parse( type ) {

// Loose Matching:
// - Ignore all format characters, which includes RLM, LRM or ALM used to control BIDI
// formatting.
// - Map all characters in [:Zs:] to U+0020 SPACE;
// - Map all characters in [:Dash:] to U+002D HYPHEN-MINUS;
function looseMatching( value ) {
return value
.replace( regexpCfG, "" )
.replace( regexpDashG, "-" )
.replace( regexpZsG, " " );
}
prefix = looseMatching( formatProperties[ 0 ] );

@@ -1474,2 +1471,3 @@ maximumFractionDigits = formatProperties[ 4 ];

Globalize._numberSymbol = numberSymbol;
Globalize._looseMatching = looseMatching;
Globalize._removeLiteralQuotes = removeLiteralQuotes;

@@ -1476,0 +1474,0 @@ Globalize._stringPad = stringPad;

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/**
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/
/*!
* Globalize v1.3.0-alpha.4 2017-05-18T13:55Z Released under the MIT license
* Globalize v1.3.0-alpha.5 2017-05-24T13:49Z Released under the MIT license
* http://git.io/TrdQbw

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

/*!
* Globalize v1.3.0-alpha.4
* Globalize v1.3.0-alpha.5
*

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

*
* Date: 2017-05-18T13:55Z
* Date: 2017-05-24T13:49Z
*/

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

@@ -16,3 +16,4 @@ {

"build": "webpack --production --config webpack-config.js"
}
},
"cldr-data-urls-filter": "(core|dates|numbers|units)"
}

@@ -13,3 +13,4 @@ {

"jquery": "latest"
}
},
"cldr-data-urls-filter": "(core|dates|numbers|units)"
}

@@ -8,3 +8,4 @@ {

"iana-tz-data": ">=2017.0.0"
}
},
"cldr-data-urls-filter": "(core|dates|numbers|units)"
}
{
"name": "globalize",
"version": "1.3.0-alpha.4",
"version": "1.3.0-alpha.5",
"description": "A JavaScript library for internationalization and localization that leverages the official Unicode CLDR JSON data.",

@@ -77,2 +77,4 @@ "keywords": [

"cldr-data-downloader": "^0.2.5",
"glob": "^7.1.1",
"globalize-compiler": "^0.3.0-alpha.6",
"grunt": "0.4.5",

@@ -86,3 +88,3 @@ "grunt-check-dependencies": "0.6.0",

"grunt-contrib-jshint": "0.11.1",
"grunt-contrib-qunit": "0.7.0",
"grunt-contrib-qunit": "1.3.0",
"grunt-contrib-requirejs": "0.4.4",

@@ -93,5 +95,7 @@ "grunt-contrib-uglify": "0.6.0",

"grunt-jscs": "1.8.0",
"grunt-mocha-test": "^0.13.2",
"gzip-js": "0.3.2",
"iana-tz-data": "0.0.4",
"iana-tz-data": ">=2017.0.0",
"matchdep": "0.3.0",
"mocha": "^3.3.0",
"zoned-date-time": "0.0.4"

@@ -98,0 +102,0 @@ },

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

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