@getlang/lib
Advanced tools
Comparing version 0.1.0 to 0.1.1
# @getlang/lib | ||
## 0.1.1 | ||
### Patch Changes | ||
- [#14](https://github.com/getlang-dev/get/pull/14) [`58e9988`](https://github.com/getlang-dev/get/commit/58e99887e39956ee1e3eaf669cb92fbfa188a022) Thanks [@mattfysh](https://github.com/mattfysh)! - add contextual identifier to slices reference converted or raw context | ||
- Updated dependencies [[`58e9988`](https://github.com/getlang-dev/get/commit/58e99887e39956ee1e3eaf669cb92fbfa188a022)]: | ||
- @getlang/utils@0.1.1 | ||
## 0.1.0 | ||
@@ -4,0 +13,0 @@ |
@@ -1,6 +0,11 @@ | ||
import { ConversionError, NullSelection, SelectorSyntaxError, invariant, } from '@getlang/utils'; | ||
import { ConversionError, NullSelection, SelectorSyntaxError, SliceSyntaxError, invariant, } from '@getlang/utils'; | ||
import { parse as acorn } from 'acorn'; | ||
import esquery from 'esquery'; | ||
export const parse = (js) => { | ||
return acorn(js, { ecmaVersion: 'latest' }); | ||
try { | ||
return acorn(js, { ecmaVersion: 'latest' }); | ||
} | ||
catch (e) { | ||
throw new SliceSyntaxError('Could not parse slice', { cause: e }); | ||
} | ||
}; | ||
@@ -7,0 +12,0 @@ export const select = (node, selector, expand) => { |
{ | ||
"name": "@getlang/lib", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"license": "Apache-2.0", | ||
@@ -20,3 +20,3 @@ "type": "module", | ||
"dependencies": { | ||
"@getlang/utils": "^0.1.0", | ||
"@getlang/utils": "^0.1.1", | ||
"@getlang/xpath": "0.0.35-0", | ||
@@ -23,0 +23,0 @@ "@types/esquery": "^1.5.4", |
@@ -5,2 +5,3 @@ import { | ||
SelectorSyntaxError, | ||
SliceSyntaxError, | ||
invariant, | ||
@@ -13,3 +14,7 @@ } from '@getlang/utils' | ||
export const parse = (js: string): AnyNode => { | ||
return acorn(js, { ecmaVersion: 'latest' }) | ||
try { | ||
return acorn(js, { ecmaVersion: 'latest' }) | ||
} catch (e) { | ||
throw new SliceSyntaxError('Could not parse slice', { cause: e }) | ||
} | ||
} | ||
@@ -16,0 +21,0 @@ |
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
36447
653
Updated@getlang/utils@^0.1.1