@linaria/utils
Advanced tools
Comparing version 4.0.0-beta.0 to 4.0.0-beta.1
@@ -18,8 +18,8 @@ /* eslint-disable no-restricted-syntax */ | ||
export function reference(path, referencePath) { | ||
if (!path.isReferencedIdentifier()) return; | ||
export function reference(path, referencePath = path, force = false) { | ||
if (!force && !path.isReferencedIdentifier()) return; | ||
const binding = getBinding(path); | ||
if (!binding) return; | ||
if (binding.referencePaths.includes(referencePath ?? path)) { | ||
if (binding.referencePaths.includes(referencePath)) { | ||
return; | ||
@@ -49,3 +49,2 @@ } | ||
export function dereference(path) { | ||
if (!path.isReferencedIdentifier()) return null; | ||
const binding = getBinding(path); | ||
@@ -52,0 +51,0 @@ if (!binding) return null; |
@@ -38,8 +38,8 @@ "use strict"; | ||
function reference(path, referencePath) { | ||
if (!path.isReferencedIdentifier()) return; | ||
function reference(path, referencePath = path, force = false) { | ||
if (!force && !path.isReferencedIdentifier()) return; | ||
const binding = getBinding(path); | ||
if (!binding) return; | ||
if (binding.referencePaths.includes(referencePath !== null && referencePath !== void 0 ? referencePath : path)) { | ||
if (binding.referencePaths.includes(referencePath)) { | ||
return; | ||
@@ -69,3 +69,2 @@ } | ||
function dereference(path) { | ||
if (!path.isReferencedIdentifier()) return null; | ||
const binding = getBinding(path); | ||
@@ -72,0 +71,0 @@ if (!binding) return null; |
{ | ||
"name": "@linaria/utils", | ||
"description": "Blazing fast zero-runtime CSS in JS library", | ||
"version": "4.0.0-beta.0", | ||
"version": "4.0.0-beta.1", | ||
"bugs": "https://github.com/callstack/linaria/issues", | ||
"dependencies": { | ||
"@babel/core": "^7.18.2", | ||
"@babel/core": "^7.18.9", | ||
"@babel/plugin-proposal-export-namespace-from": ">=7", | ||
"@babel/plugin-syntax-dynamic-import": ">=7", | ||
"@babel/plugin-transform-modules-commonjs": "^7.18.2", | ||
"@babel/traverse": ">=7", | ||
"@babel/types": "^7.18.4", | ||
"@linaria/logger": "^4.0.0-beta.0", | ||
"@babel/traverse": "^7.18.9", | ||
"@babel/types": "^7.18.9", | ||
"@linaria/logger": "^4.0.0-beta.1", | ||
"babel-merge": "^3.0.0" | ||
@@ -15,0 +15,0 @@ }, |
@@ -28,3 +28,3 @@ <p align="center"> | ||
```sh | ||
npm install @linaria/core @linaria/react @linaria/babel-preset @linaria/shaker | ||
npm install @linaria/core @linaria/react @linaria/babel-preset | ||
``` | ||
@@ -35,3 +35,3 @@ | ||
```sh | ||
yarn add @linaria/core @linaria/react @linaria/babel-preset @linaria/shaker | ||
yarn add @linaria/core @linaria/react @linaria/babel-preset | ||
``` |
import type { Binding, NodePath } from '@babel/traverse'; | ||
import type { Identifier, JSXIdentifier } from '@babel/types'; | ||
export declare function reference(path: NodePath<Identifier | JSXIdentifier>, referencePath?: NodePath): void; | ||
export declare function reference(path: NodePath<Identifier | JSXIdentifier>, referencePath?: NodePath, force?: boolean): void; | ||
export declare function dereference(path: NodePath<Identifier | JSXIdentifier>): Binding | null; | ||
@@ -5,0 +5,0 @@ export declare function referenceAll(path: NodePath): void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
325690
3431
Updated@babel/core@^7.18.9
Updated@babel/traverse@^7.18.9
Updated@babel/types@^7.18.9