This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
Promise = require('es6-promise').Promise, | |
zlib = require('zlib'); | |
var utils = require('../utils'); | |
module.exports = function fileSizes(pureDir, callback) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Sanitize URL — Validate it looks like a URL, then make it less dirty. | |
* | |
* Oddnut Software | |
* Copyright (c) 2010 Eric Ferraiuolo - http://eric.ferraiuolo.name | |
* MIT License - http://www.opensource.org/licenses/mit-license.php | |
* | |
* Examples: | |
* | |
* 'Http://WWW.example.com/' » 'http://www.example.com/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var serialize = require('./serialize'); | |
module.exports = Exposed; | |
function Exposed() { | |
Object.defineProperties(this, { | |
// Brand with constructor. | |
'@exposed': {value: Exposed}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exposed.prototype._getApplicableNamespaces = function () { | |
var namespaces = this.__namespaces__.concat(), | |
proto = Object.getPrototypeOf(this); | |
function isApplicable(namespace) { | |
return !namespaces.some(function (ns) { | |
var nsRegex = new RegExp('^' + ns + '(?:$|\\..+)'); | |
return nsRegex.test(namespace); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.expose('foo', 'window.foo'); | |
console.log(res.locals.state); // => window.foo = "foo"; | |
app.expose('bar', 'window.bar'); | |
console.log(res.locals.state); // => window.foo = "foo"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports | |
.local | |
✓ should have a .local property | |
✓ should be the string "state" | |
.namespace | |
✓ should have a .namespace property | |
✓ should be null | |
.extend | |
✓ should have a .extend property | |
✓ should respond to .extend() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
parseCSS = require('css-parse'), | |
Promise = require('es6-promise').Promise; | |
module.exports = function gridUnits(pureDir, callback) { | |
readUnits(path.join(pureDir, 'grids-units.css')) | |
.then(parseCSS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
Promise = require('es6-promise').Promise, | |
zlib = require('zlib'); | |
module.exports = function fileSizes(pureDir, callback) { | |
getModules(pureDir) | |
.then(getFileSizes.bind(null, pureDir)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'), | |
path = require('path'), | |
Promise = require('es6-promise').Promise, | |
zlib = require('zlib'); | |
module.exports = filesizes; | |
// ----------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> var exposed = Exposed.create(); | |
undefined | |
> var obj = {}; | |
undefined | |
> Object.defineProperty(obj, 'foo', { | |
..... enumerable: true, | |
..... get: function () { return 'FOO'; } | |
..... }); | |
{ foo: [Getter] } | |
> exposed.add('foo', obj); |
NewerOlder