fetch-inject
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -5,2 +5,7 @@ # Change Log | ||
<a name="2.0.3"></a> | ||
## [2.0.3](https://git.habd.as/jhabdas/fetch-inject/compare/v2.0.2...v2.0.3) (2019-03-16) | ||
Maintenance release updates package manifest, removes copyright year(s) from dist files and adds author homepage. No other significant changes here. | ||
<a name="2.0.2"></a> | ||
@@ -7,0 +12,0 @@ ## [2.0.2](https://git.habd.as/jhabdas/fetch-inject/compare/v2.0.1...v2.0.2) (2018-08-02) |
/** | ||
* Copyright (C) 2017—2018 Josh Habdas <jhabdas@protonmail.com> | ||
* Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | ||
* | ||
@@ -4,0 +4,0 @@ * This software is provided 'as-is', without any express or implied |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v2.0.2 | Copyright (C) 2017–2018 Josh Habdas <jhabdas@protonmail.com> | @license Zlib */ | ||
/*! Fetch Inject v2.0.5 | Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | @license Zlib */ | ||
const head=function(e,t,r,n,o,c,a){c=t.createElement(r),a=t.getElementsByTagName(r)[0],c.appendChild(t.createTextNode(n.text)),c.onload=o(n),a?a.parentNode.insertBefore(c,a):t.head.appendChild(c)},fetchInject=function(e,t){if(!arguments.length)return Promise.reject(new ReferenceError("Failed to execute 'fetchInject': 1 argument required but only 0 present."));if(arguments[0]&&arguments[0].constructor!==Array)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 1 must be of type 'Array'."));if(arguments[1]&&arguments[1].constructor!==Promise)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 2 must be of type 'Promise'."));const r=[],n=t?[].concat(t):[],o=[];return e.forEach(e=>n.push(window.fetch(e).then(e=>[e.clone().text(),e.blob()]).then(e=>Promise.all(e).then(e=>{r.push({text:e[0],blob:e[1]})})))),Promise.all(n).then(()=>(r.forEach(e=>{o.push({then:t=>{e.blob.type.includes("text/css")?head(window,document,"style",e,t):head(window,document,"script",e,t)}})}),Promise.all(o)))};export default fetchInject; |
@@ -5,3 +5,3 @@ var fetchInject = (function () { | ||
/** | ||
* Copyright (C) 2017—2018 Josh Habdas <jhabdas@protonmail.com> | ||
* Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | ||
* | ||
@@ -8,0 +8,0 @@ * This software is provided 'as-is', without any express or implied |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v2.0.2 | Copyright (C) 2017–2018 Josh Habdas <jhabdas@protonmail.com> | @license Zlib */ | ||
/*! Fetch Inject v2.0.5 | Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | @license Zlib */ | ||
var fetchInject=function(){"use strict";const e=function(e,t,r,n,o,c,i){c=t.createElement(r),i=t.getElementsByTagName(r)[0],c.appendChild(t.createTextNode(n.text)),c.onload=o(n),i?i.parentNode.insertBefore(c,i):t.head.appendChild(c)};return function(t,r){if(!arguments.length)return Promise.reject(new ReferenceError("Failed to execute 'fetchInject': 1 argument required but only 0 present."));if(arguments[0]&&arguments[0].constructor!==Array)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 1 must be of type 'Array'."));if(arguments[1]&&arguments[1].constructor!==Promise)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 2 must be of type 'Promise'."));const n=[],o=r?[].concat(r):[],c=[];return t.forEach(e=>o.push(window.fetch(e).then(e=>[e.clone().text(),e.blob()]).then(e=>Promise.all(e).then(e=>{n.push({text:e[0],blob:e[1]})})))),Promise.all(o).then(()=>(n.forEach(t=>{c.push({then:r=>{t.blob.type.includes("text/css")?e(window,document,"style",t,r):e(window,document,"script",t,r)}})}),Promise.all(c)))}}(); |
@@ -8,3 +8,3 @@ (function (global, factory) { | ||
/** | ||
* Copyright (C) 2017—2018 Josh Habdas <jhabdas@protonmail.com> | ||
* Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | ||
* | ||
@@ -11,0 +11,0 @@ * This software is provided 'as-is', without any express or implied |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v2.0.2 | Copyright (C) 2017–2018 Josh Habdas <jhabdas@protonmail.com> | @license Zlib */ | ||
/*! Fetch Inject v2.0.5 | Copyright (C) Josh Habdas <jhabdas@protonmail.com> (https://habd.as) | @license Zlib */ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.fetchInject=t()}(this,function(){"use strict";const e=function(e,t,n,r,o,c,i){c=t.createElement(n),i=t.getElementsByTagName(n)[0],c.appendChild(t.createTextNode(r.text)),c.onload=o(r),i?i.parentNode.insertBefore(c,i):t.head.appendChild(c)};return function(t,n){if(!arguments.length)return Promise.reject(new ReferenceError("Failed to execute 'fetchInject': 1 argument required but only 0 present."));if(arguments[0]&&arguments[0].constructor!==Array)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 1 must be of type 'Array'."));if(arguments[1]&&arguments[1].constructor!==Promise)return Promise.reject(new TypeError("Failed to execute 'fetchInject': argument 2 must be of type 'Promise'."));const r=[],o=n?[].concat(n):[],c=[];return t.forEach(e=>o.push(window.fetch(e).then(e=>[e.clone().text(),e.blob()]).then(e=>Promise.all(e).then(e=>{r.push({text:e[0],blob:e[1]})})))),Promise.all(o).then(()=>(r.forEach(t=>{c.push({then:n=>{t.blob.type.includes("text/css")?e(window,document,"style",t,n):e(window,document,"script",t,n)}})}),Promise.all(c)))}}); |
{ | ||
"name": "fetch-inject", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Dynamically inline assets into the DOM using Fetch Injection.", | ||
"author": "Josh Habdas <jhabdas@protonmail.com>", | ||
"author": "Josh Habdas <jhabdas@protonmail.com> (https://habd.as)", | ||
"module": "dist/fetch-inject.es.js", | ||
@@ -15,5 +15,6 @@ "main": "dist/fetch-inject.umd.js", | ||
], | ||
"homepage": "https://habd.as/code/fetch-inject/", | ||
"repository": { | ||
"type": "git", | ||
"url": "git@git.habd.as:jhabdas/fetch-inject.git" | ||
"url": "https://git.habd.as/jhabdas/fetch-inject.git" | ||
}, | ||
@@ -23,5 +24,5 @@ "scripts": { | ||
"clean": "rimraf dist", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"test": "while true; do head -n 100 /dev/urandom; sleep 0.1; done | hexdump -C | grep 'ca fe'", | ||
"lint": "standard", | ||
"release": "standard-version" | ||
"release": "standard-version -s" | ||
}, | ||
@@ -28,0 +29,0 @@ "standard-version": { |
@@ -7,3 +7,3 @@ # Fetch Inject | ||
![Zero dependencies](https://img.shields.io/badge/dependencies-0-8892BF.svg?style=flat-square&longCache=true) | ||
![Compressed size](http://img.badgesize.io/https://cdn.jsdelivr.net/npm/fetch-inject@latest?compression=brotli&style=flat-square) | ||
![Compressed size](https://img.badgesize.io/https://cdn.jsdelivr.net/npm/fetch-inject@latest?compression=brotli&style=flat-square) | ||
[![NPM downloads per month](https://img.shields.io/npm/dm/fetch-inject.svg?style=flat-square)](https://www.npmjs.com/package/fetch-inject) | ||
@@ -302,2 +302,4 @@ [![Hits per month via jsDelivr CDN](https://data.jsdelivr.com/v1/package/npm/fetch-inject/badge)](https://www.jsdelivr.com/package/npm/fetch-inject) | ||
- [load-stylesheets](https://github.com/brettz9/load-stylesheets) - Promise-based stylesheet-loading via `<link>` tags | ||
- [PreloadJS](https://github.com/CreateJS/PreloadJS) - Full-featured JS preloader using XHR2 | ||
- [Gluebert](https://gluebert.com) - A helper for lazy loading DOM elements, StyleSheets and JavaScript files using `import()` | ||
@@ -304,0 +306,0 @@ ## WordPress Plugin |
Sorry, the diff of this file is not supported yet
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
48901
0
317