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

remix-typedjson

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remix-typedjson - npm Package Compare versions

Comparing version 0.4.1 to 0.5.1-pre.0

dist/csj/index.d.ts

27

dist/esm/remix.js

@@ -19,20 +19,17 @@ import { jsx as _jsx } from "react/jsx-runtime";

// resolved data and add the meta to the response
Object.entries(data).forEach(([key, value]) => {
let d = data;
Object.entries(d).forEach(([key, value]) => {
if (value instanceof Promise) {
;
data[key] = value.then(resolvedData => {
const { meta } = _typedjson.serialize(resolvedData);
d[key] = value.then(resolvedData => {
let rd = resolvedData;
const { meta } = _typedjson.serialize(rd);
if (meta) {
;
resolvedData['$$meta'] = meta;
rd['$$meta'] = meta;
}
return resolvedData;
return rd;
});
}
else {
const { meta } = _typedjson.serialize(data);
if (meta) {
;
data['$$meta'] = meta;
}
const { meta } = _typedjson.serialize(data);
if (meta) {
d['$$meta'] = meta;
}

@@ -99,5 +96,5 @@ });

// handle object with $$meta key
// remove before applying meta
// no longer remove $$meta as Remix will stringify the data again
// during defer and we will lose the type data
const meta = data.$$meta;
delete data.$$meta;
return _typedjson.applyMeta(data, meta);

@@ -104,0 +101,0 @@ }

@@ -120,3 +120,9 @@ let customTypeMap = new Map();

}
const json = JSON.stringify(data, replacer);
let json = '';
if (Array.isArray(data)) {
json = JSON.stringify(data.map(value => serialize(value)));
}
else {
json = JSON.stringify(data, replacer);
}
return {

@@ -123,0 +129,0 @@ json,

{
"name": "remix-typedjson",
"version": "0.4.1",
"version": "0.5.1-pre.0",
"description": "This package is a replacement for superjson to use in your Remix app. It handles a subset of types that `superjson` supports, but is faster and smaller.",
"browser": "/dist/esm/index.js",
"main": "./dist/index.js",
"type": "module",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js"
},
"main": "./dist/cjs/index.js",
"sideEffects": false,

@@ -26,4 +30,4 @@ "author": "Michael J. Carter <kiliman@gmail.com> (https://kiliman.dev/)",

"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc --project tsconfig.build.json --module ESNext --outDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.build.json --module CommonJS --outDir ./dist",
"build:esm": "tsc --project tsconfig.build.json --module ESNext --outDir ./dist/esm && echo '{\"type\": \"module\"}' > ./dist/esm/package.json",
"build:cjs": "tsc --project tsconfig.build.json --module CommonJS --outDir ./dist/csj && echo '{\"type\": \"commonjs\"}' > ./dist/csj/package.json",
"typecheck": "tsc --project tsconfig.json --noEmit",

@@ -53,2 +57,3 @@ "lint": "eslint --ext .ts,.tsx src/",

"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"prettier": "^3.1.0",

@@ -55,0 +60,0 @@ "react": "^18.2.0",

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