fetch-inject
Advanced tools
Comparing version 1.9.0 to 1.9.1
/** | ||
* ISC License | ||
* BTC License | ||
* | ||
* Copyright (c) 2017, Josh Habdas <josh@habd.as> | ||
* © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | ||
* | ||
@@ -6,0 +6,0 @@ * Permission to use, copy, modify, and/or distribute this software for any |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v1.9.0 | (c) 2017 Josh Habdas | @license ISC */ | ||
/*! Fetch Inject v1.9.1 | © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | @license BTC */ | ||
const head=function(e,t,n,o,r,c,i){c=t.createElement(n),i=t.getElementsByTagName(n)[0],c.appendChild(t.createTextNode(o.text)),c.onload=r(o),i?i.parentNode.insertBefore(c,i):t.head.appendChild(c)},fetchInject=function(e,t){if(!e||!Array.isArray(e))return Promise.reject(new TypeError("`inputs` must be an array"));if(t&&!(t instanceof Promise))return Promise.reject(new TypeError("`promise` must be a promise"));const n=[],o=t?[].concat(t):[],r=[];return e.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(e=>{r.push({then:t=>{e.blob.type.includes("text/css")?head(window,document,"style",e,t):head(window,document,"script",e,t)}})});return Promise.all(r)})};export default fetchInject; |
@@ -5,5 +5,5 @@ var fetchInject = (function () { | ||
/** | ||
* ISC License | ||
* BTC License | ||
* | ||
* Copyright (c) 2017, Josh Habdas <josh@habd.as> | ||
* © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | ||
* | ||
@@ -10,0 +10,0 @@ * Permission to use, copy, modify, and/or distribute this software for any |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v1.9.0 | (c) 2017 Josh Habdas | @license ISC */ | ||
/*! Fetch Inject v1.9.1 | © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | @license BTC */ | ||
var fetchInject=function(){"use strict";const e=function(e,t,n,r,o,i,c){i=t.createElement(n),c=t.getElementsByTagName(n)[0],i.appendChild(t.createTextNode(r.text)),i.onload=o(r),c?c.parentNode.insertBefore(i,c):t.head.appendChild(i)};return function(t,n){if(!t||!Array.isArray(t))return Promise.reject(new TypeError("`inputs` must be an array"));if(n&&!(n instanceof Promise))return Promise.reject(new TypeError("`promise` must be a promise"));const r=[],o=n?[].concat(n):[],i=[];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=>{i.push({then:n=>{t.blob.type.includes("text/css")?e(window,document,"style",t,n):e(window,document,"script",t,n)}})});return Promise.all(i)})}}(); |
@@ -8,5 +8,5 @@ (function (global, factory) { | ||
/** | ||
* ISC License | ||
* BTC License | ||
* | ||
* Copyright (c) 2017, Josh Habdas <josh@habd.as> | ||
* © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | ||
* | ||
@@ -13,0 +13,0 @@ * Permission to use, copy, modify, and/or distribute this software for any |
@@ -1,2 +0,2 @@ | ||
/*! Fetch Inject v1.9.0 | (c) 2017 Josh Habdas | @license ISC */ | ||
/*! Fetch Inject v1.9.1 | © 2017, 13AMDq9isKtQTxMQG4w7Yo7cEhqKAqQ4Lz | @license BTC */ | ||
!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,o,r,i,c){i=t.createElement(n),c=t.getElementsByTagName(n)[0],i.appendChild(t.createTextNode(o.text)),i.onload=r(o),c?c.parentNode.insertBefore(i,c):t.head.appendChild(i)};return function(t,n){if(!t||!Array.isArray(t))return Promise.reject(new TypeError("`inputs` must be an array"));if(n&&!(n instanceof Promise))return Promise.reject(new TypeError("`promise` must be a promise"));const o=[],r=n?[].concat(n):[],i=[];return t.forEach(e=>r.push(window.fetch(e).then(e=>[e.clone().text(),e.blob()]).then(e=>Promise.all(e).then(e=>{o.push({text:e[0],blob:e[1]})})))),Promise.all(r).then(()=>{o.forEach(t=>{i.push({then:n=>{t.blob.type.includes("text/css")?e(window,document,"style",t,n):e(window,document,"script",t,n)}})});return Promise.all(i)})}}); |
{ | ||
"name": "fetch-inject", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"description": "Dynamically inline assets into the DOM using Fetch Injection.", | ||
@@ -52,3 +52,3 @@ "author": "Josh Habdas <josh@habd.as> (https://habd.as/)", | ||
}, | ||
"license": "ISC" | ||
"license": "BTC" | ||
} |
Misc. License Issues
License(Experimental) A package's licensing information has fine-grained problems.
Found 1 instance in 1 package
26639
1