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

@tokey/imports-parser

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tokey/imports-parser - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

5

dist/imports-parser.d.ts

@@ -8,4 +8,4 @@ import { Token, Descriptors } from '@tokey/core';

defaultName: string | undefined;
named: NamedMapping[] | undefined;
tagged: Record<string, NamedMapping[] | undefined>;
named: Record<string, string> | undefined;
tagged: Record<string, Record<string, string>> | undefined;
from: string | undefined;

@@ -16,4 +16,3 @@ errors: string[];

}
type NamedMapping = [from: string, to: string];
export {};
//# sourceMappingURL=imports-parser.d.ts.map

12

dist/imports-parser.js

@@ -45,3 +45,3 @@ "use strict";

let named = undefined;
let tagged = {};
let tagged = undefined;
let from;

@@ -137,3 +137,3 @@ t = s.next();

else {
s.back();
s.back(); //?
errors.push('invalid missing source');

@@ -153,3 +153,3 @@ }

named,
tagged,
tagged: tagged,
from,

@@ -166,3 +166,3 @@ errors,

var _a;
const named = [];
const named = {};
const tagged = {};

@@ -206,7 +206,7 @@ const tokens = [];

const name = tokens[0].value;
named.push([name, name]);
named[name] = name;
}
else if (tokens.length === 3) {
if (tokens[1].value === 'as') {
named.push([tokens[0].value, tokens[2].value]);
named[tokens[0].value] = tokens[2].value;
}

@@ -213,0 +213,0 @@ }

{
"name": "@tokey/imports-parser",
"description": "parser for esm like imports",
"version": "0.1.1",
"version": "0.1.2",
"main": "dist/imports-parser.js",

@@ -6,0 +6,0 @@ "types": "dist/imports-parser.d.ts",

@@ -62,4 +62,4 @@ import {

defaultName: string | undefined;
named: NamedMapping[] | undefined;
tagged: Record<string, NamedMapping[] | undefined>;
named: Record<string, string> | undefined;
tagged: Record<string, Record<string, string>> | undefined;
from: string | undefined;

@@ -71,4 +71,2 @@ errors: string[];

type NamedMapping = [from: string, to: string];
const isImportBlockEndError = (token: CodeToken) => token.value === 'from' || token.type === ';';

@@ -96,4 +94,4 @@

let star = false;
let named: ImportValue['named'] = undefined;
let tagged: ImportValue['tagged'] = {};
let named = undefined;
let tagged = undefined;
let from;

@@ -180,3 +178,3 @@ t = s.next();

} else {
s.back();
s.back(); //?
errors.push('invalid missing source');

@@ -196,3 +194,3 @@ }

named,
tagged,
tagged: tagged,
from,

@@ -209,4 +207,4 @@ errors,

function processNamedBlock(block: CodeToken[], errors: string[], taggedImportSupport: boolean) {
const named: [from: string, to: string][] = [];
const tagged: Record<string, [from: string, to: string][]> = {};
const named: Record<string, string> = {};
const tagged: Record<string, Record<string, string>> = {};
const tokens: CodeToken[] = [];

@@ -250,6 +248,6 @@

const name = tokens[0].value;
named.push([name, name]);
named[name] = name;
} else if (tokens.length === 3) {
if (tokens[1].value === 'as') {
named.push([tokens[0].value, tokens[2].value]);
named[tokens[0].value] = tokens[2].value;
}

@@ -256,0 +254,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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