Socket
Socket
Sign inDemoInstall

nostalgie

Package Overview
Dependencies
157
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.39.0 to 0.39.1

33

dist/index.browser.js

@@ -26,2 +26,15 @@ 'use strict';

let timeout = null;
const findParentScriptTag = (node) => {
let nextNode = node;
while (nextNode) {
if (nextNode instanceof HTMLScriptElement) {
break;
}
nextNode = nextNode.parentNode;
if (!nextNode) {
throw new Error(`Unable to find the triggering script element`);
}
}
return nextNode;
};
const onChange = (records) => {

@@ -32,3 +45,3 @@ if (timeout) {

timeout = setTimeout(() => {
refresh(records.map((record) => record.target));
refresh(records.map((record) => findParentScriptTag(record.target)));
timeout = null;

@@ -38,2 +51,3 @@ }, 1000);

const observer = new MutationObserver(onChange);
const scriptTagsToBasePaths = new WeakMap();
function refresh(scripts) {

@@ -44,4 +58,8 @@ const entrypointPaths = [];

for (const script of scripts) {
const scriptId = idx++;
const basePath = `/script/${scriptId}`;
let basePath = scriptTagsToBasePaths.get(script);
if (!basePath) {
const scriptId = idx++;
basePath = `/script/${scriptId}`;
scriptTagsToBasePaths.set(script, basePath);
}
const rawDependencies = script.dataset.dependencies;

@@ -59,3 +77,3 @@ const dependencies = {};

files[`${basePath}/package.json`] = JSON.stringify({
name: `script${scriptId}`,
name: 'script',
version: '0.0.0',

@@ -82,3 +100,8 @@ main: 'index.js',

entrypointPaths.push(`${basePath}/index.js`);
observer.observe(script, { childList: true });
observer.observe(script, {
attributes: true,
attributeFilter: ['data-dependencies', 'src'],
characterData: true,
subtree: true,
});
}

@@ -85,0 +108,0 @@ const cdnStrategy = strategyCdn.CdnStrategy.forJsDelivr(readUrl);

@@ -26,2 +26,15 @@ 'use strict';

let timeout = null;
const findParentScriptTag = (node) => {
let nextNode = node;
while (nextNode) {
if (nextNode instanceof HTMLScriptElement) {
break;
}
nextNode = nextNode.parentNode;
if (!nextNode) {
throw new Error(`Unable to find the triggering script element`);
}
}
return nextNode;
};
const onChange = (records) => {

@@ -32,3 +45,3 @@ if (timeout) {

timeout = setTimeout(() => {
refresh(records.map((record) => record.target));
refresh(records.map((record) => findParentScriptTag(record.target)));
timeout = null;

@@ -38,2 +51,3 @@ }, 1000);

const observer = new MutationObserver(onChange);
const scriptTagsToBasePaths = new WeakMap();
function refresh(scripts) {

@@ -44,4 +58,8 @@ const entrypointPaths = [];

for (const script of scripts) {
const scriptId = idx++;
const basePath = `/script/${scriptId}`;
let basePath = scriptTagsToBasePaths.get(script);
if (!basePath) {
const scriptId = idx++;
basePath = `/script/${scriptId}`;
scriptTagsToBasePaths.set(script, basePath);
}
const rawDependencies = script.dataset.dependencies;

@@ -59,3 +77,3 @@ const dependencies = {};

files[`${basePath}/package.json`] = JSON.stringify({
name: `script${scriptId}`,
name: 'script',
version: '0.0.0',

@@ -82,3 +100,8 @@ main: 'index.js',

entrypointPaths.push(`${basePath}/index.js`);
observer.observe(script, { childList: true });
observer.observe(script, {
attributes: true,
attributeFilter: ['data-dependencies', 'src'],
characterData: true,
subtree: true,
});
}

@@ -85,0 +108,0 @@ const cdnStrategy = strategyCdn.CdnStrategy.forJsDelivr(readUrl);

4

package.json
{
"name": "nostalgie",
"version": "0.39.0",
"version": "0.39.1",
"description": "A reminder of what the web once was - your hopes and dreams and a single html file",

@@ -71,3 +71,3 @@ "keywords": [

},
"gitHead": "2af5691d917fb97c783dbc736c422f07941f141c"
"gitHead": "d7a0ba61dc4dfac9acd58f9cd7c38be0f247b2c6"
}

@@ -27,3 +27,3 @@ # nostalgie

```html
<script src="https://cdn.jsdelivr.net/npm/nostalgie@0.39.0/dist/index.umd.js"></script>
<script src="https://cdn.jsdelivr.net/npm/nostalgie@0.39.1/dist/index.umd.js"></script>
```

@@ -30,0 +30,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc