Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rcu",
"version": "0.3.0",
"version": "0.3.1",
"description": "Utilities for implementing Ractive.js component loaders",
"license": "MIT",
"repository": "https://github.com/ractivejs/rcu",
Expand Down
72 changes: 37 additions & 35 deletions rcu.amd.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*

rcu (Ractive component utils) - 0.3.0 - 2014-10-08
rcu (Ractive component utils) - 0.3.1 - 2015-01-05
==============================================================

Copyright 2014 Rich Harris and contributors
Copyright 2015 Rich Harris and contributors
Released under the MIT license.

*/
Expand Down Expand Up @@ -41,7 +41,7 @@ define( function() {
},
includeLinePositions: true
} );
if ( parsed.v !== 1 ) {
if ( parsed.v < 1 ) {
throw new Error( 'Mismatched template version! Please ensure you are using the latest version of Ractive.js in your build process as well as in your app' );
}
links = [];
Expand Down Expand Up @@ -145,13 +145,13 @@ define( function() {
}( getName );
/*

eval2.js - 0.2.0 - 2014-09-28
==============================================================
eval2.js - 0.2.0 - 2014-09-28
==============================================================

Copyright 2014 Rich Harris
Released under the MIT license.
Copyright 2014 Rich Harris
Released under the MIT license.

*/
*/
eval2 = function() {
var _eval, isBrowser, isNode, head, Module, base64Encode;
// This causes code to be eval'd in the global scope
Expand Down Expand Up @@ -237,7 +237,8 @@ define( function() {
}

function clone( obj ) {
var cloned = {}, key;
var cloned = {},
key;
for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
cloned[ key ] = obj[ key ];
Expand All @@ -249,9 +250,10 @@ define( function() {
}();
( function( global ) {
var vlq = {
encode: encode,
decode: decode
}, charToInteger, integerToChar;
encode: encode,
decode: decode
},
charToInteger, integerToChar;
charToInteger = {};
integerToChar = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function( char, i ) {
Expand Down Expand Up @@ -294,31 +296,31 @@ define( function() {
}

function decode( string ) {
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
}
}
return result;
}
return result;
}
// Export as AMD
// Export as AMD
if ( true ) {
_vlq_ = function() {
return typeof vlq === 'function' ? vlq() : vlq;
Expand Down
62 changes: 32 additions & 30 deletions rcu.es6.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*

rcu (Ractive component utils) - 0.3.0 - 2014-10-08
rcu (Ractive component utils) - 0.3.1 - 2015-01-05
==============================================================

Copyright 2014 Rich Harris and contributors
Copyright 2015 Rich Harris and contributors
Released under the MIT license.

*/
Expand Down Expand Up @@ -37,7 +37,7 @@ parse = function( getName ) {
},
includeLinePositions: true
} );
if ( parsed.v !== 1 ) {
if ( parsed.v < 1 ) {
throw new Error( 'Mismatched template version! Please ensure you are using the latest version of Ractive.js in your build process as well as in your app' );
}
links = [];
Expand Down Expand Up @@ -233,7 +233,8 @@ eval2 = function() {
}

function clone( obj ) {
var cloned = {}, key;
var cloned = {},
key;
for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
cloned[ key ] = obj[ key ];
Expand All @@ -245,9 +246,10 @@ eval2 = function() {
}();
( function( global ) {
var vlq = {
encode: encode,
decode: decode
}, charToInteger, integerToChar;
encode: encode,
decode: decode
},
charToInteger, integerToChar;
charToInteger = {};
integerToChar = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function( char, i ) {
Expand Down Expand Up @@ -290,31 +292,31 @@ eval2 = function() {
}

function decode( string ) {
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
}
}
return result;
}
return result;
}
// Export as AMD
// Export as AMD
if ( true ) {
_vlq_ = function() {
return typeof vlq === 'function' ? vlq() : vlq;
Expand Down
72 changes: 37 additions & 35 deletions rcu.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*

rcu (Ractive component utils) - 0.3.0 - 2014-10-08
rcu (Ractive component utils) - 0.3.1 - 2015-01-05
==============================================================

Copyright 2014 Rich Harris and contributors
Copyright 2015 Rich Harris and contributors
Released under the MIT license.

*/
Expand Down Expand Up @@ -41,7 +41,7 @@
},
includeLinePositions: true
} );
if ( parsed.v !== 1 ) {
if ( parsed.v < 1 ) {
throw new Error( 'Mismatched template version! Please ensure you are using the latest version of Ractive.js in your build process as well as in your app' );
}
links = [];
Expand Down Expand Up @@ -145,13 +145,13 @@
}( getName );
/*

eval2.js - 0.2.0 - 2014-09-28
==============================================================
eval2.js - 0.2.0 - 2014-09-28
==============================================================

Copyright 2014 Rich Harris
Released under the MIT license.
Copyright 2014 Rich Harris
Released under the MIT license.

*/
*/
eval2 = function() {
var _eval, isBrowser, isNode, head, Module, base64Encode;
// This causes code to be eval'd in the global scope
Expand Down Expand Up @@ -237,7 +237,8 @@
}

function clone( obj ) {
var cloned = {}, key;
var cloned = {},
key;
for ( key in obj ) {
if ( obj.hasOwnProperty( key ) ) {
cloned[ key ] = obj[ key ];
Expand All @@ -249,9 +250,10 @@
}();
( function( global ) {
var vlq = {
encode: encode,
decode: decode
}, charToInteger, integerToChar;
encode: encode,
decode: decode
},
charToInteger, integerToChar;
charToInteger = {};
integerToChar = {};
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split( '' ).forEach( function( char, i ) {
Expand Down Expand Up @@ -294,31 +296,31 @@
}

function decode( string ) {
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
var result = [],
len = string.length,
i, hasContinuationBit, shift = 0,
value = 0;
for ( i = 0; i < len; i += 1 ) {
integer = charToInteger[ string[ i ] ];
if ( integer === undefined ) {
throw new Error( 'Invalid character (' + string[ i ] + ')' );
}
hasContinuationBit = integer & 32;
integer &= 31;
value += integer << shift;
if ( hasContinuationBit ) {
shift += 5;
} else {
shouldNegate = value & 1;
value >>= 1;
result.push( shouldNegate ? -value : value );
// reset
value = shift = 0;
}
}
return result;
}
return result;
}
// Export as AMD
// Export as AMD
if ( true ) {
_vlq_ = function() {
return typeof vlq === 'function' ? vlq() : vlq;
Expand Down
Loading