@sanity/export
Advanced tools
Comparing version 0.133.0-next.ddda7af6 to 0.133.0-realtime-block-editor.410b182f
@@ -5,2 +5,6 @@ 'use strict'; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } | ||
@@ -92,7 +96,10 @@ | ||
if (isAsset && action === ACTION_REWRITE) { | ||
const assetId = item.asset._ref; | ||
const asset = item.asset, | ||
other = _objectWithoutProperties(item, ['asset']); | ||
const assetId = asset._ref; | ||
if (isModernAsset(assetId)) { | ||
const assetType = getAssetType(item); | ||
const filePath = `${assetType}s/${generateFilename(assetId)}`; | ||
return { _sanityAsset: `${assetType}@file://./${filePath}` }; | ||
return _extends({ _sanityAsset: `${assetType}@file://./${filePath}` }, other); | ||
} | ||
@@ -103,3 +110,3 @@ | ||
const filePath = `${type}s/${generateFilename(assetId)}`; | ||
return { _sanityAsset: `${type}@file://./${filePath}` }; | ||
return _extends({ _sanityAsset: `${type}@file://./${filePath}` }, other); | ||
} | ||
@@ -106,0 +113,0 @@ |
{ | ||
"name": "@sanity/export", | ||
"version": "0.133.0-next.ddda7af6", | ||
"version": "0.133.0-realtime-block-editor.410b182f", | ||
"description": "Export Sanity documents and assets", | ||
@@ -35,3 +35,3 @@ "main": "lib/export.js", | ||
"devDependencies": { | ||
"@sanity/client": "0.133.0-next.ddda7af6", | ||
"@sanity/client": "0.133.0-realtime-block-editor.410b182f", | ||
"decompress": "^4.2.0", | ||
@@ -38,0 +38,0 @@ "jest": "^22.1.4", |
@@ -144,7 +144,8 @@ const path = require('path') | ||
if (isAsset && action === ACTION_REWRITE) { | ||
const assetId = item.asset._ref | ||
const {asset, ...other} = item | ||
const assetId = asset._ref | ||
if (isModernAsset(assetId)) { | ||
const assetType = getAssetType(item) | ||
const filePath = `${assetType}s/${generateFilename(assetId)}` | ||
return {_sanityAsset: `${assetType}@file://./${filePath}`} | ||
return {_sanityAsset: `${assetType}@file://./${filePath}`, ...other} | ||
} | ||
@@ -155,3 +156,3 @@ | ||
const filePath = `${type}s/${generateFilename(assetId)}` | ||
return {_sanityAsset: `${type}@file://./${filePath}`} | ||
return {_sanityAsset: `${type}@file://./${filePath}`, ...other} | ||
} | ||
@@ -213,5 +214,10 @@ | ||
return new Promise((resolve, reject) => | ||
miss.pipe(stream, hasher, fse.createWriteStream(filePath), err => { | ||
return err ? reject(err) : resolve(hash.digest('hex')) | ||
}) | ||
miss.pipe( | ||
stream, | ||
hasher, | ||
fse.createWriteStream(filePath), | ||
err => { | ||
return err ? reject(err) : resolve(hash.digest('hex')) | ||
} | ||
) | ||
) | ||
@@ -218,0 +224,0 @@ } |
@@ -155,3 +155,7 @@ const os = require('os') | ||
archive.append(jsonStream, {name: 'data.ndjson', prefix}) | ||
miss.pipe(archive, outputStream, onComplete) | ||
miss.pipe( | ||
archive, | ||
outputStream, | ||
onComplete | ||
) | ||
@@ -158,0 +162,0 @@ async function onComplete(err) { |
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
41328
26
895