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

rosetty-solid

Package Overview
Dependencies
Maintainers
1
Versions
312
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rosetty-solid - npm Package Compare versions

Comparing version 1.0.34 to 1.0.35

69

dist/index.js

@@ -0,8 +1,65 @@

"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./rosetty-solid.cjs.production.min.js')
} else {
module.exports = require('./rosetty-solid.cjs.development.js')
// src/index.tsx
var src_exports = {};
__export(src_exports, {
RosettyContext: () => RosettyContext,
RosettyProvider: () => RosettyProvider,
useRosetty: () => useRosetty
});
module.exports = __toCommonJS(src_exports);
var import_rosetty = require("rosetty");
var import_solid_js = require("solid-js");
var RosettyContext = (0, import_solid_js.createContext)();
var RosettyProvider = (props) => {
const r = (0, import_solid_js.createMemo)(
() => (0, import_rosetty.rosetty)(props.languages, props.defaultLanguage, props.translateFallback),
[]
);
const [actualLang, setActualLang] = (0, import_solid_js.createSignal)(props.defaultLanguage);
const changeLang = (lang) => {
r().changeLang(lang);
setActualLang(r().getCurrentLang());
};
return /* @__PURE__ */ React.createElement(
RosettyContext.Provider,
{
value: () => ({
...r(),
actualLang,
changeLang
})
},
props.children
);
};
function useRosetty() {
const client = (0, import_solid_js.useContext)(RosettyContext);
if (!client) {
throw new Error("No RosettyClient set, use RosettyProvider to set one");
}
return client();
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
RosettyContext,
RosettyProvider,
useRosetty
});

34

package.json
{
"version": "1.0.34",
"version": "1.0.35",
"license": "MIT",

@@ -21,14 +21,5 @@ "main": "dist/index.js",

},
"scripts": {
"start": "tsdx watch",
"build": "tsdx build",
"test": "jest",
"lint": "eslint src test",
"prepare": "tsdx build",
"size": "size-limit",
"analyze": "size-limit --why"
},
"husky": {
"hooks": {
"pre-commit": "tsdx lint"
"pre-commit": "pnpm lint"
}

@@ -103,11 +94,20 @@ },

"ts-jest": "^29.1.0",
"tsdx": "0.14.1",
"tslib": "2.6.2",
"typescript": "5.2.2"
"tsup": "^8.0.0",
"typescript": "5.2.2",
"babel-preset-solid": "^1.7.7"
},
"peerDependencies": {
"solid-js": "^1.7.11"
},
"dependencies": {
"babel-preset-solid": "^1.7.7",
"rosetty": "^2.0.0",
"solid-js": "^1.7.11"
"rosetty": "^2.0.0"
},
"scripts": {
"build": "tsup src/index.tsx",
"test": "jest",
"lint": "eslint src test",
"size": "size-limit",
"analyze": "size-limit --why"
}
}
}
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