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

sheetify

Package Overview
Dependencies
Maintainers
7
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sheetify - npm Package Compare versions

Comparing version 7.4.0 to 8.0.0-beta.0

lib/supported-synonyms.js

3

package.json
{
"name": "sheetify",
"version": "7.4.0",
"version": "8.0.0-beta.0",
"description": "Modular CSS bundler",

@@ -58,2 +58,3 @@ "repository": "stackcss/sheetify",

"from2-string": "^1.1.0",
"hui": "^1.2.2",
"jsdom": "^9.4.2",

@@ -60,0 +61,0 @@ "nyc": "^11.9.0",

@@ -41,1 +41,33 @@ const browserify = require('browserify')

})
test('transform-package with a synonym for sheetify', function (t) {
t.test('should transform CSS from package.json with options from a file with a synonym for sheetify ', function (t) {
t.plan(1)
const expath = path.join(__dirname, 'fixtures/transform-package/expected.css')
const expected = fs.readFileSync(expath, 'utf8').trim()
const ws = concat(function (buf) {
const res = String(buf).trim()
t.equal(res, expected, 'CSS was transformed')
})
const bpath = path.join(__dirname, 'fixtures/transform-package/source-synonym.js')
browserify(bpath)
.transform(sheetify)
.transform(function (file) {
return through(function (buf, enc, next) {
const str = buf.toString('utf8')
this.push(str.replace(/sheetify\/insert/g, 'insert-css'))
next()
})
})
.plugin('css-extract', { out: outFn })
.bundle()
function outFn () {
return ws
}
})
})

@@ -13,2 +13,3 @@ const isMemberExpression = require('estree-is-member-expression')

const sheetify = require('./index')
const SUPPORTED_SYNONYMS = require('./lib/supported-synonyms')

@@ -77,3 +78,4 @@ module.exports = transform

if (src.indexOf('sheetify') === -1) {
// Skip transforming any files that do not contain synonyms for sheetify
if (!SUPPORTED_SYNONYMS.some(name => src.includes(name))) {
self.push(src)

@@ -115,3 +117,3 @@ self.push(null)

node.arguments.length === 1 &&
node.arguments[0].value === 'sheetify') {
SUPPORTED_SYNONYMS.includes(node.arguments[0].value)) {
node.update('0')

@@ -118,0 +120,0 @@ mname = node.parent.id.name

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