@remix-run/server-runtime
Advanced tools
Comparing version 1.3.4 to 1.3.5-pre.1
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -101,3 +101,3 @@ * Copyright (c) Remix Software Inc. | ||
function encodeData(value) { | ||
return btoa(JSON.stringify(value)); | ||
return btoa(myUnescape(encodeURIComponent(JSON.stringify(value)))); | ||
} | ||
@@ -107,9 +107,79 @@ | ||
try { | ||
return JSON.parse(atob(value)); | ||
return JSON.parse(decodeURIComponent(myEscape(atob(value)))); | ||
} catch (error) { | ||
return {}; | ||
} | ||
} // See: https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.escape.js | ||
function myEscape(value) { | ||
let str = value.toString(); | ||
let result = ""; | ||
let index = 0; | ||
let chr, code; | ||
while (index < str.length) { | ||
chr = str.charAt(index++); | ||
if (/[\w*+\-./@]/.exec(chr)) { | ||
result += chr; | ||
} else { | ||
code = chr.charCodeAt(0); | ||
if (code < 256) { | ||
result += "%" + hex(code, 2); | ||
} else { | ||
result += "%u" + hex(code, 4).toUpperCase(); | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
function hex(code, length) { | ||
let result = code.toString(16); | ||
while (result.length < length) result = "0" + result; | ||
return result; | ||
} // See: https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.unescape.js | ||
function myUnescape(value) { | ||
let str = value.toString(); | ||
let result = ""; | ||
let index = 0; | ||
let chr, part; | ||
while (index < str.length) { | ||
chr = str.charAt(index++); | ||
if (chr === "%") { | ||
if (str.charAt(index) === "u") { | ||
part = str.slice(index + 1, index + 5); | ||
if (/^[\da-f]{4}$/i.exec(part)) { | ||
result += String.fromCharCode(parseInt(part, 16)); | ||
index += 5; | ||
continue; | ||
} | ||
} else { | ||
part = str.slice(index, index + 2); | ||
if (/^[\da-f]{2}$/i.exec(part)) { | ||
result += String.fromCharCode(parseInt(part, 16)); | ||
index += 2; | ||
continue; | ||
} | ||
} | ||
} | ||
result += chr; | ||
} | ||
return result; | ||
} | ||
exports.createCookieFactory = createCookieFactory; | ||
exports.isCookie = isCookie; |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -97,3 +97,3 @@ * Copyright (c) Remix Software Inc. | ||
function encodeData(value) { | ||
return btoa(JSON.stringify(value)); | ||
return btoa(myUnescape(encodeURIComponent(JSON.stringify(value)))); | ||
} | ||
@@ -103,8 +103,78 @@ | ||
try { | ||
return JSON.parse(atob(value)); | ||
return JSON.parse(decodeURIComponent(myEscape(atob(value)))); | ||
} catch (error) { | ||
return {}; | ||
} | ||
} // See: https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.escape.js | ||
function myEscape(value) { | ||
let str = value.toString(); | ||
let result = ""; | ||
let index = 0; | ||
let chr, code; | ||
while (index < str.length) { | ||
chr = str.charAt(index++); | ||
if (/[\w*+\-./@]/.exec(chr)) { | ||
result += chr; | ||
} else { | ||
code = chr.charCodeAt(0); | ||
if (code < 256) { | ||
result += "%" + hex(code, 2); | ||
} else { | ||
result += "%u" + hex(code, 4).toUpperCase(); | ||
} | ||
} | ||
} | ||
return result; | ||
} | ||
function hex(code, length) { | ||
let result = code.toString(16); | ||
while (result.length < length) result = "0" + result; | ||
return result; | ||
} // See: https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/es.unescape.js | ||
function myUnescape(value) { | ||
let str = value.toString(); | ||
let result = ""; | ||
let index = 0; | ||
let chr, part; | ||
while (index < str.length) { | ||
chr = str.charAt(index++); | ||
if (chr === "%") { | ||
if (str.charAt(index) === "u") { | ||
part = str.slice(index + 1, index + 5); | ||
if (/^[\da-f]{4}$/i.exec(part)) { | ||
result += String.fromCharCode(parseInt(part, 16)); | ||
index += 5; | ||
continue; | ||
} | ||
} else { | ||
part = str.slice(index, index + 2); | ||
if (/^[\da-f]{2}$/i.exec(part)) { | ||
result += String.fromCharCode(parseInt(part, 16)); | ||
index += 2; | ||
continue; | ||
} | ||
} | ||
} | ||
result += chr; | ||
} | ||
return result; | ||
} | ||
export { createCookieFactory, isCookie }; |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
{ | ||
"name": "@remix-run/server-runtime", | ||
"description": "Server runtime for Remix", | ||
"version": "1.3.4", | ||
"version": "1.3.5-pre.1", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "./index.js", |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
@@ -81,3 +81,3 @@ import type { Location } from "history"; | ||
title?: string; | ||
[name: string]: null | string | string[] | undefined | Record<string, string> | Record<string, string>[]; | ||
[name: string]: null | string | undefined | Record<string, string> | Array<Record<string, string> | string>; | ||
} | ||
@@ -84,0 +84,0 @@ export declare type MetaDescriptor = HtmlMetaDescriptor; |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
/** | ||
* @remix-run/server-runtime v1.3.4 | ||
* @remix-run/server-runtime v1.3.5-pre.1 | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc. |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
118483
3285
2