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

@preply/ds-rn-core

Package Overview
Dependencies
Maintainers
7
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@preply/ds-rn-core - npm Package Compare versions

Comparing version 0.16.1-beta.f65d5ef382f667fdc418e587de541aeb216cb5be.129 to 0.16.1-beta.fcd62fd93212d750cc3040e42a66ec999ce1719d.140

dist/token/hooks/useGetToken.d.ts

3

dist/index.js

@@ -10,3 +10,4 @@ export { colorSchemes } from './color-scheme/colorSchemes.js';

export { useThemes } from './theme/hooks/useThemes.js';
export { useGetToken } from './token/hooks/useGetToken.js';
export { useToken } from './token/hooks/useToken.js';
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7In0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OyJ9

@@ -1,6 +0,5 @@

import { TOKEN_ID_FIELD } from '@preply/ds-core';
import { getToken } from '../private/getToken.js';
import { useTheme } from '../../theme/hooks/useTheme.js';
import { useColorScheme } from '../../color-scheme/hooks/useColorScheme.js';
const ERROR_MESSAGE = 'Please check the last call of useToken(). Are you using indexes? Example: "tokens.action.size[size]". Make sure it resolves to a token.';
function useToken(token) {

@@ -12,17 +11,6 @@ const { theme } = useTheme();

}
if (!token) {
throw new Error(`No token provided. ${ERROR_MESSAGE}`);
}
if (!Array.isArray(token)) {
throw new Error(`Value provided is not a token. ${ERROR_MESSAGE}`);
}
const value = theme.getToken(token, colorScheme);
if (typeof value === 'undefined') {
const id = token[TOKEN_ID_FIELD];
throw new Error(`Token ${id} not found`);
}
return value;
return getToken(token, theme, colorScheme);
}
export { useToken };
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlVG9rZW4uanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90b2tlbi9ob29rcy91c2VUb2tlbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFRva2VuLCBUb2tlblZhbHVlIH0gZnJvbSAnQHByZXBseS9kcy1jb3JlJztcbmltcG9ydCB7IFRPS0VOX0lEX0ZJRUxEIH0gZnJvbSAnQHByZXBseS9kcy1jb3JlJztcblxuaW1wb3J0IHsgdXNlQ29sb3JTY2hlbWUgfSBmcm9tICcuLi8uLi9jb2xvci1zY2hlbWUnO1xuaW1wb3J0IHsgdXNlVGhlbWUgfSBmcm9tICcuLi8uLi90aGVtZSc7XG5cbmNvbnN0IEVSUk9SX01FU1NBR0UgPVxuICAgICdQbGVhc2UgY2hlY2sgdGhlIGxhc3QgY2FsbCBvZiB1c2VUb2tlbigpLiBBcmUgeW91IHVzaW5nIGluZGV4ZXM/IEV4YW1wbGU6IFwidG9rZW5zLmFjdGlvbi5zaXplW3NpemVdXCIuIE1ha2Ugc3VyZSBpdCByZXNvbHZlcyB0byBhIHRva2VuLic7XG5cbmV4cG9ydCBmdW5jdGlvbiB1c2VUb2tlbjxUIGV4dGVuZHMgVG9rZW5WYWx1ZT4odG9rZW46IFRva2VuKTogVCB7XG4gICAgY29uc3QgeyB0aGVtZSB9ID0gdXNlVGhlbWUoKTtcbiAgICBjb25zdCB7IGNvbG9yU2NoZW1lIH0gPSB1c2VDb2xvclNjaGVtZSgpO1xuXG4gICAgaWYgKCF0aGVtZSkge1xuICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ3VzZVRva2VuKCkgbXVzdCBiZSB1c2VkIHdpdGhpbiB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ZSB9ID0gdXNlQ29sb3JTY2hlbWUoKTtcblxuICAgIGlmICghdGhlbWUpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCd1c2VUb2tlbigpIG11c3QgYmUgdXNlZCB3aXRoaW4gYSBUaGVtZVByb3ZpZGVyJyk7XG4gICAgfVxuXG4gICAgcmV0dXJuIGdldFRva2VuKHRva2VuLCB0aGVtZSwgY29sb3JTY2hlbWUpIGFzIFQ7XG59XG4iXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztTQU1nQixRQUFRLENBQXVCLEtBQVk7SUFDdkQsTUFBTSxFQUFFLEtBQUssRUFBRSxHQUFHLFFBQVEsRUFBRSxDQUFDO0lBQzdCLE1BQU0sRUFBRSxXQUFXLEVBQUUsR0FBRyxjQUFjLEVBQUUsQ0FBQztJQUV6QyxJQUFJLENBQUMsS0FBSyxFQUFFO1FBQ1IsTUFBTSxJQUFJLEtBQUssQ0FBQyxnREFBZ0QsQ0FBQyxDQUFDO0tBQ3JFO0lBRUQsT0FBTyxRQUFRLENBQUMsS0FBSyxFQUFFLEtBQUssRUFBRSxXQUFXLENBQU0sQ0FBQztBQUNwRDs7OzsifQ==

@@ -0,1 +1,2 @@

export { useGetToken } from './hooks/useGetToken';
export { useToken } from './hooks/useToken';

@@ -0,2 +1,3 @@

export { useGetToken } from './hooks/useGetToken.js';
export { useToken } from './hooks/useToken.js';
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOyJ9
{
"name": "@preply/ds-rn-core",
"version": "0.16.1-beta.f65d5ef382f667fdc418e587de541aeb216cb5be.129+f65d5ef",
"version": "0.16.1-beta.fcd62fd93212d750cc3040e42a66ec999ce1719d.140+fcd62fd",
"publishConfig": {

@@ -21,3 +21,3 @@ "access": "public"

"dependencies": {
"@preply/ds-core": "^0.16.1-beta.f65d5ef382f667fdc418e587de541aeb216cb5be.129+f65d5ef"
"@preply/ds-core": "^0.16.1-beta.fcd62fd93212d750cc3040e42a66ec999ce1719d.140+fcd62fd"
},

@@ -29,3 +29,3 @@ "peerDependencies": {

},
"gitHead": "f65d5ef382f667fdc418e587de541aeb216cb5be"
"gitHead": "fcd62fd93212d750cc3040e42a66ec999ce1719d"
}
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