From 0cd9c85940d87204495b344734d2f39bfe75440b Mon Sep 17 00:00:00 2001 From: Shahar Or Date: Wed, 13 May 2015 07:49:32 +0300 Subject: [PATCH] Use the unicode copyright symbol U+00A9 --- index.js | 6 +++--- test.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index b54d040..59ef579 100644 --- a/index.js +++ b/index.js @@ -15,10 +15,10 @@ var merge = require('merge-deep'); * * ```js * {%= copyright() %} - * //=> Copyright (c) 2014-2015, Jon Schlinkert. + * //=> Copyright © 2014-2015, Jon Schlinkert. * * {%= copyright({year: 2012}) %} - * //=> Copyright (c) 2012-2014 Jon Schlinkert. + * //=> Copyright © 2012-2014 Jon Schlinkert. * ``` * * @param {Number} `year` Optionally pass the start year of the project. @@ -57,7 +57,7 @@ module.exports = function copyright(locals) { } var current = new Date().getFullYear(); - var str = 'Copyright (c) '; + var str = 'Copyright © '; if (ctx.copyright) { ctx = merge(ctx, ctx.copyright); diff --git a/test.js b/test.js index 290b8f0..4e500f0 100644 --- a/test.js +++ b/test.js @@ -18,48 +18,48 @@ var locals = {author: {name: 'Jon Schlinkert', url: 'https://github.com/jonschli describe('helper copyright', function () { it('should return a formatted copyright statement:', function () { - copyrightHelper(locals).should.eql('Copyright (c) '+ year + ' Jon Schlinkert'); + copyrightHelper(locals).should.eql('Copyright © '+ year + ' Jon Schlinkert'); }); it('should update the start year:', function () { var ctx = {author: {name: 'Jon Schlinkert', url: 'https://github.com/jonschlinkert'}, year: '2013'}; - copyrightHelper(ctx).should.eql('Copyright (c) 2013-'+ year + ' Jon Schlinkert'); + copyrightHelper(ctx).should.eql('Copyright © 2013-'+ year + ' Jon Schlinkert'); }); it('should update the range of years:', function () { var ctx = {author: {name: 'Jon Schlinkert', url: 'https://github.com/jonschlinkert'}, years: '2013-2020'}; - copyrightHelper(ctx).should.eql('Copyright (c) 2013-2020 Jon Schlinkert'); + copyrightHelper(ctx).should.eql('Copyright © 2013-2020 Jon Schlinkert'); }); it('should work as a lodash helper:', function () { - _.template('<%= copyright({author: author}) %>', {imports: {copyright: copyrightHelper}})(locals).should.eql('Copyright (c) ' + year + ' Jon Schlinkert'); + _.template('<%= copyright({author: author}) %>', {imports: {copyright: copyrightHelper}})(locals).should.eql('Copyright © ' + year + ' Jon Schlinkert'); }); it('should work as a lodash mixin:', function () { _.mixin({copyright: copyrightHelper}); - _.template('<%= _.copyright({author: author}) %>')(locals).should.eql('Copyright (c) '+ year + ' Jon Schlinkert'); + _.template('<%= _.copyright({author: author}) %>')(locals).should.eql('Copyright © '+ year + ' Jon Schlinkert'); }); it('should work as a handlebars helper:', function () { handlebars.registerHelper('copyright', copyrightHelper); - handlebars.compile('{{copyright this}}')(locals).should.eql('Copyright (c) '+ year + ' Jon Schlinkert'); + handlebars.compile('{{copyright this}}')(locals).should.eql('Copyright © '+ year + ' Jon Schlinkert'); }); }); describe('when `linkify` is `true`:', function () { it('should return a formatted copyright statement:', function () { locals = _.extend({linkify: true}, locals); - copyrightHelper(locals).should.eql('Copyright (c) ' + year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); + copyrightHelper(locals).should.eql('Copyright © ' + year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); }); it('should work as a lodash helper:', function () { - _.template('<%= copyright({author: author, linkify: true}) %>', {imports: {copyright: copyrightHelper}})(locals).should.eql('Copyright (c) ' + year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); + _.template('<%= copyright({author: author, linkify: true}) %>', {imports: {copyright: copyrightHelper}})(locals).should.eql('Copyright © ' + year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); }); it('should work as a handlebars helper:', function () { locals = _.extend({linkify: true}, locals); handlebars.registerHelper('copyright', copyrightHelper); - handlebars.compile('{{copyright this}}')(locals).should.eql('Copyright (c) '+ year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); + handlebars.compile('{{copyright this}}')(locals).should.eql('Copyright © '+ year + ' [Jon Schlinkert](https://github.com/jonschlinkert)'); }); -}); \ No newline at end of file +});